/*
 * EduConnect Builder Sections CSS
 * Design System Variables & Component Styles
 * Based on EduConnect_Homepage_v5 design
 */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors - Yellow Theme */
    --ec-primary: #fbbf24;
    --ec-primary-light: #fcd34d;
    --ec-primary-dark: #f59e0b;
    --ec-primary-bg: #fef9e7;

    /* Secondary Colors */
    --ec-secondary: #18181b;
    --ec-secondary-hover: #27272a;

    /* Accent Colors */
    --ec-accent: #059669;
    --ec-accent-light: #10b981;

    /* Text Colors */
    --ec-text-primary: #18181b;
    --ec-text-secondary: #3f3f46;
    --ec-text-muted: #71717a;

    /* Background Colors */
    --ec-bg-white: #ffffff;
    --ec-bg-light: #fafafa;

    /* Border Colors */
    --ec-border: #e4e4e7;
    --ec-border-dark: #d4d4d8;

    /* Shadows */
    --ec-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --ec-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --ec-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 20px 40px -4px rgba(0, 0, 0, 0.1);
    --ec-shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --ec-radius-sm: 4px;
    --ec-radius-md: 6px;
    --ec-radius-lg: 8px;
    --ec-radius-xl: 12px;
    --ec-radius-2xl: 16px;
    --ec-radius-full: 100px;

    /* Spacing */
    --ec-space-xs: 0.25rem;
    --ec-space-sm: 0.5rem;
    --ec-space-md: 1rem;
    --ec-space-lg: 1.5rem;
    --ec-space-xl: 2rem;
    --ec-space-2xl: 3rem;
    --ec-space-3xl: 4rem;

    /* Typography */
    --ec-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ec-font-size-xs: 0.6875rem;
    --ec-font-size-sm: 0.75rem;
    --ec-font-size-base: 0.875rem;
    --ec-font-size-md: 0.9375rem;
    --ec-font-size-lg: 1rem;
    --ec-font-size-xl: 1.125rem;
    --ec-font-size-2xl: 1.25rem;
    --ec-font-size-3xl: 1.75rem;
    --ec-font-size-4xl: 2rem;
    --ec-font-size-5xl: 3rem;

    /* Font Weights */
    --ec-font-normal: 400;
    --ec-font-medium: 500;
    --ec-font-semibold: 600;
    --ec-font-bold: 700;
    --ec-font-extrabold: 800;
    --ec-font-black: 900;

    /* Transitions */
    --ec-transition-fast: 0.15s ease;
    --ec-transition-normal: 0.2s ease;
    --ec-transition-slow: 0.3s ease;

    /* Container */
    --ec-container-max: 1280px;
}

/* ============================================
   Frappe/Page Builder Overrides
   ============================================ */

/* Hide Frappe's default navbar - we use custom EduConnect navbar */
.navbar,
.web-navbar,
.frappe-navbar,
header.navbar {
    display: none !important;
}

/* Hide Frappe's default mobile menu sidebar */
.offcanvas,
.offcanvas-backdrop,
.navbar-collapse,
.mobile-sidebar,
#offcanvasRight,
[data-bs-toggle="offcanvas"] {
    display: none !important;
}

/* Remove default page padding/margins */
.main-section,
main.main-section {
    padding: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
}

.page-content-wrapper,
[data-page-container] {
    padding: 0 !important;
    margin: 0 !important;
}

.web-content,
.page-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide breadcrumbs on homepage */
.page-breadcrumbs {
    display: none !important;
}

/* Web Page container */
.main-section > .container,
.web-content > .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Page Builder block container */
.web-page-block {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove gaps between Page Builder sections */
.page-block-container,
.web-page-block + .web-page-block,
[data-block-type="Section"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Specific: Ticker gap from hero */
.ec-ticker {
    margin-top: 25px !important;
}

/* School finder should have minimal gap from ticker */
.ec-school-finder {
    padding-top: 1rem !important;
}

[data-web-template="EduConnect School Finder"] {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* First section should have no top margin */
.ec-hero {
    margin-top: 0 !important;
}

/* Legacy ec-page overrides */
.ec-page .navbar,
.ec-page .web-footer {
    display: none !important;
}

.ec-page .main-section {
    padding: 0 !important;
    margin: 0 !important;
}

.ec-page .page-content-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

.ec-page .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================
   Base Styles
   ============================================ */
.ec-page {
    font-family: var(--ec-font-family);
    color: var(--ec-text-primary);
    line-height: 1.6;
    background: var(--ec-bg-white);
}

.ec-page * {
    box-sizing: border-box;
}

/* ============================================
   Navigation Component
   ============================================ */
.ec-nav {
    background: var(--ec-bg-white);
    padding: 0 1rem;
    height: 80px !important;
    min-height: 80px !important;
    border-bottom: 1px solid var(--ec-border);
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spacer for fixed navbar */
body {
    padding-top: 80px !important;
}

.ec-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo */
.ec-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    z-index: 1002;
}

.ec-logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.ec-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--ec-secondary);
    border-radius: var(--ec-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--ec-font-extrabold);
    font-size: var(--ec-font-size-lg);
}

.ec-logo-text {
    font-size: var(--ec-font-size-2xl);
    font-weight: var(--ec-font-extrabold);
    color: var(--ec-text-primary);
}

/* Nav Links */
.ec-nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.ec-nav-links a {
    text-decoration: none;
    color: var(--ec-text-secondary);
    font-weight: var(--ec-font-medium);
    font-size: 0.9rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--ec-radius-md);
    transition: all var(--ec-transition-fast);
}

.ec-nav-links a:hover {
    color: var(--ec-text-primary);
    background: var(--ec-bg-light);
}

.ec-nav-divider {
    width: 1px;
    height: 20px;
    background: var(--ec-border);
    margin: 0 0.75rem;
}

/* Mobile Menu Button */
.ec-mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--ec-text-primary);
}

/* ============================================
   Button Components
   ============================================ */
.ec-btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--ec-radius-lg);
    font-weight: var(--ec-font-semibold);
    font-size: var(--ec-font-size-base);
    font-family: var(--ec-font-family);
    cursor: pointer;
    transition: all var(--ec-transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.ec-btn-primary {
    background: var(--ec-secondary);
    color: white;
}

.ec-btn-primary:hover {
    background: var(--ec-secondary-hover);
}

.ec-btn-secondary {
    background: var(--ec-primary);
    color: var(--ec-text-primary);
}

.ec-btn-secondary:hover {
    background: var(--ec-primary-dark);
}

.ec-btn-outline {
    background: transparent;
    color: var(--ec-text-primary);
    border: 1.5px solid var(--ec-border-dark);
}

.ec-btn-outline:hover {
    border-color: var(--ec-text-primary);
    background: var(--ec-bg-light);
}

.ec-btn-ghost {
    background: transparent;
    color: var(--ec-text-secondary);
}

.ec-btn-ghost:hover {
    color: var(--ec-text-primary);
    background: var(--ec-bg-light);
}

.ec-btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--ec-font-size-md);
}

.ec-btn-full {
    width: 100%;
}

/* ============================================
   Hero Section Component - Compact Version
   ============================================ */
.ec-hero {
    background: var(--ec-primary-bg);
    padding: 2.4rem 2rem 2.8rem;
    position: relative;
    overflow: hidden;
}

.ec-hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: 100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--ec-primary-light) 0%, transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

.ec-hero-inner {
    max-width: var(--ec-container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3.2rem;
    position: relative;
    z-index: 1;
}

.ec-hero-content {
    flex: 1;
    max-width: 580px;
}

/* Hero Badge */
.ec-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--ec-border);
    padding: 0.3rem 0.75rem;
    border-radius: var(--ec-radius-full);
    font-size: 0.75rem;
    font-weight: var(--ec-font-medium);
    margin-bottom: 0.75rem;
    color: var(--ec-text-secondary);
}

.ec-hero-badge .dot {
    width: 7px;
    height: 7px;
    background: var(--ec-accent);
    border-radius: 50%;
}

/* Hero Title */
.ec-hero h1 {
    font-size: 2.5rem;
    font-weight: var(--ec-font-black);
    line-height: 1.1;
    margin-top: 0.9rem;
    margin-bottom: 1rem;
    color: var(--ec-text-primary);
    letter-spacing: -0.02em;
}

.ec-hero h1 .highlight {
    background: linear-gradient(180deg, transparent 60%, var(--ec-primary) 60%);
    padding: 0 4px;
}

.ec-hero-description {
    font-size: 1rem;
    color: var(--ec-text-secondary);
    margin-bottom: 1.4rem;
    line-height: 1.6;
}

.ec-hero-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================
   Hero Search Card Component - Compact Version
   ============================================ */
.ec-hero-search {
    background: white;
    border-radius: var(--ec-radius-2xl);
    padding: 1.2rem 1.6rem;
    width: 380px;
    box-shadow: var(--ec-shadow-lg);
    border: 1px solid var(--ec-border);
    flex-shrink: 0;
}

.ec-hero-search h3 {
    font-size: 1rem;
    font-weight: var(--ec-font-bold);
    color: var(--ec-text-primary);
    margin-bottom: 0.25rem;
}

.ec-hero-search .subtitle {
    font-size: 0.8125rem;
    color: var(--ec-text-muted);
    margin-bottom: 1.2rem;
}

.ec-search-field {
    margin-bottom: 0.8rem;
}

.ec-search-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: var(--ec-font-semibold);
    color: var(--ec-text-secondary);
    margin-bottom: 0.25rem;
}

.ec-search-field select,
.ec-search-field input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1.5px solid var(--ec-border);
    border-radius: var(--ec-radius-lg);
    font-size: var(--ec-font-size-base);
    font-family: var(--ec-font-family);
    color: var(--ec-text-primary);
    background: var(--ec-bg-white);
    cursor: pointer;
    transition: all var(--ec-transition-fast);
}

.ec-search-field select:focus,
.ec-search-field input:focus {
    outline: none;
    border-color: var(--ec-secondary);
}

.ec-search-btn {
    width: 100%;
    margin-top: 0.4rem;
    background: var(--ec-secondary);
    color: white;
    padding: 0.7rem;
    font-size: var(--ec-font-size-base);
}

.ec-search-btn:hover {
    background: var(--ec-secondary-hover);
}

/* ============================================
   Stats Bar Component
   ============================================ */
.ec-stats-bar {
    background: var(--ec-bg-white);
    border-bottom: 1px solid var(--ec-border);
    padding: 1.5rem 2rem;
}

.ec-stats-bar-inner {
    max-width: var(--ec-container-max);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.ec-stat-item {
    text-align: center;
}

.ec-stat-number {
    font-size: var(--ec-font-size-3xl);
    font-weight: var(--ec-font-extrabold);
    color: var(--ec-text-primary);
    line-height: 1;
}

.ec-stat-label {
    font-size: 0.8125rem;
    color: var(--ec-text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   Section Common Styles
   ============================================ */
.ec-section {
    padding: 4.5rem 2rem;
}

.ec-section-inner {
    max-width: var(--ec-container-max);
    margin: 0 auto;
}

.ec-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ec-section-label {
    display: inline-block;
    font-size: var(--ec-font-size-sm);
    font-weight: var(--ec-font-bold);
    color: var(--ec-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.625rem;
}

.ec-section-header h2 {
    font-size: var(--ec-font-size-4xl);
    font-weight: var(--ec-font-extrabold);
    color: var(--ec-text-primary);
    margin-bottom: 0.625rem;
    letter-spacing: -0.01em;
}

.ec-section-header p {
    color: var(--ec-text-secondary);
    font-size: 1.0625rem;
    max-width: 520px;
    margin: 0 auto;
}

/* ============================================
   Footer Component
   ============================================ */
.ec-footer {
    background: var(--ec-secondary);
    color: white;
    padding: 4rem 2rem 1.5rem;
}

.ec-footer-inner {
    max-width: var(--ec-container-max);
    margin: 0 auto;
}

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

.ec-footer-brand .ec-logo-icon {
    background: var(--ec-primary);
    color: var(--ec-secondary);
}

.ec-footer-brand .ec-logo-text {
    color: white;
}

.ec-footer-tagline {
    color: #a1a1aa;
    font-size: var(--ec-font-size-base);
    margin-top: 0.75rem;
    line-height: 1.6;
    max-width: 280px;
}

.ec-footer-column h4 {
    font-size: var(--ec-font-size-sm);
    font-weight: var(--ec-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a1a1aa;
    margin-bottom: 1rem;
}

.ec-footer-column a {
    display: block;
    color: white;
    text-decoration: none;
    font-size: var(--ec-font-size-base);
    padding: 0.375rem 0;
    transition: color var(--ec-transition-fast);
}

.ec-footer-column a:hover {
    color: var(--ec-primary);
}

.ec-footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid #27272a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ec-footer-copyright {
    color: #71717a;
    font-size: 0.8125rem;
}

.ec-footer-links {
    display: flex;
    gap: 1.5rem;
}

.ec-footer-links a {
    color: #71717a;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color var(--ec-transition-fast);
}

.ec-footer-links a:hover {
    color: white;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 1024px) {
    .ec-hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .ec-hero-content {
        max-width: 100%;
    }

    .ec-hero-buttons {
        justify-content: center;
    }

    .ec-hero-search {
        width: 100%;
        max-width: 420px;
    }

    .ec-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ec-nav {
        padding: 0.75rem 1rem;
    }

    .ec-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ec-bg-white);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--ec-border);
        box-shadow: var(--ec-shadow-md);
    }

    .ec-nav-links.active {
        display: flex;
    }

    .ec-nav-links a {
        width: 100%;
        padding: 0.75rem 1rem;
        text-align: center;
    }

    .ec-nav-divider {
        width: 100%;
        height: 1px;
        margin: 0.5rem 0;
    }

    .ec-mobile-menu-btn {
        display: block;
    }

    .ec-hero {
        padding: 1.6rem 1rem 2rem;
    }

    .ec-hero h1 {
        font-size: 1.75rem;
    }

    .ec-hero-description {
        font-size: 0.9375rem;
    }

    .ec-hero-inner {
        gap: 1.6rem;
    }

    .ec-hero-search {
        padding: 1.2rem;
    }

    .ec-stats-bar-inner {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .ec-stat-item {
        flex: 1 0 calc(50% - 1rem);
    }

    .ec-section {
        padding: 3rem 1rem;
    }

    .ec-footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ec-footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ============================================
   Mobile Navigation Toggle (JavaScript helper)
   ============================================ */
.ec-nav-links.ec-nav-open {
    display: flex;
}
