:root {
    --primary-red: #E81C23;
    --dark-red: #C01418;
    --light-red: #FF2A31;
    --bg-dark: #0F0F0F;
    --bg-card: #1A1A1A;
    --bg-hover: #252525;
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.notification-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.notification-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-red);
}

/* Ko-fi Button */
.kofi-container {
    padding: 1rem 1.5rem 0;
    text-align: center;
}

/* Player Section */
.player-section {
    background: var(--bg-card);
    margin: 1.5rem;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* Back Button */
.back-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.back-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-red);
    color: var(--primary-red);
    transform: translateX(-4px);
}

.back-btn svg {
    transition: transform 0.2s ease;
}

.back-btn:hover svg {
    transform: translateX(-4px);
}

.now-playing {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.episode-artwork {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.episode-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.episode-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Player Controls */
.player-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-bar {
    width: 100%;
}

.progress-bar input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.progress-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-bar input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--light-red);
    transform: scale(1.2);
}

.progress-bar input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.progress-bar input[type="range"]::-moz-range-thumb:hover {
    background: var(--light-red);
    transform: scale(1.2);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.control-btn:hover {
    color: var(--primary-red);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.play-btn {
    background: var(--primary-red);
    color: white;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(232, 28, 35, 0.4);
}

.play-btn:hover {
    background: var(--light-red);
    color: white;
    transform: scale(1.05);
}

.additional-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.small-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.small-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

/* Episodes Section */
.episodes-section {
    margin: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.refresh-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: rotate(90deg);
}

.refresh-btn.spinning {
    animation: spin 1s linear infinite;
    background: var(--primary-red);
    border-color: var(--primary-red);
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: var(--text-secondary);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Episodes List */
.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.episode-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.episode-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.episode-artwork-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.episode-artwork-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-content {
    flex: 1;
    min-width: 0;
}

.episode-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.episode-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.episode-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-play,
.btn-info {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-play:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: scale(1.1);
}

.btn-info:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
    margin-right: 1rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--primary-red);
}

.modal-body {
    padding: 1.5rem;
}

.modal-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.modal-description {
    line-height: 1.6;
    color: var(--text-primary);
}

.modal-description a {
    color: var(--primary-red);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.modal-description a:hover {
    color: var(--light-red);
}

.modal-description p {
    margin-bottom: 1rem;
}

.modal-description ul,
.modal-description ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--light-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 28, 35, 0.4);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .player-section {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .now-playing {
        flex-direction: column;
        text-align: center;
    }
    
    .episode-artwork {
        width: 200px;
        height: 200px;
    }
    
    .control-buttons {
        gap: 1.5rem;
    }
    
    .play-btn {
        width: 64px;
        height: 64px;
    }
    
    .episodes-section {
        margin: 1rem;
    }
    
    .episode-card {
        padding: 0.75rem;
    }
    
    .episode-content h3 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .episode-card {
        flex-wrap: wrap;
    }
    
    .episode-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}
