/* CSS Variables for theming */
:root {
    --bg-primary: #f7f3e9;
    --bg-secondary: #f0ebe0;
    --text-primary: #2c2c2c;
    --text-secondary: #6c757d;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --border-color: #e8e4df;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #4dabf7;
    --accent-hover: #339af0;
    --border-color: #404040;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Optimize for performance */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.2s ease, color 0.2s ease;
    /* Optimize rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Home Page Styles */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 300;
}

.gurbani-quote {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
    max-width: 600px;
    text-align: center;
}

.gurbani-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0.5rem 0;
    line-height: 1.6;
}

.gurbani-translation {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 1.5rem 0;
    font-style: italic;
    font-weight: 300;
}

.gurbani-source {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-top: 1.5rem;
    font-weight: 500;
    font-style: italic;
}

.start-button {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-decoration: none;
    display: inline-block;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

/* Playlist Page Styles */
.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem 2rem;
    padding-right: 5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.header-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-color);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent-color);
}

.playlist-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2.5rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: calc(100vh - 80px);
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.video-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--border-color);
    position: relative;
}

.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.player-placeholder p {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.8;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.control-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.control-btn:hover {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.control-btn.primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

.control-btn.primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 123, 255, 0.4);
}

.playlist-section {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: 20px;
    padding: 2rem;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.progress-indicator {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.playlist-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.video-item {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.video-item:hover {
    border-color: var(--accent-color);
    transform: translateX(6px) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.15);
}

.video-item.active {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(77, 171, 247, 0.1) 0%, rgba(77, 171, 247, 0.05) 100%);
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2), 0 8px 24px rgba(0, 123, 255, 0.2);
    transform: translateX(4px);
}

.video-item.completed {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    position: relative;
}

.video-item.completed::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #28a745;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.video-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 50px;
    height: 50px;
}

.theme-btn {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.theme-btn:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.light-icon, .dark-icon {
    font-size: 1.2rem;
    transition: var(--transition);
}

[data-theme="dark"] .light-icon {
    display: none;
}

[data-theme="light"] .dark-icon {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .playlist-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .playlist-section {
        order: -1;
    }
    
    .video-player {
        aspect-ratio: 16/9;
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        padding-right: 4rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .playlist-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .video-section {
        gap: 1rem;
    }
    
    .controls {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .control-btn {
        padding: 0.6rem 1rem;
        min-width: 80px;
        font-size: 0.9rem;
        flex: 1;
        max-width: 120px;
    }
    
    .playlist-section {
        padding: 1rem;
    }
    
    .video-item {
        padding: 0.75rem;
    }
    
    .video-title {
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
    
    .theme-btn {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }
    
    .gurbani-quote {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .gurbani-text {
        font-size: 1rem;
    }
    
    .gurbani-translation {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1rem;
    }
    
    .title {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    .subtitle {
        font-size: clamp(1rem, 2.5vw, 1.2rem);
    }
    
    .gurbani-quote {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 12px;
    }
    
    .gurbani-text {
        font-size: 0.9rem;
        margin: 0.3rem 0;
    }
    
    .gurbani-translation {
        font-size: 0.8rem;
        margin: 0.3rem 0 1rem 0;
    }
    
    .gurbani-source {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
    
    .start-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .playlist-container {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .header {
        padding: 0.75rem;
        padding-right: 3.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .control-btn {
        width: 100%;
        max-width: 180px;
        padding: 0.7rem 1rem;
    }
    
    .video-item {
        padding: 0.6rem;
    }
    
    .video-number {
        font-size: 0.8rem;
    }
    
    .video-title {
        font-size: 0.85rem;
    }
    
    .theme-toggle {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .theme-btn {
        width: 35px;
        height: 35px;
        padding: 0.4rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Smooth transitions for video changes */
.video-player iframe {
    transition: opacity 0.3s ease;
}

.video-player.loading iframe {
    opacity: 0.7;
} 