/* assets/css/style.css - V6: Canvas Visualizer */

:root {
    --bg-dark: #09090b;
    --bg-gradient: radial-gradient(circle at top center, #1e293b 0%, #09090b 100%);
    
    /* Karten & UI */
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
    
    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Farben */
    --primary: #6366f1;       /* Indigo */
    --primary-hover: #4f46e5;
    --accent: #8b5cf6;        /* Violet */
    --neon-glow: 0 0 20px rgba(99, 102, 241, 0.4);
    --danger: #ef4444;
}

/* --- BASIS SETUP --- */
body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding-bottom: 120px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--primary); }

/* --- NAVBAR --- */
.navbar {
    background: transparent;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

/* --- FILTER BAR --- */
.filter-bar {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    width: 100%;
    transition: all 0.3s;
}
.search-input:focus {
    background: rgba(0,0,0,0.5);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    outline: none;
    color: white;
}

/* Favoriten Toggle Button */
.btn-check:checked + .btn-outline-danger {
    background-color: #ef4444;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* --- GRID LAYOUT --- */
.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* --- STATION CARDS --- */
.station-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.station-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5), var(--neon-glow);
}

/* BEREICH 1: BILD */
.card-img-wrapper {
    height: 150px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #000;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.9;
}

.station-card:hover .card-img-top { transform: scale(1.05); opacity: 1; }

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}
.play-overlay i {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.6));
    transform: scale(0.8);
    transition: transform 0.3s;
}
.card-img-wrapper:hover .play-overlay { opacity: 1; }
.card-img-wrapper:hover .play-overlay i { transform: scale(1); }

/* BEREICH 2: BODY */
.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    cursor: default;
}

.card-info-area { cursor: pointer; flex-grow: 1; }

.station-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    height: 3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    color: white;
}

.station-current-song {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 0.8rem;
    min-height: 1.2em;
}

/* Genre Tags */
.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1rem;
}

.genre-badge {
    font-size: 0.65rem;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}
.genre-badge:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* BEREICH 3: ACTION BAR */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.8rem;
    margin-top: auto;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 1.1rem;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
}
.action-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.action-btn.home:hover { color: var(--primary); }
.action-btn.info:hover { color: var(--accent); }

/* Fav Button Animation */
.action-btn.fav:hover { color: var(--danger); transform: scale(1.2); }
.action-btn.fav.active { color: var(--danger); }
.action-btn.fav.active.animating { animation: heart-pop 0.3s ease-out; }

@keyframes heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* --- PAGINATION --- */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
.page-btn.active, .page-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}
.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* --- WEBPLAYER BAR (High End) --- */
#webplayer-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 95%;
    max-width: 1000px;
    
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 1rem 2rem;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#webplayer-bar.active {
    transform: translateX(-50%) translateY(0);
}

/* Player Infos */
#player-logo {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Play Button */
.btn-play-pulse {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s;
    outline: none;
    flex-shrink: 0;
}
.btn-play-pulse:hover { transform: scale(1.05); }
.btn-play-pulse.playing { animation: pulse-glow 2s infinite; }

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* --- CANVAS VISUALIZER --- */
#visualizer-canvas {
    width: 200px;
    height: 40px;
    margin-left: 20px;
    margin-right: 20px;
    display: block;
}

/* --- CUSTOM VOLUME SLIDER --- */
input[type=range] {
    -webkit-appearance: none;
    width: 120px;
    background: transparent;
    height: 30px;
    cursor: pointer;
}
input[type=range]:focus { outline: none; }

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background 0.3s;
}
input[type=range]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transition: transform 0.1s;
}
input[type=range]:hover::-webkit-slider-runnable-track { background: rgba(255, 255, 255, 0.4); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); background: var(--primary); }

input[type=range]::-moz-range-track { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
input[type=range]::-moz-range-thumb { height: 18px; width: 18px; border: none; border-radius: 50%; background: #fff; cursor: pointer; }

#mute-btn { transition: 0.2s; }
#mute-btn:hover { color: white !important; transform: scale(1.1); }

/* --- MODAL --- */
.modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-header { border-bottom: 1px solid rgba(255,255,255,0.05); }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }
.btn-dark.border-secondary {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1) !important;
}
.btn-dark.border-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary) !important;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    #webplayer-bar {
        width: 100%;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        max-height: 80vh;
    }
    #webplayer-bar > div:first-child { width: 100% !important; justify-content: center; text-align: center; }
    #player-logo { display: none !important; }
    #webplayer-bar > div:nth-child(2) { width: 100%; margin: 5px 0; }
    #webplayer-bar > div:last-child { width: 100% !important; justify-content: center; }
    #visualizer-canvas { width: 100%; max-width: 300px; }
    
    .station-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    .card-img-wrapper { height: 130px; }
}