/* =========================================================
   InstMates - Global Styles
   FOUNDATION – DO NOT BREAK
   File: assets/css/style.css
========================================================= */

/* ================= BASE ================= */
*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:#f5f7fa;
  color:#1a1a1a;
}

a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}

img{
  max-width:100%;
  height:auto;
  display:block;
}

.container{
  max-width:1200px;
  margin:0 auto;
  padding:18px 16px;
}

.muted{opacity:.85}

/* ================= HEADER (FINAL – LOCKED) ================= */

.site-header{
  position:sticky;
  top:0;
  z-index:9999;
  background:#0b3c5d;
  box-shadow:0 2px 12px rgba(0,0,0,0.18);
}

.site-header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

/* LOGO */
.logo{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.logo-svg{
  height:42px;
  width:auto;
  display:block;
}

/* NAVIGATION */
.main-nav{
  display:flex;
  gap:20px;
  align-items:center;
  flex-wrap:wrap;
}

.main-nav a{
  color:#ffffff;
  font-weight:700;
  padding:6px 4px;
  opacity:0.9;
}

.main-nav a:hover{
  opacity:1;
  text-decoration:underline;
}

/* CTA BUTTON */
.nav-cta{
  padding:6px 14px;
  border:1px solid rgba(255,255,255,0.6);
  border-radius:8px;
  font-weight:800;
}

.nav-cta:hover{
  border-color:#ffffff;
}

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

.btn{
  padding:8px 14px;
  border-radius:8px;
  font-weight:800;
  display:inline-block;
  white-space:nowrap;
}

.btn-primary{
  background:#f39c12;
  color:#000;
}

.btn-primary:hover{opacity:0.92}

.btn-ghost{
  border:1px solid rgba(255,255,255,0.45);
  color:#fff;
}

.btn-ghost:hover{
  border-color:rgba(255,255,255,0.75);
}

.btn.full{width:100%}

/* ================= BREADCRUMBS ================= */

.crumbs{
  max-width:1200px;
  margin:10px auto 0;
  padding:0 16px;
  font-size:0.92rem;
  opacity:0.85;
}

.crumbs a{
  color:#0b3c5d;
  font-weight:700;
}

.crumbs a:hover{text-decoration:underline}

.crumbs span{margin:0 6px}

/* ================= HOME HERO ================= */

.hero{
  background:
    linear-gradient(rgba(11,60,93,0.92), rgba(11,60,93,0.72));
  color:#fff;
  border-radius:16px;
  padding:28px 18px;
  margin-top:14px;
}

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

.hero h1{
  margin:0 0 8px;
  font-size:2.2rem;
}

.hero-tagline{
  font-size:1.2rem;
  font-weight:700;
  margin-bottom:6px;
}

.hero-sub{
  font-size:1rem;
  max-width:720px;
}

.hero-actions{
  margin-top:18px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* ================= PANELS & GRIDS ================= */

.panel{
  background:#fff;
  border-radius:12px;
  padding:22px;
  margin-top:18px;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.grid{
  display:grid;
  gap:18px;
}

.grid-2{
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
}

.grid-3{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}

.card{
  background:#fff;
  border-radius:12px;
  padding:18px;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}

.card h3{
  margin-top:0;
}

/* ================= CHECKLIST ================= */

.checklist{
  list-style:none;
  padding:0;
  margin:0;
}

.checklist li{
  padding-left:24px;
  margin-bottom:10px;
  position:relative;
}

.checklist li::before{
  content:"✔";
  position:absolute;
  left:0;
  color:#2ecc71;
  font-weight:900;
}

/* ================= AUTH PAGES ================= */

.auth-container{
  max-width:520px;
  margin:40px auto;
}

.auth-panel{
  background:#fff;
  padding:26px;
  border-radius:12px;
  box-shadow:0 4px 16px rgba(0,0,0,.12);
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:16px;
}

.auth-form label{
  font-weight:700;
  font-size:.95rem;
}

.auth-form input,
.auth-form select{
  width:100%;
  padding:10px;
  margin-top:4px;
  border:1px solid #ccc;
  border-radius:6px;
  font-size:1rem;
}

.auth-footer{
  margin-top:16px;
  font-size:.95rem;
}

/* ================= FOOTER ================= */

.site-footer{
  margin-top:40px;
  padding:18px;
  text-align:center;
  font-size:0.9rem;
  opacity:0.75;
}

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

@media (max-width:720px){
  .hero h1{font-size:1.8rem}
  .main-nav{justify-content:center}
}
/* ================= MOBILE HEADER OPTIMIZATION ================= */

@media (max-width: 768px){

  .site-header-inner{
    padding:10px 12px;
  }

  /* Logo scaling */
  .logo-svg{
    height:34px;      /* desktop = 42px */
  }

  /* Navigation tighter */
  .main-nav{
    gap:14px;
  }

  .main-nav a{
    font-size:0.95rem;
    padding:4px 2px;
  }

  .nav-cta{
    padding:4px 10px;
    font-size:0.9rem;
  }
}

/* Extra-small devices */
@media (max-width: 480px){

  .logo-svg{
    height:30px;
  }

  .main-nav{
    gap:10px;
  }
}
/* ================= PROFILE IMAGE FIX ================= */

.profile-photo{
  width:180px;
  height:180px;
  flex-shrink:0;
}

.profile-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:14px;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
  background:#fff;
}
@media (max-width: 600px){
  .profile-photo{
    width:140px;
    height:140px;
  }
}
/* ================= DIRECTORY & ENDORSEMENTS ================= */

.card img{
  width:100%;
  height:160px;
  object-fit:cover;
  border-radius:10px;
  margin-bottom:8px;
}
/* ================= COMMUNITY Q&A ================= */

.question-list{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.question-item{
  padding-bottom:14px;
  border-bottom:1px solid #e0e0e0;
}

.question-item h3{
  margin:0;
}

.answer{
  padding:14px;
  background:#f8fafc;
  border-radius:8px;
  margin-bottom:12px;
}
article h1{
  margin-top:0;
}

article h2{
  margin-top:18px;
  color:#0b3c5d;
}
/* ================= CASE STUDIES ================= */

.case-list{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.case-item{
  border-bottom:1px solid #e0e0e0;
  padding-bottom:12px;
}

article h2{
  margin-top:18px;
}
/* ================= REPUTATION SYSTEM ================= */

.reputation-panel .card{
  text-align:center;
}

.reputation-score{
  font-size:2.2rem;
  font-weight:900;
  color:#0b3c5d;
}

.reputation-metric{
  font-size:1.8rem;
  font-weight:800;
}

.badge-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.badge{
  padding:6px 14px;
  border-radius:20px;
  font-size:0.85rem;
  font-weight:800;
}

.badge.gold{
  background:#f1c40f;
  color:#000;
}

.badge.silver{
  background:#bdc3c7;
  color:#000;
}

.badge.bronze{
  background:#cd7f32;
  color:#fff;
}
/* ================= AUTH PAGES ================= */

.auth-container{
  max-width:520px;
  margin:40px auto;
}

.auth-panel{
  background:#fff;
  padding:26px;
  border-radius:12px;
  box-shadow:0 4px 16px rgba(0,0,0,.12);
}

.auth-panel h2{
  margin-top:0;
  margin-bottom:6px;
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:16px;
}

.auth-form label{
  font-weight:700;
  font-size:.95rem;
}

.auth-form input,
.auth-form select{
  width:100%;
  padding:10px;
  margin-top:4px;
  border:1px solid #ccc;
  border-radius:6px;
  font-size:1rem;
}

.auth-form input:focus,
.auth-form select:focus{
  outline:none;
  border-color:#0b3c5d;
  box-shadow:0 0 0 2px rgba(11,60,93,.15);
}

/* Full-width button support */
.btn.full{
  width:100%;
  text-align:center;
}

.auth-footer{
  margin-top:16px;
  font-size:.95rem;
}

.auth-footer a{
  font-weight:700;
  color:#0b3c5d;
  text-decoration:none;
}

.auth-footer a:hover{
  text-decoration:underline;
}

/* Mobile spacing */
@media (max-width:600px){
  .auth-container{
    margin:24px 12px;
  }
}
/* =====================================
   Soft Secondary Button (Safe Addition)
===================================== */

.btn-soft {
  background: #eef6fb;
  color: #0b3c5d;
  border: 1px solid #0b3c5d;
}

.btn-soft:hover {
  background: #0b3c5d;
  color: #ffffff;
}
/* =========================================================
   InstMates Brand Colors & Hover Animations (SAFE ADDITION)
   Do NOT modify existing styles above
========================================================= */

:root{
  --brand-primary: #0b3c5d;
  --brand-accent:  #1f78b4;
  --brand-soft:    #eef6fb;
  --brand-border:  #cbd5e1;
  --brand-success: #15803d;
  --brand-warning: #92400e;
}

/* =========================
   BUTTON TUNING
========================= */

/* Primary (keep strong, improve hover) */
.btn-primary{
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  transition: background .25s ease,
              transform .15s ease,
              box-shadow .15s ease;
}

.btn-primary:hover{
  background: var(--brand-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11,60,93,.25);
}

/* Soft button (new – for Explore / Learn) */
.btn-soft{
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  transition: background .25s ease,
              color .25s ease,
              transform .15s ease,
              box-shadow .15s ease;
}

.btn-soft:hover{
  background: var(--brand-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(11,60,93,.2);
}

/* Ghost button (subtle improvement, stays clean) */
.btn-ghost{
  transition: color .2s ease,
              border-color .2s ease,
              background .2s ease;
}

.btn-ghost:hover{
  background: rgba(11,60,93,.05);
  border-color: var(--brand-primary);
}

/* =========================
   CARD HOVER (SUBTLE)
========================= */

.card{
  transition: transform .18s ease,
              box-shadow .18s ease,
              border-color .18s ease;
}

.card:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  border-color: var(--brand-primary);
}

/* =========================
   LINK POLISH
========================= */

a{
  transition: color .2s ease;
}

a:hover{
  color: var(--brand-accent);
}

/* =========================
   HERO BUTTON SPACING (MOBILE SAFE)
========================= */

.hero-actions .btn{
  margin: 6px 8px;
}
/* =========================================================
   Home Hero – Primary Action Buttons (Orange)
   Only used for Join & Explore on index page
========================================================= */

.btn-hero{
  background: #f59e0b;           /* orange */
  color: #1f2937;                /* dark text */
  border: 1px solid #92400e;
  font-weight: 700;
  transition: background .25s ease,
              transform .15s ease,
              box-shadow .15s ease;
}

.btn-hero:hover{
  background: #d97706;           /* darker orange */
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(146,64,14,.35);
}
/* =========================================================
   Footer link cleanup (remove bullets, style links)
========================================================= */

.site-footer ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li{
  margin: 6px 0;
}

.site-footer a{
  color: #1f78b4;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover{
  text-decoration: underline;
}
/* =========================================================
   Footer Styled Same as Header (Solid Industrial Blue)
========================================================= */

/* Footer background like header */
.site-footer{
  background: #0b3c5d;          /* same as header */
  color: #ffffff;
  border-top: none;
}

/* Footer headings */
.site-footer h4{
  color: #ffffff;
}

/* Footer paragraph text */
.site-footer p{
  color: #dbe7f3;
}

/* Footer links */
.site-footer a{
  color: #e6f0fa;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover{
  color: #ffffff;
  text-decoration: underline;
}

/* Footer separators */
.site-footer hr{
  border: none;
  border-top: 1px solid rgba(255,255,255,.25);
}

/* Footer list cleanup (in case not already present) */
.site-footer ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li{
  margin: 6px 0;
}
/* =========================================================
   Compact Footer Layout (Header-like, Minimal)
========================================================= */

.site-footer{
  background: #0b3c5d;
  color: #ffffff;
}

.footer-compact{
  padding: 16px 0 12px;
}

.footer-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand{
  max-width: 520px;
}

.footer-brand p{
  margin: 6px 0 0;
  font-size: .9rem;
  line-height: 1.4;
  color: #dbe7f3;
}

.footer-legal{
  white-space: nowrap;
}

.footer-legal a{
  color: #e6f0fa;
  font-weight: 600;
  text-decoration: none;
}

.footer-legal a:hover{
  text-decoration: underline;
}

.footer-legal .sep{
  margin: 0 8px;
  opacity: .5;
}

.footer-copy{
  margin-top: 8px;
  text-align: center;
  font-size: .85rem;
  color: #dbe7f3;
}

/* Mobile safety */
@media (max-width: 768px){
  .footer-row{
    flex-direction: column;
    text-align: center;
  }

  .footer-legal{
    margin-top: 6px;
  }
}
/* =========================================================
   Highlight Section: Built on Real Field Experience
   (Remove flat white, add metallic depth)
========================================================= */

/* Section background */
.panel{
  background: #dde7f1;
}

/* Cards inside highlight sections */
.panel .card{
  background: #eef4fa;
  border: 1px solid #c1d1e2;
  box-shadow: 0 6px 16px rgba(11,60,93,.12);
}

/* Strong metric numbers (100%, 0%, 24x7) */
.panel .card h3{
  color: #0b3c5d;
  font-weight: 800;
}

/* Slight hover feedback (professional, not flashy) */
.panel .card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(11,60,93,.22);
}
/* =========================================================
   Global Primary Button = Amber (FINAL)
   Replaces old blue primary everywhere
========================================================= */

/* Primary buttons now amber */
.btn-primary{
  background: #f59e0b;          /* amber */
  color: #1f2937;
  border: 1px solid #92400e;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(146,64,14,.35);
  transition:
    background .25s ease,
    box-shadow .2s ease,
    transform .15s ease;
}

.btn-primary:hover{
  background: #d97706;          /* darker amber */
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(146,64,14,.45);
  transform: translateY(-1px);
}

.btn-primary:active{
  box-shadow: 0 2px 4px rgba(146,64,14,.4);
  transform: translateY(0);
}
/* =========================================================
   FINAL FOOTER (STRUCTURED, HEADER-COMPATIBLE)
========================================================= */

.footer-structured{
  background: #4b6f88;   /* same family as header */
  color: #ffffff;
}

/* Main content row */
.footer-main{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 16px 12px;
}

/* Brand block */
.footer-brand{
  max-width: 520px;
}

.footer-logo{
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .4px;
}

.footer-desc{
  font-size: .85rem;
  color: #e3edf6;
  margin-top: 4px;
}

/* Legal links */
.footer-legal a{
  color: #eaf2f8;
  text-decoration: none;
  font-weight: 600;
}

.footer-legal a:hover{
  text-decoration: underline;
}

.footer-legal .sep{
  margin: 0 8px;
  opacity: .6;
}

/* Bottom copyright row */
.footer-bottom{
  text-align: center;
  font-size: .78rem;
  color: #d7e3ed;
  padding: 6px 0 10px;
  border-top: 1px solid rgba(255,255,255,.25);
}

/* Mobile */
@media (max-width: 768px){
  .footer-main{
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}
/* =========================================================
   Global Font Upgrade (InstMates)
========================================================= */

html, body{
  font-family: 'Inter', system-ui, -apple-system,
               BlinkMacSystemFont, 'Segoe UI',
               Roboto, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
}

/* Headings – slightly stronger */
h1, h2, h3, h4{
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Buttons – crisp & readable */
.btn{
  font-family: 'Inter', inherit;
  font-weight: 600;
  letter-spacing: .01em;
}

/* Footer & small text */
.footer-desc,
.footer-copy,
.muted{
  font-weight: 500;
}
/* =========================================================
   Footer Layout Fix – Do NOT Float with Content
========================================================= */

/* Ensure footer is a full-width block */
.site-footer{
  display: block;
  width: 100%;
  clear: both;          /* CRITICAL */
  position: relative;
  margin-top: 40px;    /* visual separation from content */
}

/* Safety: clear floats before footer */
main::after{
  content: "";
  display: block;
  clear: both;
}
/* ================= SOCIAL HOMEPAGE ================= */

.social-hero{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap:32px;
  padding:48px 0;
  align-items:center;
}

.hero-sub{
  font-size:1.3rem;
  margin:6px 0;
}

.hero-tag{
  opacity:.9;
  margin:10px 0 18px;
}

.hero-actions{
  display:flex;
  gap:12px;
}

.avatar-grid{
  display:grid;
  grid-template-columns: repeat(3, 56px);
  gap:12px;
}

.avatar{
  width:56px;
  height:56px;
  border-radius:50%;
  background:#d0d7de;
}

.avatar.small{
  width:40px;
  height:40px;
}

.feed{
  display:grid;
  gap:16px;
  margin-top:14px;
}

.post-card{
  background:#fff;
  padding:16px;
  border-radius:10px;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.post-header{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:8px;
}

.post-actions{
  margin-top:10px;
  font-size:.9rem;
  opacity:.85;
}

.stats{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:16px;
  text-align:center;
  margin:36px 0;
}

.stat{
  background:#fff;
  padding:18px;
  border-radius:10px;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.groups-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  margin-top:14px;
}

.group-card{
  background:#fff;
  padding:16px;
  border-radius:10px;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
  font-weight:600;
}
/* ================= JOIN MODAL ================= */

.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.55);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.modal-overlay.active{
  display:flex;
}

.modal{
  background:#fff;
  max-width:420px;
  width:90%;
  padding:26px;
  border-radius:14px;
  position:relative;
  box-shadow:0 20px 50px rgba(0,0,0,.3);
}

.modal h2{
  margin-top:0;
}

.modal-close{
  position:absolute;
  top:12px;
  right:14px;
  background:none;
  border:none;
  font-size:1.6rem;
  cursor:pointer;
}

.modal-actions{
  display:flex;
  gap:12px;
  margin-top:18px;
  flex-wrap:wrap;
}
/* Clickable feed cards */
.post-link{
  text-decoration:none;
  color:inherit;
  display:block;
}
.post-link:hover .post-card{
  transform:translateY(-2px);
  transition:.15s ease;
}
/* ================= PROFILE PAGE ================= */

.profile-hero{
  margin-top:20px;
}

.profile-header{
  display:flex;
  gap:24px;
  align-items:flex-start;
}

.profile-avatar{
  width:120px;
  height:120px;
  border-radius:50%;
  background:#d0d7de;
  flex-shrink:0;
}

.profile-info h1{
  margin:0;
}

.profile-role{
  font-weight:600;
  margin:6px 0;
}

.profile-actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.skills-grid{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.skill{
  background:#eef6fb;
  border:1px solid #c7e0f4;
  padding:6px 12px;
  border-radius:999px;
  font-size:.85rem;
  font-weight:600;
}
.panel h2, .panel h3 {
  letter-spacing: 0.2px;
}

.svg-wrap {
  margin-top: 12px;
  margin-bottom: 8px;
}
/* ================= AUTH VISIBILITY ================= */

.auth-in { display: none; }
.auth-out { display: inline-flex; gap: 10px; }

body.logged-in .auth-in { display: inline-flex; gap: 10px; }
body.logged-in .auth-out { display: none; }
/* =========================
   AUTH UI – NO FLICKER
========================= */

/* Hide everything by default */
.auth-in,
.auth-out {
  display: none !important;
}

/* Show logged-out UI only after auth resolved */
body.auth-ready:not(.logged-in) .auth-out {
  display: inline-flex !important;
  gap: 10px;
}

/* Show logged-in UI only after auth resolved */
body.auth-ready.logged-in .auth-in {
  display: inline-flex !important;
  gap: 10px;
}
