body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

body.dark-mode header {
    background-color: #0f3460;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    flex-grow: 1;
    text-align: center;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    color: white;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.header-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.header-controls input {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    width: 300px;
    max-width: 100%;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

body.dark-mode .header-controls input {
    background-color: #16213e;
    color: #e0e0e0;
    border: 1px solid #444;
}

.header-controls button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: #667eea;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-controls button:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.header-controls button:active {
    transform: translateY(0);
}

body.dark-mode .header-controls button {
    background-color: #764ba2;
}

body.dark-mode .header-controls button:hover {
    background-color: #8b5bb2;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Screen Switching */
.view-screen {
    width: 100%;
    display: none;
}

.view-screen.active-screen {
    display: block;
}

.podcast-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.detail-podcast-artwork {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.podcast-header h2 {
    color: white;
    text-align: center;
    margin: 0;
    font-size: 1.8rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

#episodes-list-container h3 {
    color: white;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.load-more-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.load-more-btn:hover:not(:disabled) {
    background-color: #5568d3;
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

body.dark-mode .load-more-btn {
    background-color: #667eea;
}

body.dark-mode .load-more-btn:hover:not(:disabled) {
    background-color: #5568d3;
}

body.dark-mode .load-more-btn:disabled {
    background-color: #666;
    opacity: 0.6;
}

#podcast-list {
    width: 100%;
    margin: 2rem 0;
}

#podcast-list h2,
#player h2 {
    color: white;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.search-results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.search-result-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

body.dark-mode .search-result-item {
    background: #2a2a2a;
}

.search-result-artwork {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.search-result-title {
    padding: 0.75rem;
    font-size: 0.875rem;
    text-align: center;
    color: #333;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-mode .search-result-title {
    color: #e0e0e0;
}

#episodes {
    list-style: none;
    padding: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

body.dark-mode #episodes {
    background: #2a2a2a;
}

#episodes li {
    margin: 0;
    padding: 1rem;
    cursor: pointer;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease, padding-left 0.2s ease, color 0.3s ease;
}

body.dark-mode #episodes li {
    color: #e0e0e0;
    border-bottom-color: #444;
}

#episodes li:last-child {
    border-bottom: none;
}

#episodes li:hover {
    background-color: #f0f4ff;
    padding-left: 1.5rem;
}

body.dark-mode #episodes li:hover {
    background-color: #3a3a3a;
    padding-left: 1.5rem;
}

#episodes li[style*="color: rgb(153, 153, 153)"],
#episodes li[style*="color: #999"] {
    color: #999;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

body.dark-mode #episodes li[style*="color: rgb(153, 153, 153)"],
body.dark-mode #episodes li[style*="color: #999"] {
    color: #666;
    background-color: #1f1f1f;
}

/* Detail Episodes List (same styling as episodes) */
#detail-episodes {
    list-style: none;
    padding: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: background-color 0.3s ease;
    max-height: none;
}

body.dark-mode #detail-episodes {
    background: #2a2a2a;
}

#detail-episodes li {
    margin: 0;
    padding: 1rem;
    cursor: pointer;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease, padding-left 0.2s ease, color 0.3s ease;
}

body.dark-mode #detail-episodes li {
    color: #e0e0e0;
    border-bottom-color: #444;
}

#detail-episodes li:last-child {
    border-bottom: none;
}

#detail-episodes li:hover {
    background-color: #f0f4ff;
    padding-left: 1.5rem;
}

body.dark-mode #detail-episodes li:hover {
    background-color: #3a3a3a;
    padding-left: 1.5rem;
}

#detail-episodes li[style*="color: rgb(153, 153, 153)"],
#detail-episodes li[style*="color: #999"] {
    color: #999;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

body.dark-mode #detail-episodes li[style*="color: rgb(153, 153, 153)"],
body.dark-mode #detail-episodes li[style*="color: #999"] {
    color: #666;
    background-color: #1f1f1f;
}

#player {
    width: 100%;
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

body.dark-mode #player {
    background: #1a1a1a;
}

#player-container {
    width: 100%;
}

.player-artwork-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.podcast-artwork {
    max-width: 200px;
    max-height: 200px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.current-episode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#episode-title {
    font-size: 1rem;
    font-weight: 500;
    word-break: break-word;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

body.dark-mode .player-controls {
    background: #2a2a2a;
}

.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.play-btn:active {
    transform: scale(0.95);
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-container {
    width: 100%;
}

.timeline {
    position: relative;
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    cursor: pointer;
    overflow: visible;
    transition: background-color 0.3s ease;
}

body.dark-mode .timeline {
    background: #444;
}

.progress {
    position: absolute;
    height: 100%;
    background: linear-gradient(to right, #667eea, #764ba2);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.slider {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: grab;
    left: 0%;
    transition: left 0.1s linear;
}

.slider:hover {
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

.slider:active {
    cursor: grabbing;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    transition: color 0.3s ease;
}

body.dark-mode .time-display {
    color: #aaa;
}

.time-separator {
    margin: 0 2px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.volume-icon {
    font-size: 1.2rem;
}

#volume-slider {
    width: 80px;
    height: 4px;
    cursor: pointer;
    accent-color: #667eea;
}

#audio-player {
    display: none;
}

@media (max-width: 768px) {
    .player-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .play-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .player-info {
        width: 100%;
    }

    .volume-control {
        width: 100%;
        justify-content: space-between;
    }

    #volume-slider {
        flex: 1;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    header input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.75rem;
        display: block;
    }

    header button {
        width: 100%;
        margin-top: 0.5rem;
    }

    main {
        padding: 1rem;
    }

    #episodes {
        max-height: 300px;
    }

    #player {
        padding: 1.5rem;
    }
}