:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --bg-dark: #0a0a0c;
    --glass: rgba(15, 15, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --glow: rgba(0, 242, 254, 0.15);
    --accent-red: rgba(255, 61, 113, 0.96);
    --accent-green: #00ff88;
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

/* Tło z dynamicznym gradientem i obrazem */
.background-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        linear-gradient(135deg, rgba(10,10,12,0.95) 0%, rgba(20,20,30,0.85) 100%),
        url('https://picsum.photos/1920/1080?night') no-repeat center center/cover;
    z-index: -2;
}

.ambient-glow {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw; height: 80vh;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Kontener główny - Szklany design */
.app-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.radio-container {
    width: 100%;
    max-width: 900px;
    height: 600px;
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    grid-template-rows: 1fr;
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), 0 0 20px var(--glow);
    overflow: visible;
    position: relative;
    z-index: 10;
}

/* Zakładki Radio/Podcast - Przeniesione na prawą stronę */
.tabs-nav {
    position: absolute;
    top: -50px;
    right: 40px;
    display: flex;
    gap: 15px;
    z-index: 5;
}

.tab-btn {
    padding: 12px 18px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    cursor: pointer;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
}

.tab-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.tab-btn:hover {
    transform: translateY(0);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    transform: translateY(0);
    color: var(--primary);
    background: rgba(10, 10, 12, 0.8);
    border-top: 2px solid var(--primary);
    box-shadow: 0 -10px 20px rgba(0, 242, 254, 0.1);
}

/* Efekt świetlny wokół całej ramki - czerwona łuna */
.top-glow-effect {
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 42px;
    box-shadow: 0 0 30px 4px var(--accent-red);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.08s ease-out;
}

/* Lewy panel - Player */
.player-panel {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--glass-border);
    border-top-left-radius: 40px;
    border-bottom-left-radius: 40px;
    width: 350px;
    max-width: 350px;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

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

.brand-dot {
    width: 12px; height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary);
}

.brand h1 {
    font-size: 1.2rem; margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: 2px;
}

.now-playing-info {
    text-align: left;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 290px;
    max-width: 290px;
    min-width: 0;
    box-sizing: border-box;
    flex-grow: 1;
}

/* Obniżone logo - wyśrodkowane idealnie pomiędzy nazwą stacji a przyciskami play/głośności */
.current-station-logo {
    width: 280px;
    height: 280px;
    aspect-ratio: 1/1;
    border-radius: 16px;
    object-fit: contain;
    object-position: center;
    background: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
    display: none;
    animation: fadeIn 0.5s ease forwards;
    margin: auto 0;
    padding: 0;
    box-sizing: border-box;
}

/* Dyskretny napis pod kontrolkami odtwarzacza na tle wodospadu */
/* Dyskretny napis pod kontrolkami odtwarzacza na tle wodospadu */
.track-info-overlay {
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    width: 100%;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
    pointer-events: none;
    height: 18px;
}

.track-info-inner {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    text-align: center;
}

.track-info-inner.marquee-mode {
    text-align: left;
}

.track-info-inner.slide-in-up {
    animation: trackSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.track-info-inner.slide-out-up {
    animation: trackSlideOutUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.track-info-text {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: linear-gradient(to right, #ffffff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    will-change: transform;
}

.track-info-text.marquee {
    animation: trackMarquee var(--marquee-duration, 12s) ease-in-out infinite;
}

@keyframes trackMarquee {
    0%, 15% {
        transform: translateX(0);
    }
    45%, 60% {
        transform: translateX(var(--marquee-distance, 0));
    }
    90%, 100% {
        transform: translateX(0);
    }
}

@keyframes trackSlideUp {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trackSlideOutUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.now-playing-label {
    font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0px;
}

.current-station-container {
    width: 290px;
    max-width: 290px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    line-height: 1.2;
    box-sizing: border-box;
}

#current-station {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    display: inline-block;
    will-change: transform;
}

#current-station.marquee {
    animation: stationMarquee var(--station-marquee-duration, 10s) ease-in-out infinite;
}

@keyframes stationMarquee {
    0%, 15% {
        transform: translateX(0);
    }
    45%, 60% {
        transform: translateX(var(--station-marquee-distance, 0));
    }
    90%, 100% {
        transform: translateX(0);
    }
}

/* Panel odtwarzacza w 100% przezroczysty - brak kreski oddzielającej od logo */
.player-controls {
    margin-top: auto;
    padding: 15px 0 20px 0;
    border-top: none;
    background: transparent; 
    position: relative;
}

/* Pasek postępu podcastu - Rozciągnięty na całą szerokość ramki */
.podcast-progress-container {
    position: absolute;
    bottom: -45px;
    left: 40px;
    right: 40px;
    width: auto;
    z-index: 100;
    box-sizing: border-box;
    animation: fadeIn 0.4s ease;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--primary);
    margin-bottom: 5px;
    font-family: monospace;
    font-weight: bold;
}

.progress-slider {
    width: 100%;
    -webkit-appearance: none;
    background: rgba(0, 242, 254, 0.1);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #FFD700;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-top: -4px;
}

.progress-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #FFD700;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.progress-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(0, 242, 254, 0.2);
    border-radius: 3px;
}

/* Niestandardowe kontrolki audio (żółte) */
.custom-player {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.play-toggle {
    background: none;
    border: none;
    color: #FFD700; /* Jasny żółty */
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: transform 0.2s, filter 0.2s;
}

.play-toggle:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
}

.play-toggle svg {
    width: 40px;
    height: 40px;
}

/* Suwak głośności */
.vol-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    outline: none;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #FFD700;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #FFD700;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Prawy panel - Lista */
.list-panel {
    padding: 40px;
    padding-bottom: 60px; /* Dodatkowy margines na pasek postępu podcastu */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
}

.list-panel h2 {
    font-size: 1.5rem; margin-top: 0; margin-bottom: 30px; font-weight: 600;
}

#station-list, #podcast-list, #search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: none; /* Ukrywa pasek w Firefox */
    -ms-overflow-style: none; /* Ukrywa pasek w starszych wersjach IE/Edge */
    
    /* Dodane właściwości: */
    flex-grow: 1;
    min-height: 0;
}

#station-list::-webkit-scrollbar, #podcast-list::-webkit-scrollbar, #search-results-list::-webkit-scrollbar {
    width: 4px;
}

#station-list::-webkit-scrollbar-thumb, #podcast-list::-webkit-scrollbar-thumb, #search-results-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.station-item, .podcast-item, .podcast-channel-item, .search-result-item {
    padding: 10px 20px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.station-item:hover, .podcast-item:hover, .podcast-channel-item:hover, .search-result-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(8px);
    border-color: var(--glass-border);
}

.station-item.active, .podcast-item.active, .podcast-channel-item.active, .search-result-item.active {
    background: linear-gradient(90deg, rgba(79, 172, 254, 0.15), transparent);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.1);
}

.station-logo, .podcast-cover, .search-logo {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    object-fit: contain;
    object-position: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    padding: 4px;
    box-sizing: border-box;
}

.station-details, .podcast-details, .search-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.station-name {
    font-weight: 400;
    font-size: 1rem;
}

.podcast-title, .search-name {
    font-weight: 300 !important;
    font-size: 1rem;
}

.station-status, .podcast-author, .search-provider {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.save-btn, .back-btn-icon, .delete-btn, .update-btn, .mode-btn {
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.8;
    padding: 0;
    flex-shrink: 0;
}

.delete-btn {
    background: var(--accent-red);
    color: white;
}

.update-btn {
    background: var(--accent-green);
    color: var(--bg-dark);
}

.mode-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border: 1px solid var(--glass-border);
}

.mode-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
    opacity: 1;
    box-shadow: 0 0 15px var(--primary);
}

.save-btn:hover, .back-btn-icon:hover, .delete-btn:hover, .update-btn:hover, .mode-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 15px var(--primary);
}

.delete-btn:hover {
    box-shadow: 0 0 15px var(--accent-red);
}

.update-btn:hover {
    box-shadow: 0 0 15px var(--accent-green);
}

.back-btn-container {
    padding: 10px 5px;
    list-style: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(10px);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.podcast-modes {
    display: flex;
    gap: 8px;
    margin-right: 5px;
}

.search-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-left: 5px;
}

.search-type-selector label {
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    transition: color 0.2s;
}

.search-type-selector input {
    accent-color: var(--primary);
}

.search-type-selector input:checked + span {
    color: var(--primary);
    font-weight: 600;
}

#search-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 12px 20px;
    color: white;
    outline: none;
}

#search-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

#search-trigger {
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#search-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary);
}

#search-trigger svg {
    width: 18px;
    height: 18px;
}


.search-results-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.back-btn {
    padding: 8px 15px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    width: fit-content;
}

/* Wizualizator */
#audio-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}

@media (max-width: 768px) {
    #bg-canvas {
        display: none !important;
    }
    body, html { overflow: auto; height: auto; }
    .app-wrapper { 
        height: auto; 
        min-height: 100vh; 
        padding: 80px 15px 30px 15px; /* Dodano miejsce na zakładki */
    }
    .radio-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        border-radius: 24px;
        overflow: visible;
    }
    .tabs-nav {
        top: -55px; /* Pozycjonowanie nad ramkę */
        left: 50%;
        right: auto;
        transform: translateX(-50%); /* Centrowanie zakładek */
        width: max-content;
        display: flex;
        gap: 10px;
        z-index: 1000;
    }
    .tab-btn {
        padding: 10px 15px;
        transform: translateY(15px); /* Delikatne wpuszczenie w ramkę dla efektu głębi */
    }
    .tab-btn.active {
        transform: translateY(5px);
    }
    .tab-btn svg {
        width: 24px;
        height: 24px;
    }
    .player-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 30px;
        border-radius: 24px 24px 0 0;
    }
    .now-playing-info {
        width: 100%;
        max-width: 290px;
        margin-left: auto;
        margin-right: auto;
    }
    .current-station-container {
        width: 100%;
        max-width: 290px;
    }
    .current-station-logo {
        width: 100%;
        max-width: 290px;
        height: auto;
        aspect-ratio: 1/1;
        margin: 15px auto;
    }
    .list-panel {
        border-radius: 0 0 24px 24px;
        padding: 20px;
        height: 400px;
        padding-bottom: 60px;
    }
    .podcast-progress-container {
        bottom: -35px;
        left: 20px;
        right: 20px;
    }
    #station-list, #podcast-list, #search-results-list {
        -webkit-overflow-scrolling: touch;
    }
    #current-station {
        font-size: 1.5rem;
    }
    #audio-visualizer { height: 100px; }
    .top-glow-effect { display: none; }
}





/* Kontener główny układający pasek i przycisk w jednej linii */
.search-header {
    display: flex;
    gap: 10px; /* Odstęp między paskiem a przyciskiem */
    margin-bottom: 15px;
    align-items: center;
}

/* Pasek z listą i polem tekstowym */
.integrated-search-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    flex-grow: 1; /* Pozwala paskowi zająć całe wolne miejsce */
}

.integrated-search-bar #search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    flex-grow: 1;
    padding: 10px 15px;
    font-size: 1.1rem;
}

.integrated-search-bar #search-type-select {
    background-color: #0a0a0a; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300f2fe' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: var(--primary);
    border: none;
    border-right: 1px solid var(--glass-border);
    padding: 10px 28px 10px 12px;
    outline: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.integrated-search-bar #search-type-select option {
    background: #000;
    color: var(--text-main);
}





#search-results-list {
    max-height: 50vh; /* Ogranicza wysokość, aby włączyć scrollowanie (możesz dostosować tę wartość) */
    overflow-y: auto; /* Włącza przewijanie */

    /* Ukrywanie paska dla przeglądarki Firefox */
    scrollbar-width: none;

    /* Ukrywanie paska dla przeglądarki IE i Edge */
    -ms-overflow-style: none;
}

/* Ukrywanie paska dla przeglądarki Chrome, Safari i Opera */
#search-results-list::-webkit-scrollbar {
    display: none;
}

/* SPINNER / LOADING STATE */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    width: 100%;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(0, 242, 254, 0.15);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

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