/* =========================
   wantedme - theme.css
   Global Light/Dark variables + base styles
   ========================= */

:root{
  --bg:#f5f5f5;
  --card:#ffffff;
  --text:#222222;
  --muted:#666666;
  --border:#e6e6e6;
  --shadow:0 10px 24px rgba(0,0,0,.06);

  --primary:#1976d2;
  --danger:#d32f2f;

  --input:#ffffff;
  --inputBorder:#dddddd;

  --tabBg:#f3f6fb;

  --radius:16px;
}

/* DARK THEME */
html[data-theme="dark"]{
  --bg:#0f141a;
  --card:#151c24;
  --text:#e8eef6;
  --muted:#a9b4c0;
  --border:#243142;
  --shadow:0 10px 24px rgba(0,0,0,.35);

  --primary:#4ea1ff;
  --danger:#ff5b5b;

  --input:#111821;
  --inputBorder:#2b3a4e;

  --tabBg:#101823;
}

/* Base */
*{
  box-sizing:border-box;
  font-family:Arial,Helvetica,sans-serif;
}

html, body{
  margin:0;
  padding:0;
}

body{
  background:var(--bg);
  color:var(--text);
}

a{
  color:inherit;
  text-decoration:none;
}

/* Helpful utilities */
.container{
  max-width:1100px;
  margin:18px auto;
  padding:0 16px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}

.muted{
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

.hr{
  border:0;
  border-top:1px solid rgba(127,127,127,.18);
  margin:12px 0;
}

/* Buttons */
.btn{
  border:1px solid var(--primary);
  background:var(--primary);
  color:#fff;
  padding:9px 14px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
}

.btn.secondary{
  background:transparent;
  color:var(--primary);
}

.btn.danger{
  border-color:var(--danger);
  background:var(--danger);
}

.btn.danger.secondary{
  background:transparent;
  color:var(--danger);
  border-color:var(--danger);
}

/* Inputs */
input, select, textarea{
  width:100%;
  padding:12px;
  border:1px solid var(--inputBorder);
  border-radius:10px;
  font-size:14px;
  background:var(--input);
  color:var(--text);
}

label{
  display:block;
  font-size:13px;
  color:var(--text);
  margin:10px 0 6px;
}

/* =========================
   SHARED HEADER
   Keep this for all pages
   ========================= */

header,
.site-header{
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(0,0,0,0.06);
  padding:14px 16px;
  position:sticky;
  top:0;
  z-index:50;
}

html[data-theme="dark"] header,
html[data-theme="dark"] .site-header{
  background:rgba(15,20,26,0.78);
  border-bottom:1px solid rgba(255,255,255,0.08);
}

.nav{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--card);
  border:1px solid rgba(127,127,127,.18);
  border-radius:999px;
  padding:10px 12px;
  box-shadow:0 10px 28px rgba(0,0,0,0.06);
}

html[data-theme="dark"] .nav{
  border-color:rgba(255,255,255,.10);
}

.brand{
  font-weight:800;
  color:var(--primary);
  font-size:22px;
}

.logo{
  font-weight:900;
  font-size:1.35rem;
  letter-spacing:.4px;
  display:inline-block;
  flex-shrink:0;
}

.logo span{
  color:var(--primary);
}

.shared-header-slot{
  display:flex;
  align-items:center;
  min-width:0;
}

.nav-right{
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
  min-width:0;
}

.lang-switch{
  font-size:.9rem;
  white-space:nowrap;
  flex-shrink:0;
}

.lang-switch a{
  color:var(--muted);
  opacity:.9;
}

.lang-switch a:hover{
  opacity:1;
}

.lang-switch .lang-active{
  font-weight:800;
  color:var(--text);
  opacity:1;
}

.nav-link{
  padding:10px 12px;
  border-radius:10px;
  color:var(--text);
  opacity:.95;
}

.nav-link:hover{
  opacity:1;
  background:rgba(127,127,127,.10);
}

.pill{
  border:1px solid rgba(25,118,210,.35);
  color:var(--primary);
  padding:10px 14px;
  border-radius:999px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

html[data-theme="dark"] .pill{
  border-color:rgba(78,161,255,.35);
}

.nav-btn{
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--primary);
  font-size:.92rem;
  cursor:pointer;
  background:var(--primary);
  color:#fff;
  transition:.2s;
  white-space:nowrap;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.nav-btn.outline{
  background:#fff;
  color:var(--primary);
}

html[data-theme="dark"] .nav-btn.outline{
  background:transparent;
  color:var(--primary);
}

.nav-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 2px 8px rgba(0,0,0,.14);
}

.nav-app{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.icon-btn{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(127,127,127,.18);
  background:var(--card);
  cursor:pointer;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.icon-btn:hover{
  background:rgba(127,127,127,.10);
}

.icon{
  width:20px;
  height:20px;
  fill:var(--text);
  opacity:.92;
}

html[data-theme="dark"] .icon{
  opacity:.95;
}

.badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:var(--primary);
  color:#fff;
  font-size:.72rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--card);
  line-height:1;
}

.divider{
  width:1px;
  height:26px;
  background:rgba(127,127,127,.25);
  margin:0 2px;
  flex-shrink:0;
}

html[data-theme="dark"] .divider{
  background:rgba(255,255,255,.14);
}

.avatar-btn{
  border:0;
  background:transparent;
  cursor:pointer;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.avatar{
  width:36px;
  height:36px;
  border-radius:50%;
  background:var(--primary);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:.9rem;
  line-height:1;
  box-shadow:0 0 0 1px rgba(0,0,0,0.06);
}

.user-menu-role{
  font-size:.85rem;
  color:var(--primary);
  font-weight:900;
  margin-top:6px;
}

.user-menu-panel{
  position:absolute;
  right:0;
  top:52px;
  width:320px;
  background:var(--card);
  border-radius:16px;
  box-shadow:0 18px 46px rgba(0,0,0,.18);
  border:1px solid rgba(127,127,127,.18);
  padding:10px 0;
  display:none;
  z-index:200;
  overflow:hidden;
}

.user-menu-header{
  padding:12px 16px 12px;
  border-bottom:1px solid rgba(127,127,127,.18);
}

.user-menu-name{
  font-weight:900;
  font-size:1.05rem;
  margin-bottom:3px;
}

.user-menu-email{
  font-size:.85rem;
  color:var(--muted);
}

.user-menu-item{
  width:100%;
  text-align:left;
  padding:12px 16px;
  background:var(--card);
  border:0;
  font-size:1rem;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--text);
}

.user-menu-item:hover{
  background:rgba(127,127,127,.10);
}

.user-menu-separator{
  border:0;
  border-top:1px solid rgba(127,127,127,.18);
  margin:8px 0;
}

.user-menu-item.signout{
  color:var(--danger);
  font-weight:900;
}

/* =========================
   MOBILE HEADER FIX
   This is the important part
   ========================= */

@media (max-width: 768px){
  header,
  .site-header{
    padding:10px 12px;
  }

  .nav{
    gap:8px;
    padding:8px 10px;
    overflow:visible;
  }

  .brand{
    font-size:20px;
    flex-shrink:0;
  }

  .logo{
    font-size:1.1rem;
    flex-shrink:0;
  }

  .shared-header-slot{
    min-width:0;
  }

  .nav-right{
    gap:6px;
    min-width:0;
    flex-shrink:1;
  }

  .nav-app{
    gap:6px;
    min-width:0;
  }

  .lang-switch{
    font-size:.8rem;
    flex-shrink:0;
  }

  .nav-btn{
    padding:7px 12px;
    font-size:.86rem;
  }

  .icon-btn{
    width:34px;
    height:34px;
    border-radius:10px;
    flex-shrink:0;
  }

  .icon{
    width:18px;
    height:18px;
  }

  .avatar-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }

  .avatar{
    width:34px;
    height:34px;
    font-size:.82rem;
    line-height:1;
  }

  .divider{
    display:none;
  }

  .badge{
    top:-5px;
    right:-5px;
    min-width:17px;
    height:17px;
    font-size:.68rem;
  }

  .user-menu-panel{
    right:0;
    top:46px;
    width:min(300px, calc(100vw - 24px));
  }
}


/* =========================
   SHARED FOOTER
========================= */

footer{
  border-top:1px solid var(--border);
  background:var(--card);
  font-size:.85rem;
  color:var(--muted);
  padding:28px 16px 18px;
  margin-top:40px;
}

.footer-inner{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  flex-wrap:wrap;
  gap:30px;
  justify-content:space-between;
}

.footer-col{
  flex:1;
  min-width:220px;
}

.footer-col h4{
  font-size:1rem;
  margin-bottom:10px;
  color:var(--text);
}

.footer-col p{
  font-size:.95rem;
  line-height:1.7;
  color:var(--muted);
  margin:0;
}

.footer-links{
  list-style:none;
  padding:0;
  margin:0;
}

.footer-links li{
  margin-bottom:8px;
}

.footer-links a{
  color:var(--muted);
  font-size:.95rem;
  text-decoration:none;
}

.footer-links a:hover{
  color:var(--primary);
}

.footer-bottom{
  max-width:1100px;
  margin:18px auto 0;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:10px;
  font-size:.82rem;
  color:var(--muted);
  width:100%;
}

@media (max-width:700px){
  footer{
    padding:24px 14px 18px;
  }

  .footer-inner{
    gap:22px;
  }

  .footer-col{
    min-width:100%;
  }

  .footer-bottom{
    flex-direction:column;
    align-items:flex-start;
  }
}