:root {
    --primary: #43658b;
    --secondary: #4e89ae;
    --accent: #ed6663;
    --light: #f5f7fa;
    --dark: #2c3e50;
    --success: #4caf50;
    --warning: #ff9800;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Open Sans', sans-serif;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #f0f4f8 0%, #e6eef7 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header {
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 50%;
}

.logo i {
    font-size: 2.6rem;
    /*color: #ffd166;*/
    color: #333;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    padding: 12px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.logo span {
    color: #333;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1.1rem;
}

.user-info i {
    font-size: 1.3rem;
}

.hero {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 60px 0 40px;
}

.hero-content {
    flex: 1;
    text-align: center;
}

.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--primary);
}

.hero h2 span {
    color: var(--accent);
}

.hero h2 .hero-text {
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    margin: 0 auto 30px;
    max-width: 600px;
    color: #555;
}

.section-title {
    text-align: center;
    margin: 40px 0 30px;
    color: var(--primary);
    font-size: 2.2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 2fr);
    justify-items: center;
    gap: 30px;
    margin-bottom: 50px;
}

.subject-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition), transform 0.4s ease;
    position: relative;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.subject-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.subject-header {
    padding: 25px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.subject-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
    z-index: 1;
}

.subject-header i {
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
}

.subject-header h3 {
    position: relative;
    z-index: 2;
    font-size: 1.6rem;
}

.subject-content {
    padding: 25px;
    text-align: center;
}

.subject-content p {
    margin-bottom: 20px;
    color: #555;
}

.chapters {
    margin-top: 20px;
}

.chapters h4 {
    margin-bottom: 15px;
    color: var(--dark);
    font-size: 1.1rem;
}

.chapter-list {
    list-style: none;
}

.chapter-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapter-list li:last-child {
    border-bottom: none;
}

.chapter-list i {
    color: var(--success);
}

.btn {
    display: block;
    margin: 20px auto 0;
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-accent {
    background: var(--accent);
    display: inline-block;
    width: auto;
}

.btn-accent:hover {
    background: #ff7e79;
}

.resources {
    background: linear-gradient(135deg, #5e81ac 0%, #81a1c1 100%);
    border-radius: var(--border-radius);
    padding: 50px 40px;
    box-shadow: var(--shadow);
    margin: 50px 0;
    color: white;
}

.resources h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
}

.resource-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.resource-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    transition: var(--transition);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.resource-card:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
}

.resource-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: white;
}

.resource-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.resource-card a {
    margin: 0 auto;
    color: white;
    text-decoration: none;
}

.image-generator {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    margin: 40px 0;
    text-align: center;
}

.image-generator h2 {
    margin-bottom: 30px;
    color: var(--primary);
}

.generator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.generated-image {
    width: 100%;
    max-width: 500px;
    height: 300px;
    border-radius: 12px;
    background: linear-gradient(45deg, #43658b, #4e89ae);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.generated-image-content {
    color: white;
    padding: 20px;
    text-align: center;
}

.generated-image-content i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.generated-image-content h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.theme-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.theme-btn {
    padding: 10px 20px;
    background: var(--light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

.donation-section {
    background: var(--light);
    padding: 40px 30px;
    margin-top: 50px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.donation-section h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.donation-section p {
    font-size: 1.1rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

footer {
    background: var(--dark);
    color: white;
    padding: 50px 0 20px;
    margin-top: auto;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    font-size: 1.4rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #444;
    font-size: 0.95rem;
    color: #aaa;
}

@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

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

    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .resource-grid {
        flex-direction: column;
        align-items: center;
    }

    .resource-card {
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        padding-bottom: 10px;
    }

    .user-info {
        display: none;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .subject-card {
        max-width: 100%;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .resource-grid {
        flex-direction: column;
        align-items: center;
    }

    .resource-card {
        max-width: 100%;
    }

    .footer-content {
        text-align: center;
    }

    .footer-section h3::after {
        margin: 0 auto;
    }

    .footer-links a {
        justify-content: center;
    }

    .btn {
        width: 90%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .theme-selector {
        flex-direction: column;
    }

    .btn,
    .theme-btn {
        width: 90%;
        max-width: 300px;
    }

    .subject-header {
        justify-content: center;
        flex-direction: column;
    }

    .subject-header h3,
    .subject-header i {
        text-align: center;
    }
}

#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#loader {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

#loader .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: #4e89ae;
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}

#loader .dot:nth-child(2) {
    animation-delay: 0.2s;
}

#loader .dot:nth-child(3) {
    animation-delay: 0.4s;
}

#loader p {
    margin-top: 20px;
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}