/* ===================================
   Custom Properties (CSS Variables)
   =================================== */
:root {
    --primary-color: #7c3aed;
    --secondary-color: #a78bfa;
    --accent-color: #ec4899;
    --dark-bg: #221338;
    --darker-bg: #1a0f2e;
    --card-bg: #2d1b4e;
    --gradient-start: #7c3aed;
    --gradient-end: #221338;
    --text-light: #e9d5ff;
    --text-muted: #c4b5fd;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --glow: 0 0 20px rgba(124, 58, 237, 0.5);
    --transition: all 0.3s ease;
}

/* ===================================
   Global Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-light);
    background-color: var(--dark-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

section {
    position: relative;
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    padding: 1rem 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

@media (max-width: 335px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
        border-width: 1px;
    }
    
    .navbar-toggler-icon {
        width: 1.2em;
        height: 1.2em;
    }
    
    .navbar .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    transition: var(--transition);
    white-space: normal;
    line-height: 1.2;
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
}

@media (max-width: 335px) {
    .navbar-brand {
        font-size: 0.7rem;
        max-width: 65%;
        padding-right: 0.5rem;
    }
    
    .navbar-brand i {
        font-size: 0.8rem;
        margin-right: 0.25rem !important;
    }
}

.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
}

.dropdown-menu {
    background: var(--card-bg);
    border: 1px solid rgba(124, 58, 237, 0.3);
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
}

.dropdown-item {
    color: var(--text-light);
    transition: var(--transition);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background: rgba(124, 58, 237, 0.2);
    color: var(--white);
}

.dropdown-item:focus {
    background: rgba(124, 58, 237, 0.3);
    color: var(--white);
}

.dropdown-item i {
    color: var(--secondary-color);
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--white);
    position: relative;
    padding-top: 80px;
}

.hero-title {
    animation: fadeInUp 1s ease;
}

/* Logo Image Responsive Sizing */
.hero-section img {
    max-width: 100%;
    height: auto;
    width: 500px;
    display: block;
}

.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    animation: float 3s ease-in-out infinite;
}

.hero-illustration i {
    color: rgba(255, 255, 255, 0.9);
    animation: pulse 2s ease-in-out infinite;
}

.hero-illustration i:nth-child(1) {
    animation-delay: 0s;
}

.hero-illustration i:nth-child(2) {
    animation-delay: 0.3s;
}

.hero-illustration i:nth-child(3) {
    animation-delay: 0.6s;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
}

.hero-wave svg {
    display: block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--white);
    border: none;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: var(--transition);
    box-shadow: var(--glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.8);
}

.btn-outline-light {
    border: 2px solid var(--white);
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: var(--transition);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===================================
   About Section
   =================================== */
#about {
    background-color: var(--darker-bg);
}

.about-icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
}

.icon-item {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.icon-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--glow);
}

.icon-item i {
    font-size: 3rem;
    color: var(--white);
}

.feature-item {
    display: flex;
    align-items: center;
    font-weight: 500;
    padding: 0.5rem 0;
    color: var(--text-light);
}

.feature-item i {
    font-size: 1.25rem;
    color: var(--secondary-color);
}

/* ===================================
   Subjects Section
   =================================== */
.subjects-section {
    background-color: var(--dark-bg);
}

.subject-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid rgba(124, 58, 237, 0.3);
    color: var(--text-light);
}

.subject-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--glow);
    border-color: var(--primary-color);
}

.subject-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(34, 19, 56, 0.8));
}

.subject-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--glow);
}

.subject-card:hover .subject-icon {
    transform: rotate(360deg) scale(1.1);
}

.subject-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.subject-card ul li {
    color: var(--text-muted);
}

.subject-card ul li i {
    color: var(--secondary-color);
}

/* ===================================
   Resources Section
   =================================== */
#resources {
    background-color: var(--darker-bg);
}

.resource-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid rgba(124, 58, 237, 0.3);
    color: var(--text-light);
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow);
    border-color: var(--primary-color);
}

.resource-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--glow);
}

.resource-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.resource-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-list li {
    margin-bottom: 1rem;
}

.resource-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.resource-link:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary-color);
    color: var(--white);
    transform: translateX(5px);
}

.resource-link i:first-child {
    color: var(--secondary-color);
}

.resource-link i:last-child {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--text-light);
    background: transparent;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: var(--glow);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--darker-bg);
    color: var(--text-light);
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--secondary-color);
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 100px;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Logo responsive sizing for tablets */
    .hero-section img {
        width: 350px;
        max-width: 90%;
    }

    .hero-illustration {
        margin-top: 3rem;
        flex-direction: column;
    }

    .about-icon-grid {
        display: none;
    }
    
    .about-image-wrapper {
        display: none;
    }

    .icon-item {
        padding: 2rem 1.5rem;
    }

    .subject-card {
        margin-bottom: 2rem;
    }

    .contact-illustration {
        margin-top: 2rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }
    
    /* Fix modal on mobile */
    .modal-dialog {
        margin: 1rem;
    }
    
    .modal-content {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .display-3 {
        font-size: 2rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1rem;
    }
    
    /* Logo responsive sizing for mobile */
    .hero-section img {
        width: 280px;
        max-width: 85%;
    }

    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        width: 100%;
    }

    .d-flex.gap-3 a {
        width: 100%;
    }
    
    /* Additional modal fixes for small screens */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 335px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .display-3 {
        font-size: 1.75rem;
    }

    .display-4 {
        font-size: 1.75rem;
    }
    
    /* Logo responsive sizing for very small screens */
    .hero-section img {
        width: 220px;
        max-width: 80%;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Very small modal adjustments */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-body {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-title {
        font-size: 1rem !important;
    }
    
    .modal-footer {
        padding: 0.5rem 0.75rem;
    }
    
    .modal-footer .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===================================
   Smooth Scrolling Enhancement
   =================================== */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ===================================
   Utility Classes
   =================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================
   Additional Dark Theme Adjustments
   =================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-light);
}

.lead {
    color: var(--text-muted);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}