/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Fredoka+One&display=swap');

/* Base Styles */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Fredoka One', cursive;
    line-height: 1.2;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.btn {
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-outline-primary {
    border: 2px solid;
    border-image-slice: 1;
    border-image-source: var(--gradient);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.section-header {
    position: relative;
    padding-bottom: 15px;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100px;
    height: 100px;
}

.loader-square {
    width: 20px;
    height: 20px;
    background: var(--gradient);
    margin: 5px;
    animation: loaderAnimation 2s ease-in-out infinite;
    border-radius: 4px;
}

.loader-square:nth-child(1) {
    animation-delay: 0s;
}
.loader-square:nth-child(2) {
    animation-delay: 0.2s;
}
.loader-square:nth-child(3) {
    animation-delay: 0.4s;
}
.loader-square:nth-child(4) {
    animation-delay: 0.6s;
}
.loader-square:nth-child(5) {
    animation-delay: 0.8s;
}
.loader-square:nth-child(6) {
    animation-delay: 1s;
}
.loader-square:nth-child(7) {
    animation-delay: 1.2s;
}

@keyframes loaderAnimation {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.5);
        opacity: 0.5;
    }
}

/* Header & Navigation */
header {
    transition: all 0.3s ease;
}

.navbar {
    padding: 15px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 8px 15px !important;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: calc(100% - 30px);
}

/* Hero Section */
.hero-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
}

.hero-image {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img-wrapper {
    width: 300px;
    height: 300px;
    background: var(--gradient);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: morph 8s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(67, 97, 238, 0.2);
    position: relative;
}

.hero-icon {
    position: absolute;
    color: white;
    font-size: 2rem;
    opacity: 0.8;
}

.hero-icon.icon-1 {
    top: 20px;
    left: 20px;
    animation: float 6s ease-in-out infinite;
}
.hero-icon.icon-2 {
    top: 20px;
    right: 20px;
    animation: float 5s ease-in-out infinite 1s;
}
.hero-icon.icon-3 {
    bottom: 20px;
    left: 20px;
    animation: float 7s ease-in-out infinite 0.5s;
}
.hero-icon.icon-4 {
    bottom: 20px;
    right: 20px;
    animation: float 6.5s ease-in-out infinite 1.5s;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.1);
    animation: float 10s ease-in-out infinite;
}

.floating-shape.shape-1 {
    width: 100px;
    height: 100px;
    top: 0;
    left: 0;
    animation-delay: 0s;
}
.floating-shape.shape-2 {
    width: 150px;
    height: 150px;
    bottom: 0;
    right: 0;
    animation-delay: 2s;
}
.floating-shape.shape-3 {
    width: 80px;
    height: 80px;
    top: 30%;
    right: 10%;
    animation-delay: 4s;
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    50% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Features Section */
.feature-card {
    background: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    color: white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

/* Courses Section */
.course-card {
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.course-img {
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    color: white;
}

.course-img i {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.math-img {
    background: linear-gradient(135deg, #4361ee, #4cc9f0);
}
.language-img {
    background: linear-gradient(135deg, #7209b7, #f72585);
}
.science-img {
    background: linear-gradient(135deg, #3a0ca3, #4895ef);
}

/* How It Works Section */
.step-card {
    background: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 20px;
    position: relative;
}

.step-number::after {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    width: calc(100% + 30px);
    height: 2px;
    background: var(--gradient);
    transform: translateY(-50%);
    opacity: 0.2;
}

.step-card:last-child .step-number::after {
    display: none;
}

.step-icon {
    width: 70px;
    height: 70px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

/* Testimonials Section */
.testimonial-item {
    background: white;
    transition: all 0.3s ease;
}

.testimonial-img {
    width: 60px;
    height: 60px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

.testimonial-slider {
    position: relative;
    padding: 20px;
}

/* CTA Section */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
}

/* Contact Section */
.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-3px);
}

/* FAQ Section */
.accordion-button {
    font-weight: 500;
    padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(67, 97, 238, 0.05);
    color: var(--primary-color);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(67, 97, 238, 0.1);
}

/* Footer */
.footer {
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.02)" d="M0,0 L100,0 L100,100 Q50,80 0,100 Z"></path></svg>');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom;
    z-index: -1;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.footer a:hover {
    color: white;
    padding-left: 5px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Animations */
[data-aos] {
    transition: all 0.8s ease;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
    opacity: 0;
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
    opacity: 1;
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
    opacity: 0;
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
    opacity: 1;
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
    opacity: 0;
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
    opacity: 1;
}

[data-aos="fade-left"] {
    transform: translateX(30px);
    opacity: 0;
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
    opacity: 1;
}

/* Responsive Styles */
@media (max-width: 1199.98px) {
    .hero-section {
        padding: 80px 0;
    }
}

@media (max-width: 991.98px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-image {
        height: 350px;
    }
    
    .hero-img-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .step-number::after {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 50px 0;
        text-align: center;
    }
    
    .hero-image {
        height: 300px;
        margin-bottom: 30px;
    }
    
    .hero-img-wrapper {
        width: 200px;
        height: 200px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .section-header::after {
        width: 60px;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 40px 0;
    }
    
    h1.display-4 {
        font-size: 2.5rem;
    }
    
    .feature-card, .step-card {
        padding: 20px;
    }
    
    .contact-form, .contact-info {
        padding: 20px !important;
    }
}

/* ================= Dark mode ================ */
/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .navbar,
.dark-mode .footer {
    background-color: #1e1e1e !important;
    color: #e0e0e0;
}

.dark-mode a.nav-link {
    color: #a0a0a0 !important;
}

.dark-mode .feature-card,
.dark-mode .course-card,
.dark-mode .step-card,
.dark-mode .testimonial-item,
.dark-mode .contact-info,
.dark-mode .contact-form,
.dark-mode .accordion-item {
    background-color: #2d2d2d !important;
    color: #e0e0e0;
    border-color: #3d3d3d !important;
}

.dark-mode .accordion-button:not(.collapsed) {
    background-color: rgba(67, 97, 238, 0.1) !important;
    color: #e0e0e0 !important;
}

.dark-mode .accordion-button {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .text-muted {
    color: #a0a0a0 !important;
}

.dark-mode .bg-light {
    background-color: #1e1e1e !important;
}

.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .input-group-text {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
    color: #e0e0e0;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .footer a {
    color: #a0a0a0;
}

.dark-mode .footer a:hover {
    color: #ffffff;
}

/* Dark mode switch */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
}

/* Adjust moon/sun icon */
#darkModeSwitch + .form-check-label .fa-moon {
    display: inline-block;
}

#darkModeSwitch + .form-check-label .fa-sun {
    display: none;
}

#darkModeSwitch:checked + .form-check-label .fa-moon {
    display: none;
}

#darkModeSwitch:checked + .form-check-label .fa-sun {
    display: inline-block;
    color: #ffc107;
}