/* =====================================================
   GLOBAL RESET (MAX COMPATIBILITY)
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
}

/* =====================================================
   VARIABLES
===================================================== */
:root {
  --red: #b11226;
  --green: #0f5132;
  --gold: #f5c542;
  --glass: rgba(255,255,255,0.08);
}

/* =====================================================
   BASE
===================================================== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0f5132, #083b26);
  color: #ffffff;
  overflow-x: hidden;
}

/* =====================================================
   SNOW CANVAS (NEVER AFFECTS LAYOUT)
===================================================== */
#snow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* =====================================================
   HOME / LOGIN PAGE
===================================================== */
.home-wrapper {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--glass);
  padding: 2rem;
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.login-card h1 {
  font-size: 2.1rem;
  margin-bottom: 0.4rem;
}

.subtitle {
  margin-bottom: 1.5rem;
  opacity: 0.85;
}

/* =====================================================
   TABS (LOGIN + DASHBOARD)
===================================================== */
.tabs,
.person-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
}

/* Space using margins (NO GAP – SAFARI SAFE) */
.tab,
.person-tab {
  flex: 1 1 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  padding: 0.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.tab + .tab,
.person-tab + .person-tab {
  margin-left: 0.5rem;
}

.tab.active,
.person-tab.active {
  background: var(--gold);
  color: #333;
  font-weight: 600;
}

/* =====================================================
   TAB CONTENT
===================================================== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* =====================================================
   FORMS
===================================================== */
input,
button {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font: inherit;
  margin-bottom: 0.9rem;
}

button {
  background: var(--gold);
  color: #333;
  font-weight: 600;
  cursor: pointer;
}

.message {
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* =====================================================
   DASHBOARD HEADER
===================================================== */
.header {
  text-align: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* =====================================================
   LOGOUT BUTTON
===================================================== */
.logout-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  z-index: 2;
}

/* =====================================================
   PERSON PANELS
===================================================== */
.person-panel {
  display: none;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.person-panel.active {
  display: block;
}

/* =====================================================
   PERSON CARD
===================================================== */
.person-card {
  background: #ffffff;
  color: #333;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.empty {
  padding: 1rem;
  opacity: 0.7;
}

/* =====================================================
   GIFT ROWS (BULLETPROOF LAYOUT)
===================================================== */
.gift-form {
  margin: 0;
}

.gift-row {
  display: table;
  width: 100%;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #eee;
}

.gift-row:last-child {
  border-bottom: none;
}

.gift-checkbox {
  display: table-cell;
  width: 28px;
  vertical-align: top;
}

.gift-text {
  display: table-cell;
  vertical-align: top;
  padding-left: 0.75rem;
  word-break: break-word;
  line-height: 1.4;
}

/* =====================================================
   ADD IDEA SECTION
===================================================== */
.add-idea {
  background: rgba(255,255,255,0.1);
  padding: 1.5rem;
  border-radius: 16px;
  max-width: 600px;
  margin: 1.5rem auto;
  position: relative;
  z-index: 1;
}

.add-idea h2 {
  margin-bottom: 0.75rem;
}

/* =====================================================
   MOBILE SAFETY
===================================================== */
@media (max-width: 600px) {
  .login-card {
    padding: 1.6rem;
  }

  .tab,
  .person-tab {
    font-size: 0.85rem;
  }
}

@media (max-height: 650px) {
  .home-wrapper {
    align-items: flex-start;
    padding-top: 2rem;
  }
}

/* ===== CHECK OWNERSHIP VISUAL ===== */
.gift-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.gift-checkbox:disabled + .gift-text {
  opacity: 0.7;
}
