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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.player-container {
    margin-bottom: 40px;
}

.now-playing {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

#episode-image {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0f0f0;
}

.episode-info {
    flex: 1;
}

.episode-info h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.episode-info p {
    color: #666;
    line-height: 1.6;
}

.audio-controls {
    width: 100%;
}

#audio-player {
    width: 100%;
    height: 50px;
}

.episodes-list {
    border-top: 2px solid #f0f0f0;
    padding-top: 30px;
}

.episodes-list h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

#episodes-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.episode-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.episode-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.episode-item.active {
    background: #667eea;
    color: white;
}

.episode-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.episode-details {
    flex: 1;
}

.episode-details h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.episode-item.active .episode-details h4,
.episode-item.active .episode-details p {
    color: white;
}

.episode-details p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.episode-duration {
    align-self: center;
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
}

.episode-item.active .episode-duration {
    color: rgba(255, 255, 255, 0.9);
}

/* Sleep Timer Styles */
.sleep-timer-container {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.sleep-timer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.timer-icon {
    font-size: 1.2rem;
}

.sleep-timer-header h4 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.timer-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timer-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.timer-btn:active {
    transform: translateY(0);
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

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

#timer-countdown {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.timer-cancel-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .now-playing {
        flex-direction: column;
    }

    #episode-image {
        width: 100%;
        height: 200px;
    }

    .episode-item {
        flex-direction: column;
    }

    .episode-item img {
        width: 100%;
        height: 150px;
    }

    .timer-presets {
        gap: 8px;
    }

    .timer-btn {
        min-width: 60px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}
