/* Variables & Reset */
:root {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --secondary-color: #f472b6;
    --bg-color: #0f172a;
    --bg-alt: #1e293b;
    --text-color: #f1f5f9;
    --text-light: #94a3b8;
    --border-color: #334155;
    --card-bg: #1e293b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --nav-height: 70px;
    --transition: all 0.3s ease;
    --font-main: 'Outfit', sans-serif;
}

[data-theme="light"] {
    --primary-color: #4f46e5;
    /* Indigo */
    --primary-hover: #4338ca;
    --secondary-color: #ec4899;
    /* Pink */
    --bg-color: #fff0e4;
    --bg-alt: #ebd6c3;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin: 10px auto 0;
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Navbar */
.navbar {
    height: var(--nav-height);
    background: rgba(9, 18, 40, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(255, 250, 240, 0.8);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo span {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-logo-img {
    height: 40px;
    width: 40px;
    object-fit: cover;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: var(--transition);
    padding: 5px;
}

.theme-btn:hover {
    color: var(--primary-color);
    transform: rotate(15deg);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: var(--transition);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-link {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Hero Section */
.hero {
    height: calc(100vh - var(--nav-height));
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    max-width: 800px;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 800;
}

.highlight {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.hero-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-bg.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1;
}

[data-theme="light"] .hero-overlay {
    background: rgba(255, 255, 255, 0.4);
}

/* Subjects Section */
.notes-tree {
    max-width: 900px;
    margin: 0 auto;
}

.subject-group,
.topic-group {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.subject-group:hover {
    box-shadow: var(--shadow-lg);
}

.subject-header,
.topic-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: var(--card-bg);
    transition: background-color 0.2s;
}

.subject-header:hover,
.topic-header:hover {
    background-color: var(--bg-alt);
}

.subject-header h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subject-header h3 i {
    color: var(--primary-color);
}

.topic-header {
    padding: 15px 20px;
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    font-size: 1.1rem;
}

.subject-content,
.topic-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.subject-content.open,
.topic-content.open {
    max-height: 1000px;
    /* Arbitrary large height */
    transition: max-height 0.6s ease-in;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.rotate {
    transform: rotate(180deg);
}

.pdf-item {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.2s;
    color: var(--text-light);
}

.pdf-item:hover {
    background-color: var(--bg-alt);
    color: var(--primary-color);
}

.pdf-item i {
    color: #ef4444;
    /* PDF Red */
    font-size: 1.2rem;
}

/* YouTube Section */
.bg-alt {
    background-color: var(--bg-alt);
}

.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    padding: 20px 0;
}

.carousel-track-container {
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.video-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #000;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.video-card:hover .video-thumbnail img {
    opacity: 1;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: transform 0.3s;
}

.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-card h3 {
    padding: 20px;
    font-size: 1.2rem;
    text-align: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 10;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-indicator.current-slide {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* About Section */
.about-section {
    position: relative;
    min-height: 600px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: white;
}

.about-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.about-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.about-bg.active {
    opacity: 1;
}

.about-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.about-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.text-white {
    color: white;
}

.about-content .section-title {
    left: auto;
    transform: none;
}

.about-grid {
    display: flex;
    align-items: center;
    gap: 40px;
    text-align: left;
    justify-content: center;
    margin-top: 30px;
}

.about-avatar-container {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.about-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text {
    font-size: 0.85rem;
    line-height: 1.8;
    text-align: justify;
}

.about-text h1 {
    color: #FFD700;
    margin-bottom: 15px;
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
    margin-bottom: 10px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--text-light);
    pointer-events: none;
    transition: all 0.3s ease;
    background: var(--bg-alt);
    padding: 0 5px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input:focus~label,
.form-group input:not(:placeholder-shown)~label,
.form-group textarea:focus~label,
.form-group textarea:not(:placeholder-shown)~label {
    top: -10px;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.6);
}

/* Footer */
footer {
    background-color: var(--bg-alt);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-color);
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-alt);
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s;
}

.close-modal:hover {
    color: #ef4444;
}

.modal-body {
    flex: 1;
    position: relative;
    background-color: #525659;
    /* PDF viewer bg color */
}

iframe {
    width: 100%;
    height: 100%;
}

.pdf-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    gap: 20px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-grid {
        flex-direction: column-reverse;
        text-align: center;
    }

    .about-avatar-container {
        width: 250px;
        height: 250px;
    }

    .about-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .pdf-item {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: center;
        width: 100%;
    }

    .hero-buttons .btn {
        padding: 8px 10px;
        font-size: 0.75rem;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 0 1 auto;
    }

    .hero-buttons .btn i {
        font-size: 0.7rem;
    }

    .about-avatar-container {
        width: 220px;
        height: 220px;
    }

    .about-text {
        font-size: 0.75rem;
    }
}