:root {
    /* Light theme colors */
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-bg: #f8f9fa;
    --header-text: #2c3e50;
    --accent-color: #3498db;
    --border-color: #e1e5e9;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover-bg: #f8f9fa;
    --code-bg: #f4f4f4;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --header-bg: #2d2d2d;
    --header-text: #ffffff;
    --accent-color: #64b5f6;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --shadow: rgba(0, 0, 0, 0.3);
    --hover-bg: #3d3d3d;
    --code-bg: #3d3d3d;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
header {
    background: var(--header-bg);
    padding: 2rem 0;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    flex: 1;
}

h1 {
    color: var(--header-text);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.theme-toggle {
    margin-left: auto;
}

.theme-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--shadow);
}

/* Main content */
main {
    padding: 3rem 0;
}

/* Content sections */
.content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.task-section {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.task-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--shadow);
}

.task-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 2rem;
    text-align: left;
}

.task-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.task-content {
    padding: 2rem;
}

/* Subtasks */
.subtask {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--hover-bg);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.subtask h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.subtask p {
    margin-bottom: 1rem;
    text-align: justify;
}

.subtask p:last-child {
    margin-bottom: 0;
}

.subtask ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.subtask li {
    margin-bottom: 0.5rem;
}

code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

/* Media containers */
.video-container, .image-container, .download-container {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.video-container video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow);
    max-height: 400px;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow);
    max-height: 300px;
    object-fit: contain;
}

.download-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.download-link:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    text-decoration: none;
    color: white;
}

.download-main {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    font-size: 1.1rem;
    padding: 16px 32px;
}

.download-main:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
}

/* Bibliography */
.bibliography {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.bibliography h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.bibliography h3 {
    color: var(--accent-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
}

.bibliography ul {
    list-style: none;
    padding: 0;
}

.bibliography li {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--hover-bg);
    border-radius: 6px;
    line-height: 1.5;
}

.bibliography a {
    color: var(--accent-color);
    text-decoration: none;
}

.bibliography a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: left;
        align-items: center;
    }
    
    .header-content {
        text-align: center;
    }
    
    .task-header {
        padding: 1.5rem 1rem;
    }
    
    .task-header h2 {
        font-size: 1.8rem;
    }
    
    .task-content {
        padding: 1.5rem;
    }
    
    .subtask {
        padding: 1rem;
    }
    
    .video-container video {
        max-height: 250px;
    }
    
    .image-container img {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .task-header h2 {
        font-size: 1.5rem;
    }
    
    .subtask h3 {
        font-size: 1.1rem;
    }
    
    .theme-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .content {
        gap: 2rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

/* Focus states for accessibility */
.accordion-header:focus,
.theme-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Animation for smooth scrolling */
html {
    scroll-behavior: smooth;
}
