:root {
    --primary-color: #008080;
    --primary-dark: #006666;
    --primary-light: #00a0a0;
    --accent-color: #20b2aa;
    --background: #f0f8f8;
    --surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Notification Banner */
.notification-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--accent-color);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
}

.notification-banner:not(.hidden) {
    transform: translateY(0);
}

.notification-banner button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Sticky Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
}

.sticky-header.visible {
    transform: translateY(0);
}

.mini-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-control {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.mini-control:active {
    background: rgba(0,128,128,0.1);
}

.mini-control svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.mini-control.play-pause {
    background: var(--primary-color);
    color: white;
}

.mini-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.mini-progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    width: 0%;
}

.mini-time {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Player Section */
.player-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

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

.header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 8px;
}

.tagline {
    font-size: 1.1em;
    opacity: 0.95;
}

.player-container {
    background: var(--surface);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.episode-info {
    text-align: center;
    margin-bottom: 24px;
}

.episode-info h2 {
    font-size: 1.3em;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

#episode-date {
    color: var(--text-secondary);
    font-size: 0.9em;
}


.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}

.progress-wrapper {
    flex: 1;
    position: relative;
    height: 18px;
    display: flex;
    align-items: center;
}

.progress-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: none;
}

#progress-bar {
    position: absolute;
    width: 100%;
    height: 18px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin: 0;
}

/* Hide the track for all browsers */
#progress-bar::-webkit-slider-runnable-track {
    height: 18px;
    background: transparent;
}

#progress-bar::-moz-range-track {
    height: 18px;
    background: transparent;
}

/* Style the thumb for Webkit browsers */
#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* Style the thumb for Firefox */
#progress-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* Remove Firefox's progress fill since we have our own */
#progress-bar::-moz-range-progress {
    background: transparent;
}

#current-time, #duration {
    font-size: 0.9em;
    color: var(--text-secondary);
    min-width: 45px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin: 32px 0;
}

.control-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.control-btn:active {
    transform: scale(0.95);
    background: rgba(0,128,128,0.1);
}

.control-btn svg {
    fill: currentColor;
}

.control-btn.main-play {
    background: var(--primary-color);
    color: white;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,128,128,0.3);
}

.control-btn.main-play:active {
    background: var(--primary-dark);
}

.control-label {
    font-size: 0.75em;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

.secondary-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
}

.speed-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--background);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    overflow: hidden;
}

.speed-adjust-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 8px 12px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.speed-adjust-btn:active:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.speed-adjust-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.speed-display {
    color: var(--primary-color);
    padding: 8px 12px;
    font-weight: 600;
    min-width: 65px;
    width: 65px;
    text-align: center;
}

/* Episodes Section */
.episodes-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.episodes-title {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-item {
    background: var(--background);
    padding: 14px;
    padding-left: 50px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
}

.episode-item:hover {
    background: rgba(0,128,128,0.05);
    border-color: var(--primary-light);
}

.episode-item:active {
    transform: scale(0.98);
}

.episode-item.active {
    background: rgba(0,128,128,0.08);
    border-color: var(--primary-color);
}

.episode-item h3 {
    font-size: 0.95em;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 500;
}

.episode-item p {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Playing indicator */
.playing-indicator {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.playing-indicator span {
    display: block;
    width: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    animation: playingAnimation 1.2s ease-in-out infinite;
}

.playing-indicator span:nth-child(1) {
    animation-delay: 0s;
    height: 10px;
}

.playing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
    height: 16px;
}

.playing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
    height: 12px;
}

.playing-indicator span:nth-child(4) {
    animation-delay: 0.6s;
    height: 18px;
}

@keyframes playingAnimation {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

.episode-item:not(.active) .playing-indicator {
    display: none;
}

/* News Section */
.news-section {
    padding: 24px 16px;
    background: var(--surface);
}

.news-header {
    font-size: 1.5em;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.news-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    background: var(--background);
    padding: 16px;
    border-radius: 12px;
    border-left: 3px solid var(--accent-color);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-item:active {
    background: var(--border-color);
    transform: scale(0.98);
}

.news-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.news-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.news-time {
    position: relative;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.news-time:hover {
    background: rgba(0,128,128,0.1);
}

.news-time-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

.news-time:active .news-time-tooltip {
    opacity: 1;
}

.news-category {
    background: var(--primary-light);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px 16px;
    margin-top: 40px;
}

.footer p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.95;
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .header h1 {
        font-size: 2em;
    }
    
    .controls {
        gap: 16px;
    }
    
    .control-btn.main-play {
        padding: 12px;
    }
}