/* =========================
   SecondMate – Global Styles
   File: styles.css
   ========================= */

/* ----- Theme Variables ----- */
:root{
  --max-width: 1100px;
  --content-max: 980px;

  --nav-blue: #2b6cff;
  --cta-yellow: #ffd84d;

  --bg: #0f1115;
  --text: rgba(255,255,255,0.95);
  --muted: rgba(255,255,255,0.82);

  /* Glass surfaces */
  --panel: transparent;
  --panel-soft: transparent;

  --border: rgba(255,255,255,0.14);
  --border-soft: rgba(255,255,255,0.10);

  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;

  /* Shadows */
  --shadow-lg: 0 18px 40px rgba(0,0,0,0.20);
  --shadow-md: 0 12px 28px rgba(0,0,0,0.18);

  /* Edge glow */
  --glow: 0 0 0 1px rgba(255,255,255,0.05),
          0 0 28px rgba(120,170,255,0.08);

  /* Dropdown */
  --dropdown-bg: rgba(20,22,26,0.92);
  --dropdown-text: rgba(255,255,255,0.95);
  --dropdown-selected: #2b6cff;

  --gutter: 24px;
}

/* ----- Reset / Base ----- */
*,
*::before,
*::after{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url("./background.jpg") center center / cover no-repeat fixed;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6{ margin: 0; }
p{ margin: 0; }

/* =========================
   GLOBAL NAVIGATION
   ========================= */
header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  padding: 12px 0;
  background: rgba(15,17,21,0.60);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav{
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo{
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img{
  height: 32px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}

/* Center nav links — absolutely positioned relative to the fixed header (100vw),
   so left:50% is the true viewport centre regardless of logo/button widths */
.nav-left{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-left::-webkit-scrollbar{ display:none; }

/* Right side actions */
.nav-right{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Base nav link style */
.nav-left a,
.nav-right a{
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
  font-weight: 550;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-left a:hover,
.nav-right a:hover{
  color: #fff;
  transform: translateY(-1px);
}

/* ✅ ACTIVE STATE — ONLY CENTER LINKS */
.nav-left a.active{
  color: #fff;
  position: relative;
}

.nav-left a.active::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.55);
}

/* =========================
   NAV BUTTONS
   ========================= */


/* Login/Logout button (blue) */
.nav a.nav-login{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--nav-blue);
  color: #fff;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 750;

  border: 1px solid rgba(43,108,255,0.65);
  box-shadow: 0 10px 24px rgba(43,108,255,0.40);
}

.nav a.nav-login:hover{
  background: #4c83ff;
  box-shadow: 0 14px 34px rgba(43,108,255,0.55);
}

/* ✅ Register button (yellow CTA) */
.nav a.nav-register{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--cta-yellow);
  color: #0b1220;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;

  border: 1px solid rgba(255,216,77,0.35);
  box-shadow: 0 10px 24px rgba(255,216,77,0.30);

  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.nav a.nav-register:hover{
  transform: translateY(-1px);
  background: #ffe37a;
  box-shadow: 0 14px 34px rgba(255,216,77,0.45);
}

/* (Kept for backwards compatibility if any old pages still use nav-cta) */
.nav a.nav-cta{
  background: var(--cta-yellow);
  color: #0b1220;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  border: 1px solid rgba(255,216,77,0.35);
  box-shadow: 0 10px 24px rgba(255,216,77,0.30);
}
.nav a.nav-cta:hover{
  background: #ffe37a;
  box-shadow: 0 14px 34px rgba(255,216,77,0.45);
}

/* Avatar circle (authenticated state) */
.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,216,77,0.12);
  border: 2px solid rgba(255,216,77,0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.nav-avatar:hover {
  background: rgba(255,216,77,0.22);
  border-color: rgba(255,216,77,0.75);
  transform: scale(1.08);
}

/* User info display in nav */
.nav-user{
  display: flex;
  flex-direction: row;
  align-items: center;
  order: -1;
}

.nav-user .user-name{
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffd84d;
  white-space: nowrap;
}

.nav-user .user-email{
  display: none;
}

/* Mobile nav user - hidden on desktop */
.mobile-nav-user{
  display: none;
}

/* Mobile menu active state - show mobile nav user */
.mobile-menu.active .mobile-nav-user{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
}

.mobile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,216,77,0.12);
  border: 2px solid rgba(255,216,77,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.mobile-avatar:hover {
  background: rgba(255,216,77,0.20);
  border-color: rgba(255,216,77,0.75);
}

.mobile-nav-user .mobile-user-name{
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}

.mobile-nav-user .mobile-user-email{
  font-size: 0.78rem;
  color: rgba(255,255,255,0.40);
}

/* =========================
   NAV SPACING
   ========================= */

/* Bigger spacing between Plans and Register */
.nav-right .nav-register{
  margin-left: 22px;
}

/* Fallback spacing if you rely on ids */
#nav-register{ margin-left: 22px; }

/* =========================
   PAGE LAYOUT
   ========================= */
.overlay{
  min-height: 100vh;
  padding: 110px 20px 70px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.content{
  width: min(var(--content-max), 100%);
  margin-top: 10px;
}

/* =========================
   PANELS / CARDS
   ========================= */
.card,
.panel{
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), var(--shadow-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.panel.soft{
  background: var(--panel-soft);
  box-shadow: var(--shadow-md), var(--glow);
}

/* =========================
   INPUTS
   ========================= */
input, textarea, select{
  font: inherit;
  color: inherit;
}

.input,
.search,
select.input{
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
}

.input::placeholder,
.search::placeholder{
  color: rgba(255,255,255,0.65);
}

.input:focus,
.search:focus,
select.input:focus,
textarea:focus{
  border-color: rgba(120,170,255,0.40);
  box-shadow: 0 0 0 1px rgba(120,170,255,0.18),
              0 0 22px rgba(120,170,255,0.10);
}

/* =========================
   HAMBURGER BUTTON (Mobile)
   ========================= */
.hamburger{
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: rgba(255,255,255,0.85);
  transition: color 0.2s ease;
  grid-column: 3;
  justify-self: end;
}

.hamburger:hover{
  color: #fff;
}

/* =========================
   MOBILE MENU OVERLAY
   ========================= */
.mobile-menu{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,17,21,0.98);
  z-index: 100;
  flex-direction: column;
  padding: 80px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.active{
  display: flex;
  opacity: 1;
  visibility: visible;
}

.mobile-menu-close{
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s ease;
}

.mobile-menu-close:hover{
  color: #fff;
}

.mobile-menu-content{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.mobile-menu-content a{
  display: block;
  padding: 16px 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s ease;
}

.mobile-menu-content a:hover{
  color: #fff;
}

.mobile-menu-actions{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.mobile-login,
.mobile-register{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.mobile-login{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.mobile-register{
  background: #ffd84d;
  color: #0b1220;
  border: 1px solid rgba(255,216,77,0.3);
}

.mobile-logout{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-align: center;
  cursor: pointer;
  background: rgba(255,80,80,0.10);
  border: 1px solid rgba(255,80,80,0.22);
  color: rgba(255,255,255,0.90);
  transition: background 0.15s;
}

.mobile-logout:hover{
  background: rgba(255,80,80,0.18);
}

/* =========================
   TOUCH TARGETS
   ========================= */
button,
.btn,
.nav a,
.footer-links a,
.mobile-menu a,
.mobile-menu button,
.actions button{
  min-height: 44px;
  min-width: 44px;
}

/* =========================
   PAGE FOOTER
   ========================= */
.page-footer{
  margin-top: 48px;
  padding: 0 32px 32px;
}

.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
}

.footer-divider{
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  margin-bottom: 24px;
}

.footer-row{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.footer-copy{
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 14px;
}

.footer-links{
  display: contents;
}

.footer-links a{
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 14px;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.footer-links a:hover{
  color: #fff;
}

.footer-sep{
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}

/* =========================
   RESPONSIVE
   ========================= */

/* Mobile footer */
@media (max-width: 700px){
  .page-footer{ padding: 0 16px 28px; }
  .footer-row{ justify-content: flex-start; }
  .footer-copy{ padding-left: 0; }
}

/* Tablet portrait / Mobile */
@media (max-width: 720px){
  /* Show hamburger */
  .hamburger{
    display: block;
  }
  
  /* Hide desktop nav */
  .nav-left,
  .nav-right{
    display: none;
  }
  
  /* Adjust header */
  header{
    padding: 10px 0;
  }
  
  .nav{
    padding: 0 16px;
  }
  
  .nav-logo img{
    height: 28px;
  }
  
  /* Mobile overlay */
  .overlay{
    padding-top: 80px;
    padding-bottom: 24px;
  }
  
  /* Page footer */
  .page-footer{
    padding: 24px 16px;
    margin-top: 32px;
    gap: 12px;
  }
  
  .footer-links{
    gap: 12px 16px;
  }
  
  .footer-links a{
    font-size: 0.8rem;
  }
}

/* Large phone */
@media (max-width: 640px){
  .overlay{
    padding: 70px 16px 20px;
  }
  
  /* Larger touch-friendly inputs */
  input, textarea, select{
    font-size: 16px;
    padding: 16px;
  }
  
  .input,
  .search,
  select.input{
    padding: 16px;
  }
}

/* Small phone */
@media (max-width: 480px){
  
}

.footer-links{
  display: flex;
  gap: 16px;
}

.footer-links a{
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover{
  color: #fff;
}

/* =========================
   RESPONSIVE
   ========================= */

/* Tablet landscape */
@media (max-width: 980px){
  
}

/* Tablet portrait / Mobile */
@media (max-width: 720px){
  /* Show hamburger */
  .hamburger{
    display: block;
  }
  
  /* Hide desktop nav */
  .nav-left,
  .nav-right{
    display: none;
  }
  
  /* Adjust header */
  header{
    padding: 10px 0;
  }
  
  .nav{
    padding: 0 16px;
  }
  
  .nav-logo img{
    height: 28px;
  }
  
  /* Mobile overlay */
  .overlay{
    padding-top: 80px;
    padding-bottom: 40px;
  }
  
  /* Footer - keep on same line but allow wrap */
  .copyright{
    position: relative;
    bottom: auto;
    left: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    text-align: center;
    padding: 16px;
    margin-top: 24px;
    background: rgba(0,0,0,0.3);
    border-radius: 16px 16px 0 0;
  }
  
  .footer-links{
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
  }
  
  .footer-links a{
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* Large phone */
@media (max-width: 640px){
  .overlay{
    padding: 70px 16px 32px;
  }
  
  /* Larger touch-friendly inputs */
  input, textarea, select{
    font-size: 16px;
    padding: 16px;
  }
  
  .input,
  .search,
  select.input{
    padding: 16px;
  }
}

/* Small phone */
@media (max-width: 480px){
  .copyright{
    padding: 20px 12px;
  }

  .footer-links a{
    font-size: 0.8rem;
  }
}

/* =========================
   MOBILE UX IMPROVEMENTS
   All rules below are mobile-only (≤720px)
   Desktop is completely unaffected.
   ========================= */

/* ── Bottom nav: hidden on desktop ─────────────────────── */
.bottom-nav { display: none; }

@media (max-width: 720px) {
  /* ── Hamburger: bigger tap target + pill background ── */
  .hamburger {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
  }

  /* ── Bottom nav bar ─────────────────────────────────── */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    /* Safe-area inset for iPhone notch/home bar */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(13,15,19,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 19;
    align-items: center;
    justify-content: space-around;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: rgba(255,255,255,0.40);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    padding: 6px 14px;
    transition: color 0.15s ease;
    min-width: 56px;
    text-align: center;
    text-transform: uppercase;
  }

  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
  }

  .bottom-nav-item:hover {
    color: rgba(255,255,255,0.75);
  }

  .bottom-nav-item.active {
    color: #fff;
  }

  .bottom-nav-item.active svg {
    stroke: #ffd84d;
  }

  /* ── Page content: clear the bottom nav ────────────── */
  .overlay {
    padding-bottom: 80px;
  }

  /* ── Footer: hidden on mobile (bottom nav replaces) ── */
  .page-footer {
    display: none;
  }
}
