:root {
    --primary-color: #3498db;
    --bg-color: #f4f4f9;
    --text-color: #333;
    --card-bg: #fff;
    --active-bg: #e8f4fd;
    --border-color: #ddd;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #5dade2;
        --bg-color: #1a1a1a;
        --text-color: #f4f4f9;
        --card-bg: #2d2d2d;
        --active-bg: #3a3a3a;
        --border-color: #444;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.nav-link:hover {
    background-color: rgba(0,0,0,0.05);
    opacity: 1;
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    opacity: 1;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
    }
}

/* Theory Page Styles */
.theory-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.article-list {
    display: grid;
    gap: 20px;
}

.article-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.article-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.article-meta {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 10px;
}

.article-excerpt {
    line-height: 1.6;
}

main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* Video Player Section */
.video-player-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info h2 {
    margin-bottom: 10px;
}

.meta {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: bold;
}

#current-description {
    opacity: 0.9;
}

/* Playlist Section */
.playlist-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: fit-content;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.playlist-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.video-list {
    overflow-y: auto;
    flex: 1;
}

.video-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.video-item:last-child {
    border-bottom: none;
}

.video-item:hover {
    background-color: rgba(0,0,0,0.05);
}

.video-item.active {
    background-color: var(--active-bg);
    border-left: 4px solid var(--primary-color);
}

.video-item-date {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 4px;
}

.video-item-title {
    font-weight: 600;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    opacity: 0.6;
}

.loading, .error {
    text-align: center;
    padding: 20px;
    opacity: 0.7;
}

.error {
    color: #e74c3c;
}
