/* --- 1. VARIABLES & RESET --- */
:root {
  /* Premium Palette */
  --navy-900: #0B1320;
  --navy-800: #162438;
  --navy-50: #F0F4F8;
  
  --gold-500: #C5A880;
  --gold-600: #A38660;
  
  --text-main: #1A202C;
  --text-muted: #5F6C7B;
  
  --bg-body: #FAFAF9;
  --surface-white: #FFFFFF;
  
  --danger: #E53E3E;
  --success: #2F855A;
  
  --radius-lg: 16px;
  --radius-sm: 8px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- 2. NAVIGATION (Glassmorphism) --- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--navy-900);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--navy-900);
}

/* --- 3. HERO SECTION --- */
.hero {
  text-align: center;
  padding: 80px 20px 40px;
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 5vw, 56px);
  color: var(--navy-900);
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

h3{
  font-family: 'Inter', sans-serif;
  font-size: clamp(18px, 4vw, 18px);
  color: var(--navy-800);
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.hero p {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 32px;
}

/* --- 4. SEARCH BAR --- */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 60px auto;
}

.search-input {
  width: 100%;
  padding: 16px 24px;
  border-radius: 50px;
  border: 1px solid #E2E8F0;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--gold-500);
  transform: scale(1.02);
}

/* --- 5. GRID & CARDS --- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-500);
}

/* Status Badges */
.badge {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.badge.open { background: #DEF7EC; color: var(--success); }
.badge.sold { background: #FEEBC8; color: #744210; }

.school-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.info-row svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.dates {
  font-size: 13px;
  color: #8899A6;
  margin-top: 4px;
  line-height: 1.5;
}

/* --- 6. BUTTONS --- */
.card-footer {
  margin-top: auto;
  padding-top: 20px;
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--navy-900);
  color: white;
}

.btn-primary:hover {
  background: var(--navy-800);
  transform: translateY(-1px);
}

.btn-disabled {
  background: #EDF2F7;
  color: #A0AEC0;
  cursor: not-allowed;
}

/* --- 7. FOOTER --- */
footer {
  text-align: center;
  padding: 40px;
  background: var(--surface-white);
  border-top: 1px solid #E2E8F0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
  nav { padding: 16px 20px; }
  h1 { font-size: 32px; }
  .nav-links { display: none; } /* In real app, add hamburger menu */
}

/* Animation for Search Filtering */
.hidden { display: none; }

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- MOBILE MENU STYLES --- */

/* By default, hide the hamburger on desktop */
.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--navy-900);
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
  nav {
    padding: 16px 24px;
  }

  .hamburger {
    display: block; /* Show the button on mobile */
  }

  /* Hide the links by default on mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; /* Push it right below the navbar */
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98); /* Solid background */
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-lg);
    gap: 20px;
  }

  /* This class is added by JS to show the menu */
  .nav-links.active-mobile {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }
  
  h1 { font-size: 32px; }
}

/* Optional: Slide Down Animation */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast notification styles */
.toast {
  position: absolute;
  bottom: 50px; /* Adjusted to appear above the email address */
  left: 50%;
  transform: translateX(-50%);
  background-color: #162438;
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: .7;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 1000;
}

.toast.fade {
  opacity: 0;
  /* transform: translateY(20px); */
}