/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;600;700&display=swap');

/* CSS Variables for Light & Dark Mode */
:root {
    /* Colors - Light Theme (Default) */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --surface-color: #ffffff;
    /* White */
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */

    --primary-color: #1e293b;
    /* Deep Slate 800 */
    --primary-hover: #334155;
    /* Slate 700 */

    --accent-color: #2563eb;
    /* Trust Blue 600 */
    --accent-hover: #1d4ed8;
    /* Trust Blue 700 */

    --highlight-color: #10b981;
    /* Emerald 500 (For CTA / Success) */
    --highlight-hover: #059669;
    /* Emerald 600 */

    --border-color: #e2e8f0;
    /* Slate 200 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Layout */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --container-width: 1200px;
}

[data-theme="dark"] {
    /* Colors - Dark Theme */
    --bg-color: #0f172a;
    /* Slate 900 */
    --surface-color: #1e293b;
    /* Slate 800 */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */

    --primary-color: #f8fafc;
    /* Slate 50 (White for text) */
    --primary-hover: #e2e8f0;
    /* Slate 200 */

    --accent-color: #3b82f6;
    /* Trust Blue 500 */
    --accent-hover: #60a5fa;
    /* Trust Blue 400 */

    --border-color: #334155;
    /* Slate 700 */

    /* Adjusted dark shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.mb-5 {
    margin-bottom: 48px;
}

/* Typography */
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 4px;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #ffffff !important;
}

.btn-cta {
    background-color: var(--highlight-color);
    color: #ffffff !important;
    box-shadow: var(--shadow-md);
}

.btn-cta:hover {
    background-color: var(--highlight-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Animated Theme Toggle */
.animated-theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.toggle-track {
    width: 60px;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    transition: background-color var(--transition-normal);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

body[data-theme='dark'] .toggle-track {
    background-color: var(--accent-color);
}

.icon-sun {
    color: #f59e0b;
    /* Amber */
    font-size: 14px;
    z-index: 1;
}

.icon-moon {
    color: #fbbf24;
    /* Yellow */
    font-size: 14px;
    z-index: 1;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

body[data-theme='dark'] .toggle-thumb {
    transform: translateX(30px);
    background-color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: transparent;
}

/* Header & Navbar */
header {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 48px;
    width: auto;
    transition: filter var(--transition-normal);
}

[data-theme="dark"] .logo-img {
    filter: brightness(0) invert(1);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform var(--transition-normal);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--surface-color);
    min-width: 220px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    padding: 8px 0;
    border: 1px solid var(--border-color);
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown:hover .dropdown-toggle i,
.dropdown.open .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    font-weight: 500;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

/* Nav Right & Toggles */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--bg-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Specific Section Styles */

/* Hero */
.hero {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--bg-color) 0%, rgba(37, 99, 235, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--primary-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.animated-text {
    background: linear-gradient(270deg, var(--accent-color), var(--highlight-color), var(--accent-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    display: inline-block;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

[data-theme="dark"] .hero h1 {
    color: #fff;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image-wrapper {
    position: relative;
    z-index: 2;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: perspective(1000px) rotateY(-5deg) translateY(10px);
    transition: transform 0.5s ease;
}

.hero-image-wrapper:hover {
    transform: perspective(1000px) rotateY(0deg) translateY(0px);
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Background blob for hero */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 120%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

/* Stats Section */
.stats-section {
    background-color: var(--surface-color);
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-hover);
}

/* Course Card Specific */
.course-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    background: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.course-card .card-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.card-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    flex-grow: 1;
}

/* Notebook Card Specific */
.notebook-card {
    text-align: center;
    align-items: center;
    padding: 40px 24px;
}

.notebook-card .card-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    transition: transform var(--transition-normal);
}

.notebook-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.notebook-card .card-title {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Exam Card */
.exam-card {
    align-items: center;
    text-align: center;
}

.exam-card .card-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.exam-card .btn {
    margin-top: auto;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--surface-color);
}

/* Floating Label Variant */
.floating-group {
    position: relative;
    margin-bottom: 24px;
}

.floating-group .form-control {
    padding: 20px 16px 8px 16px;
}

.floating-label {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.floating-group .form-control:focus~.floating-label,
.floating-group .form-control:not(:placeholder-shown)~.floating-label {
    top: 6px;
    font-size: 0.75rem;
    color: var(--accent-color);
}

.error-message {
    color: #ef4444;
    /* Red 500 */
    font-size: 0.875rem;
    margin-top: 6px;
    display: none;
}

.form-control.error {
    border-color: #ef4444;
}

.form-control.error+.error-message {
    display: block;
}

/* Contact/Location Frame */
.map-container {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.contact-card {
    padding: 40px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Footer */
footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 24px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.footer-links h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 4px;
}

.social-icons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-bounce);
    border: 1px solid var(--border-color);
}

.social-icon:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scroll to Top */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-4px);
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--surface-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--surface-color);
        flex-direction: column;
        padding: 40px 24px;
        gap: 24px;
        transition: left var(--transition-normal);
        overflow-y: auto;
        z-index: 1000;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: var(--bg-color);
        border: none;
        display: none;
        /* Hide by default in mobile */
        margin-top: 10px;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .contact-card {
        padding: 24px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-padding {
        padding: 40px 0;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .navbar {
        height: 70px;
    }

    .nav-brand h3 {
        font-size: 1.2rem;
    }

    .logo-img {
        height: 36px;
    }

    .toggle-track {
        width: 50px;
        height: 26px;
    }

    body[data-theme='dark'] .toggle-thumb {
        transform: translateX(24px);
    }

    .toggle-thumb {
        width: 20px;
        height: 20px;
    }
}