/* =========================================== */
/* RESET & BASE STYLES */
/* =========================================== */

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

:root {
    /* FUNDALURI - Ierarhie de profunzime */
    --bg: #ffffff;                      /* Fundal principal */
    --surface: #f5f7fa;                 /* Suprafețe (carduri, liste) */
    --surface-elevated: #e8ecf2;        /* Suprafețe (hover, active) */

    /* CULORI PRIMARE & STĂRI */
    --primary: #007aff;                 /* Acțiuni principale */
    --primary-light: rgba(0, 122, 255, 0.1);  /* Background stări primare */

    /* STĂRI DE SISTEM - culori mai vibrante */
    --success: #2ecc71;                 /* Verde mai vibrant */
    --success-light: rgba(46, 204, 113, 0.15); /* Background playing */
    --warning: #f39c12;                 /* Portocaliu mai vizibil */
    --warning-light: rgba(243, 156, 18, 0.15); /* Background paused */
    --danger: #e74c3c;                  /* Roșu mai intens */
    --danger-light: rgba(231, 76, 60, 0.15);   /* Background error */
    --selected: #3498db;                /* Albastru deschis pentru selected */
    --selected-light: rgba(52, 152, 219, 0.15);/* Background selected */

    /* TEXT - mai bine contrastat */
    --text: #2c3e50;                    /* Text principal mai închis */
    --text-secondary: #7f8c8d;          /* Text secundar */
    --text-tertiary: #bdc3c7;           /* Text terțiar/placeholder */

    /* BORDERS */
    --border: #d5d9e0;                  /* Border normal */
    --border-emphasis: #a0aec0;         /* Border accentuat */

    /* UMBRE - ajustate pentru noul contrast */
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-elevated: 0 4px 20px rgba(0,0,0,0.12);

    /* ALTELE */
    --radius: 12px;
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);

    /* VARIABILE RGB (pentru rgba) */
    --bg-rgb: 255, 255, 255;
    --surface-rgb: 245, 247, 250;
    --primary-rgb: 0, 122, 255;
    --success-rgb: 46, 204, 113;
    --warning-rgb: 243, 156, 18;
    --danger-rgb: 231, 76, 60;
    --selected-rgb: 52, 152, 219;
    --border-rgb: 213, 217, 224;
}

[data-theme="dark"] {
    /* FUNDALURI - Întunecate */
    --bg: #0d1117;                      /* Fundal principal întunecat */
    --surface: #161b22;                 /* Suprafețe */
    --surface-elevated: #21262d;        /* Suprafețe 2 */

    /* CULORI PRIMARE & STĂRI */
    --primary: #58a6ff;                 /* Albastru mai deschis pentru dark */
    --primary-light: rgba(88, 166, 255, 0.15);

    /* STĂRI DE SISTEM */
    --success: #2ea043;                 /* Verde mai puțin saturat */
    --success-light: rgba(46, 160, 67, 0.25);
    --warning: #d29922;                 /* Galben-portocaliu */
    --warning-light: rgba(210, 153, 34, 0.25);
    --danger: #f85149;                  /* Roșu mai cald */
    --danger-light: rgba(248, 81, 73, 0.25);
    --selected: #79c0ff;                /* Albastru deschis */
    --selected-light: rgba(121, 192, 255, 0.25);

    /* TEXT */
    --text: #f0f6fc;                    /* Text alb cu nuanță albastru */
    --text-secondary: #8b949e;
    --text-tertiary: #484f58;

    /* BORDERS */
    --border: #30363d;
    --border-emphasis: #484f58;

    /* UMBRE */
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-elevated: 0 4px 20px rgba(0,0,0,0.4);

    /* VARIABILE RGB */
    --bg-rgb: 13, 17, 23;
    --surface-rgb: 22, 27, 34;
    --primary-rgb: 88, 166, 255;
    --success-rgb: 46, 160, 67;
    --warning-rgb: 210, 153, 34;
    --danger-rgb: 248, 81, 73;
    --selected-rgb: 121, 192, 255;
    --border-rgb: 48, 54, 61;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
    height: 100vh;
    overflow: hidden;
}

a {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

/* Hover state pentru toate linkurile */
a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: var(--primary);
}

/* Dark theme pentru toate linkurile */
[data-theme="dark"] a {
    color: var(--primary);
}

[data-theme="dark"] a:hover {
    color: var(--primary);
}

/* Responsive pentru toate linkurile */
@media (max-width: 768px) {
    a {
        font-size: 13px;
    }
}

.app {
    max-width: 100%;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app.mplayer-active {
    padding-bottom: calc(100px + var(--safe-area-inset-bottom));
    transition: padding-bottom 0.3s ease;
}

/* =========================================== */
/* UTILITY & HELPER CLASSES */
/* =========================================== */

.stations-container:has(#empty-state:not([style*="display: none"])) {
    display: none !important;
}

.stations-content:has(#empty-state:not([style*="display: none"])) {
    display: none !important;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.touch-feedback:active {
    opacity: 0.7;
}

/* =========================================== */
/* HEADER SECTION */
/* =========================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-left h1 {
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left i {
    color: var(--primary);
}

.header-title {
    color: var(--text-secondary);
}

.header-logo {
    height: 50px;
    color: var(--text);
    margin-right: 12px;
    margin-bottom: 9px;
    vertical-align: middle;
}

/* Pentru mobil - dimensiuni mai mici */
@media (max-width: 768px) {
    .header-logo {
        height: 43px;
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 34px;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    .header-title {
        display: none;
    }
}

#home-btn {
    cursor: pointer;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* =========================================== */
/* ICON BUTTONS */
/* =========================================== */

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--surface-elevated);
}

@media (hover: hover) {
    .icon-btn:hover {
        background: var(--surface-elevated);
    }
    [data-theme="dark"] .icon-btn:hover {
        background: var(--surface-elevated);
    }
}

/* =========================================== */
/* SEARCH BAR */
/* =========================================== */

.search-bar {
    display: none;
    padding: 12px 16px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
}

.search-bar.active {
    display: flex;
}

#search-input {
    flex: 1;
    height: 40px;
    padding: 0 80px 0 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    outline: none;
    width: 100%;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

#clear-search {
    position: absolute;
    right: 75px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#clear-search.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#clear-search:active {
    background: var(--surface);
}

#close-search {
    position: relative;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

#close-search:active {
    background: var(--border);
}

@media (hover: hover) {
    #close-search:hover {
        background: var(--surface);
    }
    [data-theme="dark"] #close-search:hover {
        background: var(--surface);
    }
}

/* =========================================== */
/* FILTERS SECTION */
/* =========================================== */

.filters-section {
    padding: 12px 16px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: none;
    animation: slideDown 0.3s ease;
}

.filters-section.active {
    display: block;
}

.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row:nth-child(3) {
    display: flex;
    gap: 8px;
}

.filter-select {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-select:focus {
    border-color: var(--primary);
}

.filter-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-select option {
    white-space: normal;
    padding: 8px;
    min-height: 36px;
    display: flex;
    align-items: center;
}

#search-input.active,
.filter-select.active {
    border-color: var(--primary) !important;
}

/* Clear filters */
#clear-filters.active {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger);
    animation: pulseWarning 2s infinite;
    transition: all 0.3s ease;
}

#clear-filters.active:hover {
    background: color-mix(in srgb, var(--danger) 80%, white);
    animation: none; /* Oprește animația la hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--danger-rgb), 0.4);
}

@keyframes pulseWarning {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--danger-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(var(--danger-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--danger-rgb), 0);
    }
}

#clear-filters {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    color: var(--text);
    border: none;
    border-radius: 50%;
    transition: background 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

#clear-filters:active {
    background: var(--surface);
}

/* Filter active states for dark theme */
[data-theme="dark"] #search-input.active,
[data-theme="dark"] .filter-select.active {
    border-color: var(--primary) !important;
    background: rgba(210, 153, 34, 0.12);
}

[data-theme="dark"] #clear-filters.active {
    background: var(--danger);
    color: white;
}

/* =========================================== */
/* OPTIONS BAR */
/* =========================================== */

.options-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow: hidden;
}

.sort-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.sort-header i {
    color: var(--text);
}

.sort-select {
    flex: 1;
    min-width: 0;
    max-width: 200px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    transition: border-color 0.2s;
}

.sort-select.active {
    border-color: var(--warning) !important;
    background-color: rgba(243, 156, 18, 0.08);
}

[data-theme="dark"] .sort-select.active {
    border-color: var(--warning) !important;
    background: rgba(210, 153, 34, 0.15);
}

/* =========================================== */
/* SOCIAL ACCOUNTS */
/* =========================================== */

.social-accounts {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-elevated);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    border-color: var(--primary);
}

.social-link:active {
    transform: translateY(0);
}

.social-link i {
    font-size: 18px;
}

.social-accounts a {
   text-decoration: none;
}

.social-link[title="VK"] {
   color: #4c75a3;
}
[data-theme="dark"] .social-link[title="VK"] {
   color: #4c75a3;
}
.social-link[title="VK"]:hover {
    color: white;
    background: #4c75a3;
    border-color: #4c75a3;
}

.social-link[title="Telegram"] {
   color: #0088cc;
}
[data-theme="dark"] .social-link[title="Telegram"] {
   color: #0088cc;
}
.social-link[title="Telegram"]:hover {
    color: white;
    background: #0088cc;
    border-color: #0088cc;
}

[data-theme="dark"] .social-link {
    background: var(--surface-elevated);
    color: var(--text);
}

[data-theme="dark"] .social-link:hover {
    color: white;
}

/* =========================================== */
/* STATIONS COUNT */
/* =========================================== */

.stations-count {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    line-height: 1.4;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}

.stations-count:empty {
    display: none !important;
}

.stations-count .count-text {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.stations-count .separator {
    color: var(--border);
    margin: 0 2px;
    flex-shrink: 0;
}

.stations-count .recent-updates {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stations-count .recent-updated-stations {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.stations-count .recent-updates .more-details-link {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-block;
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    transition: all 0.2s ease;
}

.stations-count .recent-updates .more-details-link:hover {
    background: rgba(var(--primary-rgb), 0.2);
    text-decoration: underline;
}

[data-theme="dark"] .stations-count .recent-updates .more-details-link {
    background: rgba(var(--primary-rgb), 0.2);
}

[data-theme="dark"] .stations-count .recent-updates .more-details-link:hover {
    background: rgba(var(--primary-rgb), 0.3);
}

/* =========================================== */
/* STATIONS CONTENT */
/* =========================================== */

.stations-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.stations-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--bg);
}

.stations-list {
    flex: 1;
    padding: 16px 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    min-height: 0;
}

/* =========================================== */
/* STATION ITEM */
/* =========================================== */

.station-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    user-select: none;
    flex-shrink: 0;
    color: var(--text);
    position: relative;
}

/* HOVER STATE */
@media (hover: hover) {
    .station-item:hover:not(.selected):not(.playing):not(.paused):not(.error) {
        background: var(--surface-elevated);
        border-color: var(--border-emphasis);
        transform: translateY(-1px);
        box-shadow: var(--shadow);
    }
}

[data-theme="dark"] .station-item {
    border-color: var(--border);
}

/* STĂRI SPECIALE */
.station-item.selected {
    border-left: 5px solid var(--selected);
    background: var(--selected-light);
    border-color: rgba(var(--selected-rgb), 0.3);
    box-shadow: 0 2px 8px rgba(var(--selected-rgb), 0.1);
}

.station-item.playing {
    border-left: 5px solid var(--success);
    background: var(--success-light);
    border-color: rgba(var(--success-rgb), 0.3);
    box-shadow: 0 2px 8px rgba(var(--success-rgb), 0.1);
}

.station-item.paused {
    border-left: 5px solid var(--warning);
    background: var(--warning-light);
    border-color: rgba(var(--warning-rgb), 0.3);
    box-shadow: 0 2px 8px rgba(var(--warning-rgb), 0.1);
}

.station-item.error {
    border-left: 5px solid var(--danger);
    background: var(--danger-light);
    border-color: rgba(var(--danger-rgb), 0.3);
    box-shadow: 0 2px 8px rgba(var(--danger-rgb), 0.1);
}

/* TEMA ÎNTUNECATĂ */
[data-theme="dark"] .station-item.selected {
    background: var(--selected-light);
    border-color: rgba(var(--selected-rgb), 0.4);
    box-shadow: 0 2px 10px rgba(var(--selected-rgb), 0.2);
}

[data-theme="dark"] .station-item.playing {
    background: var(--success-light);
    border-color: rgba(var(--success-rgb), 0.4);
    box-shadow: 0 2px 10px rgba(var(--success-rgb), 0.2);
}

[data-theme="dark"] .station-item.paused {
    background: var(--warning-light);
    border-color: rgba(var(--warning-rgb), 0.4);
    box-shadow: 0 2px 10px rgba(var(--warning-rgb), 0.2);
}

[data-theme="dark"] .station-item.error {
    background: var(--danger-light);
    border-color: rgba(var(--danger-rgb), 0.4);
    box-shadow: 0 2px 10px rgba(var(--danger-rgb), 0.2);
}

/* ELEMENTE INTERNE STATION ITEM */
.station-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.station-details {
    flex: 1;
    min-width: 0;
}

.station-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.station-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.station-meta i {
    font-size: 11px;
}

.station-fav {
    padding: 8px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.station-fav.active {
    color: var(--warning);
}

.station-fav:hover {
    opacity: 1 !important;
    color: var(--warning) !important;
    transform: scale(1.1) !important;
}

/* =========================================== */
/* LOADING & EMPTY STATES */
/* =========================================== */

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    color: var(--text-secondary);
    gap: 16px;
    flex: 1;
}

.loading.active {
    display: flex;
}

.loading i {
    font-size: 32px;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    color: var(--text-secondary);
    flex: 1;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* =========================================== */
/* PLAYER (MPLAYER) */
/* =========================================== */

.mplayer {
    position: fixed;
    bottom: 5px;
    background: var(--bg);
    border-top: 3px solid var(--primary);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    padding-bottom: calc(14px + var(--safe-area-inset-bottom));

    transform: translateY(calc(100% + 15px));

    transition: transform 0.3s ease;
    z-index: 90;
    flex-shrink: 0;
    border-radius: 15px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(var(--primary-rgb), 0.1);
}

.mplayer.active {
    transform: translateY(0);
    animation: playerGlow 2s infinite alternate;
}

/* Mobile default (default) */
.mplayer {
    left: 16px;
    right: 16px;
    width: auto;
}

/* Tablete și desktop */
@media (min-width: 768px) {
    .app {
        max-width: 768px;
        margin: 0 auto;
        height: 100vh;
    }

    .mplayer {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%) translateY(calc(100% + 15px));
        width: calc(100% - 32px);
        margin: 0 auto;
    }

    .mplayer.active {
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile mici (sub 480px) */
@media (max-width: 480px) {
    .mplayer {
        left: 12px;
        right: 12px;
    }
}

@keyframes playerGlow {
    from {
        border-top-color: var(--primary);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2),
                    0 0 20px rgba(var(--primary-rgb), 0.1);
    }
    to {
        border-top-color: color-mix(in srgb, var(--primary) 80%, white);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25),
                    0 0 25px rgba(var(--primary-rgb), 0.15);
    }
}

.mplayer-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.mplayer .station-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mplayer .station-status {
    font-size: 14px;
    font-weight: 500;
}

/* Pentru dark theme */
[data-theme="dark"] .mplayer {
    background: var(--bg);
    border-top: 5px solid var(--primary);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(var(--primary-rgb), 0.2);
}

[data-theme="dark"] .mplayer.active {
    animation: playerGlowDark 2s infinite alternate;
}

@keyframes playerGlowDark {
    from {
        border-top-color: var(--primary);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6),
                    0 0 20px rgba(var(--primary-rgb), 0.2);
    }
    to {
        border-top-color: color-mix(in srgb, var(--primary) 70%, white);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7),
                    0 0 30px rgba(var(--primary-rgb), 0.3);
    }
}

.station-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.station-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.station-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.station-status {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.station-status.playing,
.station-status.external-player {
    color: var(--primary);
}

.station-status.error {
    color: var(--danger) !important;
}

[data-theme="dark"] .station-status.error {
    color: #ff6b6b !important;
}

.player-controls {
    flex-shrink: 0;
}

.station-icon-small {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.station-icon-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

/* =========================================== */
/* PLAY BUTTON */
/* =========================================== */

.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent);
    font-size: 30px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Playing state */
.play-btn.playing {
    color: var(--danger) !important;
    border-color: color-mix(in srgb, var(--danger) 50%, transparent) !important;
}

/* Hover state */
@media (hover: hover) {
    .play-btn:hover:not(:disabled) {
        background: color-mix(in srgb, currentColor 10%, transparent);
        transform: translateY(-1px);
    }
}

.play-btn:active:not(:disabled) {
    transform: scale(0.96);
}

/* =========================================== */
/* FAVORITE BUTTON IN PLAYER */
/* =========================================== */

.station-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

#station-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

.station-name-with-favorite {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#player-favorite-btn {
    margin-right: 0 !important;
    order: 2;
}

.player-favorite-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-radius: 50% !important;
    opacity: 0.9 !important;
}

.player-favorite-btn:hover {
    opacity: 1 !important;
    color: var(--warning) !important;
    transform: scale(1.1) !important;
}

.player-favorite-btn.active {
    color: var(--warning) !important;
    opacity: 1 !important;
}

/* =========================================== */
/* PAGINATION */
/* =========================================== */

.pagination-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
    margin-top: 8px;
    animation: fadeInUpButton 0.4s ease-out 0.1s both;
}

/* =========================================== */
/* LOAD MORE BUTTON */
/* =========================================== */

.load-more-btn {
    padding: 14px 24px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 2px solid rgba(var(--primary-rgb), 0.3);
    color: var(--primary);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    touch-action: manipulation;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.load-more-btn:hover:not(:disabled) {
    border-color: var(--primary);
    box-shadow:
        0 6px 20px rgba(var(--primary-rgb), 0.25),
        0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.load-more-btn:active:not(:disabled) {
    box-shadow: 0 3px 10px rgba(var(--primary-rgb), 0.2);
}

/* Dark theme */
[data-theme="dark"] .load-more-btn {
    background: rgba(var(--primary-rgb), 0.15);
    border: 2px solid rgba(var(--primary-rgb), 0.4);
    color: var(--primary);
}

[data-theme="dark"] .load-more-btn:hover:not(:disabled) {
    box-shadow:
        0 6px 25px rgba(var(--primary-rgb), 0.35),
        0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

/* =========================================== */
/* BTT LINK */
/* =========================================== */

.back-to-top-link {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1.4;
}

.back-to-top-link i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.back-to-top-link:hover {
    background: rgba(var(--primary-rgb), 0.2);
    text-decoration: underline;
    text-underline-offset: 3px;
    color: var(--primary);
    transform: translateY(-1px);
}

.back-to-top-link:hover i {
    transform: translateY(-1px);
}

.back-to-top-link:active {
    transform: translateY(0);
}

.back-to-top-link:active i {
    transform: translateY(0);
}

.back-to-top-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Dark theme */
[data-theme="dark"] .back-to-top-link {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
}

[data-theme="dark"] .back-to-top-link:hover {
    background: rgba(var(--primary-rgb), 0.3);
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .back-to-top-link {
        font-size: 13px;
        padding: 5px 10px;
        gap: 5px;
    }

    .back-to-top-link i {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .back-to-top-link {
        font-size: 13px;
        padding: 4px 8px;
        border-radius: 8px;
    }

    .back-to-top-link span {
        display: none;
    }

    .back-to-top-link i {
        font-size: 14px;
        margin: 0;
    }
}

.pagination-container .back-to-top-link {
    margin-top: 8px;
    animation: fadeInUpButton 0.4s ease-out 0.1s both;
}

/* =========================================== */
/* TOAST NOTIFICATIONS */
/* =========================================== */

.toast {
    position: fixed;
    bottom: 115px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1100;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================== */
/* SIDE MENU */
/* =========================================== */

.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: var(--bg);
    border-left: 1px solid var(--border);
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-area-inset-top, 0);
}

.side-menu.active {
    right: 0;
}

.menu-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.menu-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.menu-items {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.menu-item {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    touch-action: manipulation;
    user-select: none;
}

.menu-item:active {
    background: var(--surface-elevated);
    transform: translateY(1px);
}

.menu-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

@media (hover: hover) {
    .menu-item {
        border-left: 3px solid transparent;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    .menu-item:hover {
        background: linear-gradient(
            90deg,
            rgba(var(--primary-rgb), 0.08) 0%,
            rgba(var(--primary-rgb), 0.04) 50%,
            transparent 100%
        );
        border-left: 4px solid var(--primary);
        padding-left: 24px;
        transform: translateX(4px);
    }

    .menu-item:hover i {
        color: var(--primary);
    }

    /* Tema întunecată */
    [data-theme="dark"] .menu-item:hover {
        background: linear-gradient(
            90deg,
            rgba(var(--primary-rgb), 0.18) 0%,
            rgba(var(--primary-rgb), 0.09) 50%,
            transparent 100%
        );
        border-left: 4px solid var(--primary);
    }
}

.menu-footer {
    color: var(--text-secondary);
    padding: 16px 20px;
    margin-top: auto;
    border-top: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    font-size: 14px;
}

.menu-copyright {
    opacity: 0.9;
    margin-bottom: 4px;
    font-weight: 400;
    letter-spacing: 0.2px;
    font-size: 12.5px;
}

.menu-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.9;
    transition: all 0.2s ease;
    display: block;
    border-radius: 4px;
}

.menu-footer a:hover {
    opacity: 1;
    color: var(--primary);
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.menu-footer a:active {
    transform: translateY(1px);
}

[data-theme="dark"] .menu-footer a:hover {
    color: var(--primary);
}

/* =========================================== */
/* MODAL - DYNAMIC */
/* =========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .modal {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: var(--radius);
    width: 95vw;
    max-width: 600px;
    min-width: 300px;
    max-height: 85vh;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    margin: 20px auto;
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

[data-theme="dark"] .modal-content {
    background: rgba(var(--bg-rgb), 0.95);
    border: 1px solid rgba(var(--border-rgb), 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98vw;
        max-height: 90vh;
        margin: 10px auto;
        border-radius: calc(var(--radius) * 0.8);
    }

    .modal {
        padding: 15px;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    [data-theme="dark"] .modal {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

@media (min-width: 768px) {
    .modal-content {
        width: 90vw;
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .modal-content {
        width: auto;
        max-width: 700px;
    }
}

.modal-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}

[data-theme="dark"] .modal-header {
    background: rgba(var(--surface-rgb), 0.8);
    border-bottom: 1px solid rgba(var(--border-rgb), 0.4);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

[data-theme="dark"] .modal-body {
    background: rgba(var(--bg-rgb), 0.9);
}

/* =========================================== */
/* HTTP STREAM MODAL */
/* =========================================== */

#http-stream-modal.modal {
    align-items: flex-start;
    padding-top: 15px;
}

#http-stream-modal .modal-content {
    max-width: 520px;
    width: 100%;
    animation: modalSlideDown 0.3s ease-out;
    margin-top: 20px;
}

.http-stream-warning {
    padding: 16px;
    background: rgba(var(--warning-rgb), 0.1);
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    margin-bottom: 24px;
}

.http-stream-warning p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.http-stream-info {
    margin-bottom: 28px;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    font-size: 16px;
    align-items: flex-start;
}

.info-row strong {
    min-width: 80px;
    color: var(--text-secondary);
    margin-right: 16px;
    font-weight: 600;
}

.info-row span {
    color: var(--text);
    font-weight: 600;
    flex: 1;
}

.info-row:last-child {
    flex-direction: column;
    align-items: flex-start;
}

.info-row:last-child strong {
    margin-bottom: 6px;
}

.stream-url {
    font-family: monospace;
    font-size: 13px;
    background: var(--surface);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    word-break: break-all;
    user-select: all;
    cursor: text;
    line-height: 1.4;
    width: 100%;
    margin-top: 4px;
}

.http-stream-options {
    margin-bottom: 24px;
}

.http-stream-options > p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    color: var(--text);
    gap: 16px;
}

.option-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.option-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.1);
}

.option-btn i {
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.option-btn .option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.option-btn span {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text);
}

.option-btn small {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: left;
}

.http-stream-footer {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

.cancel-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 36px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: var(--surface);
    border-color: var(--text);
    color: var(--text);
}

[data-theme="dark"] .http-stream-warning {
    background: rgba(var(--warning-rgb), 0.15);
}

[data-theme="dark"] .stream-url {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .option-btn:hover {
    background: rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =========================================== */
/* VIDEO & YOUTUBE & UNIVERSAL CONTAINERS */
/* =========================================== */

.video-container,
.youtube-container,
.universal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.video-container.active,
.youtube-container.active,
.universal-container.active {
    display: flex;
}

.video-header,
.youtube-header,
.universal-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.85) 50%,
        rgba(0,0,0,0) 100%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: fadeInDown 0.3s ease-out;
}

.video-title-container,
.youtube-title-container,
.universal-title-container {
    flex: 1;
    min-width: 0;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

#video-title,
#youtube-title,
#universal-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.video-stream-info,
.youtube-stream-info,
.universal-domain {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.close-video-btn,
.close-youtube-btn,
#close-universal {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.close-video-btn:hover,
.close-youtube-btn:hover,
#close-universal:hover,
.close-video-btn:active,
.close-youtube-btn:active,
#close-universal:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.35);
}

.video-wrapper,
.youtube-wrapper,
.universal-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

#youtube-player {
    width: 100%;
    height: 100%;
    background: #000;
    flex: 1;
}

.universal-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* =========================================== */
/* STREAM SELECTOR */
/* =========================================== */

.station-stream-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    flex-wrap: wrap;
}

#current-stream-name {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.stream-count-badge {
    font-size: 12px;
    background: rgba(var(--success-rgb), 0.15); /* Verde pentru succes/număr */
    color: var(--success); /* Verde mai închis pentru text */
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    margin-right: 4px;
}

[data-theme="dark"] .stream-count-badge {
    background: rgba(var(--success-rgb), 0.25);
}



.stream-count-badge {
    background: var(--surface-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}
[data-theme="dark"] .stream-count-badge {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-emphasis);
}



.stream-selector-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.7);
    border: none;
    color: white;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.stream-selector-btn:hover,
.stream-selector-btn:active {
    background: var(--primary);
    color: white;
}

/* =========================================== */
/* STREAMS DROPDOWN */
/* =========================================== */

.streams-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 12px;
    right: 12px;
    max-height: 400px;
    overflow: hidden;
    background: var(--bg);
    border: 5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    display: none;
    flex-direction: column;
}

.streams-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    display: flex;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

[data-theme="dark"] .dropdown-header {
    background: rgba(var(--surface-rgb), 0.8);
}

.dropdown-header-content {
    flex: 1;
    min-width: 0;
}

.dropdown-header-title {
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 600;
    line-height: 1.3;
}

.dropdown-header-subtitle {
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.3;
}

.dropdown-items-container {
    flex: 1;
    overflow-y: auto;
    max-height: calc(400px - 130px);
    min-height: 100px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s ease;
    border-bottom: 1px solid rgba(var(--border-rgb), 0.7);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(var(--surface-rgb), 0.9);
    transform: translateX(2px);
}

.dropdown-item.active {
    background: rgba(var(--primary-rgb), 0.7);
    color: white;
}

.dropdown-item.active .dropdown-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.dropdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.dropdown-item.active .dropdown-icon {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-content {
    flex: 1;
    min-width: 0;
}

.dropdown-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-active {
    margin-left: 8px;
    color: var(--primary);
    flex-shrink: 0;
}

.dropdown-item.active .dropdown-active {
    color: white;
}

.dropdown-streams-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.dropdown-streams-pagination-info {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.8;
}

.dropdown-streams-pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dropdown-streams-page-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--border);
    border: 1px solid transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
}

.dropdown-streams-page-btn:hover:not(.dropdown-disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.dropdown-streams-page-btn.dropdown-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--border);
}

.dropdown-streams-page-current {
    font-size: 13px;
    color: var(--text);
    min-width: 85px;
    text-align: center;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: 8px;
}

.dropdown-streams-page-btn i {
    font-size: 11px;
}

/* =========================================== */
/* RECENT UPDATES MODAL STYLES */
/* =========================================== */

.update-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item:hover {
    background: rgba(var(--surface-rgb), 0.9);
}

.update-rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--text);
}

.update-type {
    font-size: 11px;
    background: var(--surface);
    padding: 3px 8px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid var(--border);
}

.update-details {
    flex: 1;
    min-width: 0;
}

.update-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    color: var(--text);
    gap: 8px;
}

.update-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: var(--text-secondary);
    align-items: flex-start;
}

.update-location,
.update-time {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.update-time {
    color: var(--success);
}

.play-update-btn {
    width: 36px;
    height: 36px;
    background: var(--surface);
    color: var(--primary);
    border-radius: 50%;
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.play-update-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.updates-summary {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.updates-summary p {
    margin-bottom: 6px;
}

.updates-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
}

[data-theme="dark"] .update-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================== */
/* SCROLLBAR STYLES */
/* =========================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--border) 80%, transparent);
}

.dropdown-items-container::-webkit-scrollbar,
.stations-list::-webkit-scrollbar,
.menu-items::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.dropdown-items-container::-webkit-scrollbar-track,
.stations-list::-webkit-scrollbar-track,
.menu-items::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-items-container::-webkit-scrollbar-thumb,
.stations-list::-webkit-scrollbar-thumb,
.menu-items::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

@supports (-webkit-touch-callout: none) {
    .stations-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================== */
/* ANIMATIONS */
/* =========================================== */

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

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideDownMobile {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 0, 122, 255), 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(var(--primary-rgb, 0, 122, 255), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 0, 122, 255), 0); }
}

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

.station-item.pagination-item {
    animation: fadeInUp 0.4s ease forwards;
}

.stations-list, .menu-items, .modal-body {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* =========================================== */
/* RESPONSIVE STYLES */
/* =========================================== */

/* Tablete și telefoane mai mari */
@media (max-width: 768px) {
    .stations-list {
        padding: 16px 16px 16px 14px;
    }

    .options-bar {
        gap: 8px;
        padding: 10px 12px;
    }

    .sort-header span {
        display: none;
    }

    .sort-header i {
        font-size: 16px;
    }

    .sort-select {
        font-size: 13px;
        padding: 0 10px;
        padding-right: 32px;
        background-position: right 10px center;
        max-width: 180px;
    }

    .social-accounts {
        gap: 8px;
        padding-left: 8px;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }

    .social-link i {
        font-size: 16px;
    }

    .stations-count {
        padding: 8px 12px;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .stations-count .count-text {
        font-size: 14px;
        flex-shrink: 0;
        line-height: 1.4;
    }

    .stations-count .separator {
        line-height: 1.4;
    }

    .stations-count .recent-updates {
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 4px;
        min-height: 1.4em;
        line-height: 1.4;
    }

    .stations-count .recent-updated-stations {
        line-height: 1.4;
    }

    .stations-count .recent-updates .more-details-link {
        line-height: 1.4;
        margin-left: auto;
    }
}

/* Telefoane mici */
@media (max-width: 480px) {
    .filter-row {
        flex-wrap: wrap;
        gap: 8px 6px;
    }

    .filter-select {
        font-size: 13px;
        padding: 0 10px;
        height: 34px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .filter-row:nth-child(3) {
        display: grid;
        grid-template-columns: 1fr 1fr 40px;
        gap: 6px;
    }

    .filter-row:nth-child(3) .filter-select {
        min-width: 0;
        max-width: 100%;
    }

    #city-filter {
        grid-column: 1 / span 2;
        order: 1;
    }

    #genre-filter {
        grid-column: 1 / span 2;
        order: 2;
    }

    #clear-filters {
        grid-column: 3;
        grid-row: 1 / span 2;
        order: 3;
        width: 34px;
        height: 34px;
        align-self: center;
    }

    .options-bar {
        padding: 8px 10px;
        gap: 6px;
    }

    .sort-select {
        font-size: 12px;
        padding: 0 8px;
        padding-right: 28px;
        background-position: right 8px center;
        max-width: 150px;
    }

    .social-accounts {
        gap: 6px;
        padding-left: 6px;
    }

    .social-link {
        width: 30px;
        height: 30px;
    }

    .social-link i {
        font-size: 14px;
    }

    .stations-count {
        padding: 6px 10px;
        font-size: 13px;
        align-items: center;
        gap: 3px;
    }

    .stations-count .count-text,
    .stations-count .separator,
    .stations-count .recent-updated-stations,
    .stations-count .recent-updates .more-details-link {
        font-size: 13px;
        line-height: 1.4;
        vertical-align: middle;
    }

    .stations-count .recent-updates .more-details-link {
        padding: 1px 4px;
        line-height: 1.3;
    }

    .station-name-with-favorite {
        gap: 6px !important;
    }

    #station-name {
        font-size: 15px !important;
    }

    .player-favorite-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 13px !important;
    }

    .video-header,
    .youtube-header,
    .universal-header {
        padding: 12px 15px;
    }

    #video-title,
    #youtube-title,
    #universal-title {
        font-size: 16px;
    }

    .video-stream-info,
    .youtube-stream-info,
    .universal-domain {
        font-size: 13px;
    }

    .close-video-btn,
    .close-youtube-btn,
    #close-universal {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .dropdown-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .dropdown-header-title {
        font-size: 11px;
    }

    .dropdown-header-subtitle {
        font-size: 10px;
    }

    #http-stream-modal.modal {
        padding: 20px 10px;
        align-items: center;
    }

    #http-stream-modal .modal-content {
        max-width: 100%;
        margin: 0;
        animation: modalSlideDownMobile 0.3s ease-out;
    }

    #http-stream-modal .modal-body {
        padding: 20px;
    }

    .info-row {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 14px;
    }

    .info-row strong {
        min-width: auto;
        margin-right: 0;
    }

    .option-btn {
        padding: 14px 16px;
        gap: 14px;
    }

    .option-btn i {
        font-size: 20px;
        width: 26px;
    }

    .option-btn span {
        font-size: 14px;
    }

    .option-btn small {
        font-size: 12px;
    }

    .cancel-btn {
        padding: 10px 28px;
        font-size: 14px;
    }
}

/* Ecrane foarte mici */
@media (max-width: 400px) {
    .stations-count {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .stations-count .count-text,
    .stations-count .separator {
        margin-bottom: 2px;
    }

    .stations-count .recent-updates {
        width: 100%;
        margin-top: 0;
        order: 3;
    }
}

@media (max-width: 350px) {
    .sort-select {
        max-width: 130px;
    }

    .social-accounts {
        gap: 4px;
    }

    .social-link {
        width: 28px;
        height: 28px;
    }

    .social-link i {
        font-size: 13px;
    }

    .stations-count {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 3px;
    }

    .stations-count .separator {
        display: inline;
        margin: 0 2px;
    }

    .stations-count .recent-updates {
        width: 100%;
        justify-content: space-between;
        margin-top: 2px;
        order: 3;
    }

    .station-name-with-favorite {
        gap: 4px !important;
    }

    #station-name {
        font-size: 14px !important;
    }

    .player-favorite-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }

    .universal-header {
        padding: 12px 15px;
    }

    #universal-title {
        font-size: 16px;
    }

    .universal-domain {
        font-size: 13px;
    }

    #close-universal {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .dropdown-header {
        padding: 8px 10px;
    }

    .dropdown-header-title {
        font-size: 10px;
    }
}

/* Tablet specific */
@media (min-width: 481px) and (max-width: 768px) {
    .streams-dropdown {
        max-height: 350px;
    }

    .dropdown-items-container {
        max-height: calc(420px - 130px);
    }

    #http-stream-modal .modal-content {
        max-width: 90vw;
    }
}

/* Desktop specific */
@media (min-width: 768px) {
    #video-title,
    #youtube-title {
        font-size: 20px;
    }

    .video-stream-info,
    .youtube-stream-info {
        font-size: 15px;
    }
}

/* Aliniere stations count */
.stations-count .count-text,
.stations-count .separator,
.stations-count .recent-updates {
    display: inline-flex;
    align-items: center;
    height: 1.4em;
}

.stations-count .count-text,
.stations-count .separator {
    vertical-align: middle;
}

.stations-count .recent-updates {
    vertical-align: middle;
}

/* =========================================== */
/* BAR BUTTON */
/* =========================================== */

.bar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    padding: 0;
    margin: 0 4px;
    flex-shrink: 0;
    text-decoration: none;
    white-space: nowrap;
}

.bar-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.bar-btn:active {
    transform: translateY(0);
}

.cat-bar-icon {
    font-size: 16px;
    line-height: 1;
}

.bar-text {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

@media (min-width: 768px) {
    .bar-btn {
        width: auto;
        padding: 0 12px;
        border-radius: 18px;
        min-width: 50px;
        max-width: 280px;
    }

    .bar-text {
        display: inline;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .bar-btn {
        width: 36px;
        height: 36px;
        padding: 0;
    }

    .bar-text {
        display: none;
    }

    .cat-bar-icon {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .options-bar .bar-btn {
        width: 32px;
        height: 32px;
        margin: 0 2px;
    }

    .bar-text {
        display: none;
    }

    .cat-bar-icon {
        font-size: 16px;
    }
}

@media (max-width: 350px) {
    .options-bar .bar-btn {
        width: 30px;
        height: 30px;
    }

    .cat-bar-icon {
        font-size: 14px;
    }
}

/* =========================================== */
/* BAR BUTTON - Categorie recomandată */
/* =========================================== */

#bar-btn {
    background: linear-gradient(135deg,
        rgba(66, 133, 244, 0.1),
        rgba(255, 193, 7, 0.1)
    );
    border-color: rgba(66, 133, 244, 0.4);
    color: #4285f4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#bar-btn:hover {
    background: linear-gradient(135deg, #4285f4, #ffc107);
    color: white;
    border-color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    text-decoration: none;
}

#bar-btn:active {
    transform: translateY(0);
}

[data-theme="dark"] #bar-btn {
    background: linear-gradient(135deg,
        rgba(66, 133, 244, 0.15),
        rgba(255, 193, 7, 0.15)
    );
    border-color: rgba(66, 133, 244, 0.6);
    color: #7baaf7;
}

[data-theme="dark"] #bar-btn:hover {
    background: linear-gradient(135deg,
        #5d9cf8,
        #ffd54f
    );
    color: #000;
    border-color: #5d9cf8;
    box-shadow: 0 4px 15px rgba(93, 156, 248, 0.5);
}

.cat-bar-icon {
    animation: subtleGlow 3s infinite alternate;
}

@keyframes subtleGlow {
    from {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    to {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    }
}

[data-theme="dark"] .cat-bar-icon {
    animation: darkGlow 3s infinite alternate;
}

@keyframes darkGlow {
    from {
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    }
    to {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
}

@keyframes subtlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
