/* CSS Reset und Grundlagen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* Theme Variables */
:root {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-color: #1db954;
    --accent-hover: #1ed760;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --player-bg: #ffffff;
    --card-bg: #ffffff;
    --hover-bg: #f8f9fa;
}

.dark-theme {
    /* Dark Theme */
    --bg-primary: #121212;
    --bg-secondary: #181818;
    --bg-tertiary: #282828;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #1db954;
    --accent-hover: #1ed760;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --player-bg: #181818;
    --card-bg: #181818;
    --hover-bg: #282828;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 90px; /* Platz für Player-Bar */
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.back-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle,
.home-btn {
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.theme-toggle:hover,
.home-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.content-grid h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Podcast Grid */
.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.podcast-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.podcast-card:hover {
    background: var(--hover-bg);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
}

.podcast-cover {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.podcast-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.podcast-card:hover .podcast-cover img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.podcast-card:hover .play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.podcast-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.podcast-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Podcast Header */
.podcast-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: center;
}

.podcast-header-cover {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 25px var(--shadow);
}

.podcast-header-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.podcast-header-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

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

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

.episode-item:hover {
    background: var(--hover-bg);
    transform: translateX(4px);
}

.episode-cover {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.episode-item .play-overlay {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

.episode-item:hover .play-overlay {
    opacity: 1;
}

.episode-info {
    flex: 1;
}

.episode-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.episode-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.episode-duration {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Player View */
.player-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.player-cover {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 12px 40px var(--shadow);
}

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

.player-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.player-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--player-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.player-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.current-track-cover {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.current-track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.current-track-info {
    flex: 1;
}

.track-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.track-artist {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.control-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.play-pause-btn {
    background: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.play-pause-btn:hover {
    background: var(--accent-hover);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.time-display {
    color: var(--text-secondary);
    font-size: 0.8rem;
    min-width: 40px;
    text-align: center;
}

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

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.player-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
    justify-content: flex-end;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 80px;
}

.volume-slider input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

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

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.timer-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-options button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.timer-options button:hover {
    background: var(--accent-hover);
}

.timer-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .podcast-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .podcast-header {
        flex-direction: column;
        text-align: center;
    }
    
    .podcast-header-cover {
        width: 150px;
        height: 150px;
    }
    
    .podcast-header-info h2 {
        font-size: 2rem;
    }
    
    .player-bar {
        padding: 0.5rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        height: auto;
    }
    
    .player-left,
    .player-right {
        min-width: auto;
        width: 100%;
    }
    
    .player-center {
        width: 100%;
    }
    
    .progress-container {
        max-width: none;
    }
    
    .volume-container {
        justify-content: center;
    }
    
    .player-view {
        padding: 1rem;
    }
    
    .player-cover {
        width: 250px;
        height: 250px;
    }
    
    .episode-item {
        padding: 0.75rem;
    }
    
    .episode-cover {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .podcast-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .player-cover {
        width: 200px;
        height: 200px;
    }
    
    .podcast-header-cover {
        width: 120px;
        height: 120px;
    }
    
    .app-title {
        font-size: 1.2rem;
    }
    
    .episode-item {
        flex-direction: column;
        text-align: center;
    }
    
    .episode-cover {
        width: 80px;
        height: 80px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.podcast-card,
.episode-item {
    animation: fadeIn 0.3s ease forwards;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

