/**
 * SchoolsNearMe Design System
 * Clean, modern teal theme
 */

:root {
    /* Teal Brand Colors */
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-200: #99f6e4;
    --teal-300: #5eead4;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-800: #115e59;
    --teal-900: #134e4a;
    
    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Accent Colors */
    --gold-400: #fbbf24;
    --gold-500: #f59e0b;
    --pink-500: #ec4899;
    
    /* Semantic Colors */
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    
    /* Brand Colors */
    --primary: var(--teal-600);
    --primary-dark: var(--teal-700);
    --primary-light: var(--teal-100);
    
    /* Gradients */
    --gradient-brand: linear-gradient(135deg, var(--teal-600), var(--teal-500));
    --gradient-hero: linear-gradient(180deg, var(--teal-900) 0%, var(--teal-800) 100%);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
}

/* ============================================
   STANDARD HEADER
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    z-index: 1000;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--gray-800);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--gray-800);
    background: var(--gray-100);
}

.nav-link.active {
    color: var(--teal-600);
    background: var(--teal-50);
    font-weight: 600;
}

.nav-link.pro-link {
    color: var(--gold-500);
}

.header-signin-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: var(--gradient-brand);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
}

.header-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* Header User Avatar & Dropdown */
.header-user {
    position: relative;
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.header-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-user-avatar > span {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.pro-badge-mini {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--orange-500, #f97316);
    color: white;
    font-size: 0.5rem;
    padding: 1px 3px;
    border-radius: 4px;
    font-weight: 700;
}

.header-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px -5px rgb(0 0 0 / 0.15);
    border: 1px solid var(--gray-100);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 1001;
}

.header-user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.dropdown-header strong {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.dropdown-header span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item.upgrade {
    color: var(--teal-600);
    font-weight: 500;
}

.dropdown-item.pro-status {
    color: var(--green-600, #16a34a);
    font-weight: 500;
}

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

.site-footer {
    background: var(--teal-800);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 1.5rem 2rem;
    margin-top: 3rem;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-col h4 {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    font-size: 0.8125rem;
}

/* ============================================
   SCORE BADGES
   ============================================ */

.score-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.score-excellent { background: var(--green-100); color: var(--green-700); }
.score-good { background: var(--blue-100); color: var(--blue-600); }
.score-average { background: var(--amber-100); color: var(--amber-600); }
.score-poor { background: var(--red-100); color: var(--red-600); }

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

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .header-inner { padding: 0.5rem 1rem; }
    .site-nav { gap: 0; }
    .nav-link { padding: 0.375rem 0.5rem; font-size: 0.8125rem; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ==================== Upgrade Modal Styles ==================== */
.upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.upgrade-modal.visible {
    opacity: 1;
}

.upgrade-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.upgrade-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.upgrade-modal.visible .upgrade-modal-content {
    transform: scale(1);
}

.upgrade-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
}

.upgrade-modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.upgrade-modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upgrade-modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.upgrade-modal-subtitle {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.upgrade-features {
    text-align: left;
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.upgrade-feature {
    padding: 0.5rem 0;
    color: var(--gray-700);
    font-size: 0.9375rem;
}

.upgrade-feature:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
}

.upgrade-price {
    margin-bottom: 1rem;
}

.upgrade-price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--teal-600);
}

.upgrade-price-note {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.upgrade-btn {
    display: inline-block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.upgrade-guarantee {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ==================== Performance Optimizations ==================== */
/* Reduce paint on scroll */
.card, .school-card {
    will-change: transform;
    contain: layout style paint;
}

/* Optimize font loading */
@font-face {
    font-display: swap;
}

/* Reduce reflows */
img {
    aspect-ratio: attr(width) / attr(height);
}
