* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.8;
    background: linear-gradient(135deg, #f5f5f5, #e0d4ff);
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a, #2c1b47);
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Login Modal */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-in-out;
}

body.dark-mode .modal-content {
    background: #2c2c2c;
}

.modal-content h2 {
    color: #5e17eb;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    color: #333;
    margin-bottom: 0.5rem;
}

body.dark-mode .form-group label {
    color: #d0d0d0;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #8C52FF;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #FC6BC6;
}

.modal-content button {
    background: linear-gradient(45deg, #8C52FF, #5e17eb);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.modal-content button:hover {
    background: linear-gradient(45deg, #5e17eb, #FC6BC6);
}

.error {
    color: #ff4d4d;
    margin-top: 1rem;
    display: none;
}

/* Header */
header {
    background: linear-gradient(45deg, #8C52FF, #5e17eb);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0.3;
}

header h1 {
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeInDown 1s ease-in-out;
}

header p {
    font-size: 1.2rem;
    position: relative;
    animation: fadeInUp 1s ease-in-out 0.3s both;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    height: 100%;
    width: 250px;
    background-color: #5e17eb;
    padding: 2rem;
    transition: left 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar.active {
    left: 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin: 1.5rem 0;
}

.sidebar a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: #FC6BC6;
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #8C52FF;
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1100;
}

/* Chapters */
.chapter {
    background: white;
    padding: 2.5rem;
    margin: 2rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.8s ease-in-out forwards;
    animation-delay: calc(0.2s * var(--i));
}

body.dark-mode .chapter {
    background: #2c2c2c;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.chapter h2 {
    color: #5e17eb;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #FC6BC6;
    padding-bottom: 0.5rem;
    transition: color 0.3s;
}

body.dark-mode .chapter h2 {
    color: #FC6BC6;
}

.chapter p {
    color: #333;
    margin-bottom: 1rem;
}

body.dark-mode .chapter p {
    color: #d0d0d0;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #FC6BC6;
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

/* Footer */
footer {
    background: linear-gradient(45deg, #8C52FF, #5e17eb);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-radius: 8px;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hidden Content */
.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .chapter {
        padding: 1.5rem;
    }

    .sidebar {
        width: 200px;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .container {
        padding: 10px;
    }

    .chapter {
        padding: 1rem;
    }
}