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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #FFF5F5 0%, #FF0000 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    margin: 50px 0;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff4444;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

/* ============================================================================
   HOME PAGE STYLES
   ============================================================================ */

.home-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out;
}

.home-intro {
    text-align: center;
    margin-bottom: 40px;
}

.home-intro h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

.home-intro p {
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.lesson-card {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-color: #FFF5F5;
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.lesson-card:hover::before {
    transform: scaleX(1);
}

.lesson-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #FFF5F5 0%, #FF0000 100%);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.lesson-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.lesson-preview {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lesson-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.lesson-difficulty {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.difficulty-beginner {
    background: #d4edda;
    color: #155724;
}

.difficulty-intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty-advanced {
    background: #f8d7da;
    color: #721c24;
}

.lesson-arrow {
    color: #667eea;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.lesson-card:hover .lesson-arrow {
    transform: translateX(5px);
}

.home-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.action-button {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.start-button {
    background: linear-gradient(135deg, #FFF5F5 0%, #FF0000 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.random-button {
    background: #e2e8f0;
    color: #4a5568;
}

.random-button:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* ============================================================================
   LESSON VIEW STYLES
   ============================================================================ */

.lesson-header {
    margin-bottom: 30px;
}

.back-button {
    background: #e2e8f0;
    color: #4a5568; 
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    transform: translateY(-5px);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

.lesson-container {
    display: flex;
    gap: 30px;
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out;
    min-height: 600px;
}

.description-panel {
    flex: 1;
    padding-right: 20px;
}

.topic-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-number {
    background: linear-gradient(135deg, #FFF5F5 0%, #FF0000 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.description-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    white-space: pre-wrap;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #FFF5F5;
    overflow-x: auto;
}

.code-panel {
    flex: 1;
    background: #2d3748;
    border-radius: 15px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27ca3f; }

.code-title {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-left: 10px;
}

.copy-button {
    margin-left: auto; /* Pushes the button to the right */
    padding: 5px 10px;
    background-color: #4CAF50; /* Example green background */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    /* You can adjust these values as per your design */
}

.copy-button:hover {
    background-color: #45a049;
}

pre {
    margin: 0 !important;
    background: transparent !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    white-space: pre-wrap !important;
    overflow-x: auto;
}

code {
    font-family: 'JetBrains Mono', monospace !important;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 20px;
}

.nav-button {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prev-button {
    background: #e2e8f0;
    color: #4a5568;
}

.prev-button:hover:not(:disabled) {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.next-button {
    background: linear-gradient(135deg, #FFF5F5 0%, #FF0000 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.next-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.topic-counter {
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    color: #4a5568;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .lesson-container {
        flex-direction: column;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .home-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}
