@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

/* Premium Modal System */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 450px;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-backdrop.active .modal-container {
    transform: translateY(0);
}

#modal-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

#modal-body {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    line-height: 1.6;
}

#modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-type-error #modal-title { color: #dc2626; }
.modal-type-success #modal-title { color: #16a34a; }
.modal-type-warning #modal-title { color: #d97706; }

/* Enhanced Form Controls for Modals */
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    focus-visible: outline-color: var(--primary);
    background: #f8fafc;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
:root {
    /* Eduficus Premium Palette - Leaf Green & Earth Tones */
    --primary: #71A02D;
    --primary-glow: rgba(113, 160, 45, 0.35);
    --primary-soft: rgba(113, 160, 45, 0.1);
    --secondary: #441F05;
    --accent: #13263F;
    --success: #10b981;
    --danger: #ef4444;
    
    /* Sleek Backgrounds */
    --bg-main: #f8faf7;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #ffffff;
    
    /* Premium Text */
    --text-main: #1a1c19;
    --text-muted: #5c635a;
    --text-on-primary: #ffffff;
    
    /* Glassmorphism & Depth */
    --card-border: rgba(113, 160, 45, 0.1);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --glow-shadow: 0 0 20px 0 var(--primary-glow);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Smoothing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px;
    background-image: 
        radial-gradient(at 0% 0%, hsla(84,56%,40%,0.05) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(24,96%,15%,0.03) 0, transparent 50%);
}

#app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(0,0,0,0.05);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 80px;
    height: calc(100vh - 80px);
    z-index: 900;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.main-layout {
    flex: 1;
    padding: 3rem 5%;
    max-width: 1600px;
    margin-left: 280px;
    margin-right: auto;
    transition: var(--transition);
}

@media (min-width: 1880px) {
    .main-layout {
        margin-left: calc(280px + (100% - 280px - 1600px) / 2);
        margin-right: auto;
    }
}

.landing-active .sidebar,
.landing-active .bottom-nav {
    display: none !important;
    pointer-events: none;
}

.landing-active .main-layout {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
    padding: 0;
}

/* Portal Mode overrides for Landing elements */
body:not(.landing-active) #landing-footer {
    display: none !important;
}

body:not(.landing-active) .sidebar {
    display: flex;
}


/* Navigation */
/* Top Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
}

.navbar-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
}

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

.nav-items a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.nav-items a:hover {
    color: var(--primary);
}

/* Contextual Visibility (Prevent Flashing) */
.school-only, .global-only {
    display: none;
}

/* Sidebar Navigation (Targeted) */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}

/* Components */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

.login-card {
    max-width: 400px;
    margin: 100px auto;
    background: #ffffff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-glow);
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8bc34a);
    color: white !important;
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px -5px var(--primary-glow);
}

.btn-secondary {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    border: 20px;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

input, select, textarea {
    width: 100%;
    height: 50px;
    padding: 0 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid #eef2f6;
    background: #fdfdfe;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Messaging */
.messaging-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f1f5f9;
}

.message-item {
    margin-bottom: 1rem;
    max-width: 80%;
    padding: 1rem;
    border-radius: var(--radius);
}

.message-item.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.message-item.received {
    background: white;
    color: var(--text-main);
    align-self: flex-start;
}

.message-input {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 1rem;
}

/* Map */
#map {
    height: 500px;
    border-radius: var(--radius);
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}


.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

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

.nav-items a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.nav-items a:hover {
    color: var(--primary);
}

/* Hero Section */
.landing-hero {
    padding: 10rem 5% 6rem;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.05), transparent);
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.landing-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 900px;
    margin-inline: auto;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Features Section */
.section-padding {
    padding: 6rem 5%;
}

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

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.features-grid-elegant {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card-elegant {
    padding: 2.5rem;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    transition: var(--transition);
}

.feature-card-elegant:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Footer Styles */
.footer {
    background: #1e293b;
    color: #f8fafc;
    padding: 5rem 5% 3rem;
    display: block;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #ffffff;
}

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

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

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #334155;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .nav-items {
        display: none;
    }
    .landing-hero {
        padding-top: 8rem;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Sliding drawer sidebar for mobile */
    .sidebar {
        display: flex !important; /* Force layout display when shown by JS */
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1200;
        box-shadow: 0 0 30px rgba(0,0,0,0.15);
        background: white;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close-btn {
        display: block !important;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-muted);
        cursor: pointer;
    }

    .mobile-top-bar {
        display: flex !important;
    }

    .main-layout {
        margin-left: 0 !important;
        padding-top: calc(60px + 2rem) !important;
        padding-bottom: 100px !important;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .bottom-nav { display: flex; }
    .grid { grid-template-columns: 1fr; }
}

/* Mobile Top Bar style settings */
.mobile-top-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0 1.5rem;
    z-index: 1100;
}

.menu-toggle-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

.mobile-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

.sidebar-close-btn {
    display: none;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom));
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.bottom-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.bottom-nav a.active {
    color: var(--primary);
}

.bottom-icon {
    font-size: 1.4rem;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Academic Setup Tab Buttons */
.academic-tab {
    padding: 1rem 1.8rem;
    border-radius: 14px;
    border: 1px solid rgba(113, 160, 45, 0.1);
    background: white;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.academic-tab:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.academic-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}
