/* Basic reset */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; 
}

:root{
  --accent:#9da5ac;
  --bg:#ffffff;
  --text:#000000;
  --muted:#d7dadd;
}

/* layout */
.container{ max-width:1000px; margin:24px auto; padding:16px; background:var(--bg); }

/* header */
.header{ display:flex; justify-content:space-between; align-items:center; padding:12px 0; }
.brand{ display:flex; align-items:center; gap:10px; }
.logo{ width:46px; height:46px; border-radius:8px; background:var(--accent); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; }
.nav a{ margin-left:12px; color:var(--text); text-decoration:none; font-weight:600; }

/* hero */
.hero{ 
  background:linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02)); 
  border-radius:12px; 
  padding:28px; 
  display:flex; 
  gap:20px; 
  align-items:center; 
}
.hero h1{ font-size:22px; color:var(--accent); margin-bottom:6px; }
.hero p{ color:var(--text); line-height:1.5; }

/* buttons */
.btn{ 
  display:inline-block; 
  padding:10px 16px; 
  border-radius:8px; 
  text-decoration:none; 
  border:none; 
  cursor:pointer; 
  font-weight:700; 
}
.btn-primary{ background:var(--accent); color:#fff; }
.btn-outline{ background:#fff; color:var(--accent); border:1.5px solid var(--accent); }
.btn-outline:hover{ background:var(--accent); color:#fff; transition:0.2s ease-in-out; }

/* cards grid */
.grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap:12px; margin-top:16px; }
.card{ 
  border-radius:10px; 
  padding:12px; 
  background:#fff; 
  box-shadow: 0 4px 14px rgba(0,0,0,0.05); 
  cursor:pointer; 
  display:flex; 
  flex-direction:column; 
  gap:8px; 
  align-items:start; 
  transition:transform .14s ease; 
  border:1px solid var(--muted);
}
.card:hover{ transform:translateY(-6px); }
.card .icon{ 
  width:56px; 
  height:56px; 
  border-radius:8px; 
  background:rgba(157,165,172,0.1); 
  display:flex; 
  align-items:center; 
  justify-content:center; 
  font-weight:700; 
  color:var(--accent); 
}

/* chat */
.chat-header{ display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid var(--muted); background:var(--bg); }
.chat-body{ height:60vh; overflow:auto; padding:12px; display:flex; flex-direction:column; gap:10px; background:#f9f9f9; }
.msg{ max-width:78%; padding:10px 12px; border-radius:10px; }
.msg.user{ margin-left:auto; background:var(--accent); color:white; }
.msg.bot{ margin-right:auto; background:#e9ebed; color:var(--text); }

/* input */
.chat-input{ display:flex; gap:8px; padding:12px; border-top:1px solid var(--muted); background:var(--bg); }
.chat-input textarea{ flex:1; min-height:44px; resize:vertical; padding:8px; border-radius:8px; border:1px solid var(--muted); }

/* mobile */
@media (max-width:600px){
  .hero{ flex-direction:column; align-items:flex-start; }
  .chat-body{ height:50vh; }
}

/* selected state style */
.card.selected {
  border: 2px solid var(--accent);
  box-shadow: 0 8px 20px rgba(157,165,172,0.2);
  transform: translateY(-6px);
  background: linear-gradient(180deg, rgba(157,165,172,0.08), #fff);
}
.state-card { 
  text-align:left; 
  display:flex; 
  flex-direction:column; 
  align-items:flex-start; 
  padding:12px; 
  border:none; 
}
.state-card:focus { outline: 3px solid rgba(157,165,172,0.25); outline-offset:3px; }

/* optional muted text tweaks */
h1,h2,h3,h4,p,span,div{ color:var(--text); }


/* ===========================
   Login page: Glassy / Modern
   Paste at the END of styles.css
   =========================== */

/* Stronger page-level subtle background to show through the frosted card */
body {
  background: linear-gradient(180deg, #f6f8fb 0%, #ffffff 100%);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Center container vertically on taller screens while keeping responsiveness */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;       /* centers vertically */
  min-height: calc(100vh - 48px);
  padding: 28px;
  background: transparent;        /* keep original bg behavior */
}

/* Frosted glass card override for the login box */
.container .card {
  width: 100%;
  max-width: 520px;
  padding: 28px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.28));
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: transform .16s ease, box-shadow .16s ease;
}

/* Subtle lift on hover/focus to hint interactivity */
.container .card:hover { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(15,23,42,0.10); }

/* Heading */
.container h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #1f2937;
  letter-spacing: -0.01em;
}

/* Inputs: modern, accessible */
.container input[type="email"],
.container input[type="password"],
.container textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(125,130,137,0.16);
  background: rgba(255,255,255,0.9);
  color: #111827;
  font-size: 15px;
  outline: none;
  transition: box-shadow .14s ease, border-color .14s ease, transform .12s ease;
  box-shadow: 0 4px 10px rgba(18,24,30,0.03) inset;
}

/* Placeholder color */
.container input::placeholder { color: rgba(30,41,59,0.4); }

/* Input focus state (keeps accessibility intact) */
.container input:focus,
.container textarea:focus {
  border-color: rgba(0,133,204,0.9);
  box-shadow: 0 6px 22px rgba(0,133,204,0.08);
  transform: translateY(-1px);
}

/* Buttons: boosted glassy appearance but same classes as before */
.btn.btn-primary {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #0085cc 0%, #0073b3 100%);
  color: #fff;
  border: none;
  box-shadow: 0 10px 26px rgba(1, 92, 150, 0.18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn.btn-primary:active { transform: translateY(1px); }

/* Google button: keep btn-outline class but enhance visuals */
.btn.btn-outline {
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.72));
  border: 1px solid rgba(157,165,172,0.18);
  color: #2c3e50;
  box-shadow: 0 6px 18px rgba(25,40,56,0.06);
}
.btn.btn-outline:hover {
  background: linear-gradient(180deg, rgba(0,133,204,0.08), rgba(0,133,204,0.03));
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,115,179,0.12);
}

/* Status message styling */
#status {
  margin-top: 10px;
  color: rgba(31,41,55,0.9);
  font-size: 14px;
  min-height: 18px;
  line-height: 18px;
}

/* Signup link: subtle underline on hover */
.card p a {
  color: #0b5fcc;
  text-decoration: none;
  font-weight: 600;
}
.card p a:hover { text-decoration: underline; color: #004e8a; }

/* Small-screen tweaks */
@media (max-width: 600px) {
  .container { padding: 18px; min-height: auto; }
  .container .card { padding: 18px; border-radius: 12px; }
  .btn { width: 100%; display: block; }
  #googleSignInBtn { margin-top: 8px; }
}

/* ============================
   Country page: Visual polish
   (Append this block at the END of styles.css)
   ============================ */

/* Make the country grid centered and slightly larger cards */
.grid {
  justify-items: center;         /* center cards within each grid cell */
  align-items: start;
  gap: 16px;
  margin-top: 18px;
}

/* Bigger, glassy country cards for easier selection */
.card {
  width: 100%;
  max-width: 340px;             /* control card width */
  padding: 18px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(250,250,251,0.80));
  border: 1px solid rgba(157,165,172,0.12);
  box-shadow: 0 12px 30px rgba(20,30,40,0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.12s ease;
}

/* Slight lift for hover */
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 44px rgba(20,30,40,0.10);
  border-color: rgba(157,165,172,0.22);
}

/* Icon style: circular badge with stronger accent color */
.card .icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(157,165,172,0.08), rgba(157,165,172,0.02));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--accent);
  font-size: 20px;
}

/* country title (bolder) */
.card > div[style*="font-weight:700"] {
  font-size: 16px;
  letter-spacing: -0.01em;
  color: #111827;
}

/* helper text smaller and more muted */
.card div[style*="font-size:13px"] {
  font-size: 13px;
  color: rgba(30,41,59,0.5);
}

/* selected state (keep existing .selected behavior but visual tweak) */
.card.selected {
  border: 2px solid rgba(0,133,204,0.95);
  box-shadow: 0 20px 50px rgba(0,115,179,0.12);
  background: linear-gradient(180deg, rgba(0,133,204,0.03), rgba(255,255,255,0.96));
  transform: translateY(-8px);
}

/* Make header area slightly more compact for the country selection flow */
.header {
  padding: 10px 0;
}

/* smaller nav links for this flow */
.nav a {
  margin-left: 10px;
  font-size: 14px;
}

/* Responsive - stack nicely on small screens */
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .card { max-width: 100%; padding: 14px; border-radius: 12px; }
  .card .icon { width: 56px; height: 56px; font-size: 18px; }
}

/* ================
   Username panel
   (append to end of styles.css)
   ================ */

   .user-panel { display: flex; align-items: center; gap: 10px; }

   .user-name {
     font-weight: 700;
     font-size: 15px;
     color: #0b5fcc;   /* blue link color matching theme */
     text-decoration: none;
     padding: 6px 8px;
     border-radius: 8px;
     transition: background .12s ease, transform .12s ease;
   }
   
   .user-name:hover {
     background: rgba(11,95,204,0.08);
     transform: translateY(-2px);
   }
   
   #logoutBtn {
     border-radius: 8px;
     font-weight: 600;
     cursor: pointer;
   }
   
   /* unify header spacing across country, state, chat pages */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-top: 12px;
}

/* brand layout fix */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ======= Top panel tidy overrides (append at end of styles.css) ======= */

/* Ensure header is a single-row layout */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* brand left, nav right */
  gap: 16px;
  padding: 12px 0;
}

/* Nav container: keep items in a single row */
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}

/* Center area (primary link group). Keep small and subtle */
.nav-center {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 16px; /* spacing from brand */
}

/* Right-side user panel should stick to the far right */
.nav-right {
  margin-left: auto; /* push to rightmost */
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Make nav links consistent and compact */
.nav a, .nav .nav-link, .nav .sign-in {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
}

/* Smaller visual weight for Resources link so it doesn't overpower */
.nav .nav-link {
  color: rgba(0,0,0,0.72);
  font-weight: 600;
  font-size: 14px;
}

/* Sign-in link lighter */
.sign-in {
  color: rgba(0,0,0,0.78);
}

/* Keep Get Started / Logout as small pills consistent with nav */
.nav .btn {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 8px;
}

/* Prevent the brand from wrapping and keep it small */
.brand { white-space: nowrap; }

/* If the user name is long, clamp it with ellipsis */
.user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* Mobile: collapse center links into the right group (keep layout single column) */
@media (max-width: 720px) {
  .nav-center { display: none; } /* hide Resources on narrow screens (can reintroduce in a drawer) */
  .nav { gap: 8px; }
  .header { padding: 10px 0; }
}
/* =========================
   Glass top-nav (full-width, fixed)
   Append this to end of styles.css
   ========================= */

/* Glass nav container (fixed to top) */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.36), rgba(255,255,255,0.18));
  border-bottom: 1px solid rgba(255,255,255,0.35);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 6px 24px rgba(10,20,30,0.06);
}

/* nav inner container to align brand and nav items */
.glass-nav .container--nav {
  max-width: 1200px;   /* wider than page container so nav stretches */
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

/* Keep the existing brand and nav styles but compact for the glass bar */
.glass-nav .brand { display: flex; gap: 12px; align-items: center; }
.glass-nav .logo { width:44px; height:44px; border-radius:10px; }

/* Make nav links slightly smaller on the top bar */
.glass-nav .nav-link { font-size: 14px; color: rgba(0,0,0,0.7); }
.glass-nav .sign-in { font-size: 14px; color: rgba(0,0,0,0.8); }

/* Ensure the main page content sits below the fixed header */
.page-content {
  padding-top: 96px; /* enough space for the fixed header (adjust if you change header height) */
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Section specific spacing (overrides inline styles) */
.page-section { margin-top: 0; }

/* Heading now top-left below the panel */
.page-section h2 {
  font-size: 22px;
  margin: 0 0 18px 0;
  color: #111827;
  text-align: left;
}

/* Grid: start top-left and use wider layout for more countries later */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr)); /* 3 columns on wide screens */
  gap: 20px;
  justify-items: start;      /* align cards to the left of each cell */
  align-items: start;
  margin-top: 6px;
}

/* Card sizing adjustments to make them roomy */
.card {
  max-width: 360px;
  width: 100%;
  padding: 20px;
  border-radius: 14px;
}

/* Make icons a bit smaller to fit the new card */
.card .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 18px;
}

/* When only a couple of countries exist keep the grid aligned left
   (the container's max-width leaves plenty of space to the right) */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .page-content { padding-top: 90px; padding-left: 14px; padding-right: 14px; }
  .glass-nav .container--nav { padding-left: 14px; padding-right: 14px; }
}

/* If you add more countries, increase columns by changing grid-template-columns above */
