/* Вынесено из v5/menu/online.php — подключается тегом <link> в том же месте, где был блок <style> */
/* Основной контейнер - как на других страницах */
.online-main {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Заголовок страницы - как news-title */
.online-header {
    text-align: center;
    margin-bottom: 30px;
}

.online-title {
    font-size: 28px;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.online-subtitle {
    color: var(--secondary-text);
    font-size: 14px;
}

/* Компактный плеер */
.online-player-compact {
    background: var(--card-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
}

.online-player-cover {
    width: 200px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-color), #4a0b0b);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
}

.online-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.online-player-track {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-player-artist {
    font-size: 16px;
    color: var(--accent-color);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-status {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(183, 28, 28, 0.1);
    border-radius: 20px;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0;
}

.online-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

/* Кнопка — в дизайне кнопки нижнего плеера (.button-player): кольцо со значком, без заливки.
   Нижний плеер на тёмном фоне — значок белый; здесь карточка светлая — значок цвета акцента. */
.online-play-btn {
    width: 80px;
    height: 80px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease-in-out, color 0.2s;
    flex-shrink: 0;
}

.online-play-btn:hover {
    color: var(--accent-hover);
}

.online-play-btn:active {
    transform: scale(1.1);
}

.online-play-btn svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.online-play-btn .pause-icon {
    display: none;
}

.online-play-btn.playing .play-icon {
    display: none;
}

.online-play-btn.playing .pause-icon {
    display: block;
}

.online-volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 120px;
    min-width: 0; /* иначе flex-элемент не сжимается меньше содержимого */
}

.online-volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.online-volume-btn:hover {
    color: var(--accent-color);
}

.online-volume-slider {
    flex: 1;
    /* У input[type=range] своя ширина по умолчанию (~130px) — без этих двух строк
       ползунок не сжимался под max-width блока и вылезал за карточку на телефоне */
    min-width: 0;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--accent-color), #ff6b6b);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.online-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.online-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.online-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.online-volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.online-player-controls .chart-trackm {
    margin: 0;
    gap: 4px;
    flex-shrink: 0;
}

.online-player-controls .chart-trackm .vote-icon-up,
.online-player-controls .chart-trackm .vote-icon-down,
.online-player-controls .chart-trackm .vote-icon-ok,
.online-player-controls .chart-trackm .vote-icon-deny {
    font-size: 14px;
}

.online-player-controls .chart-trackm .chart_all {
    color: var(--text-color);
    font-size: 12px;
}

/* Компактный выбор потока - таблица */
.stream-selector-compact {
    background: var(--card-color, #ffffff);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stream-selector-compact h3 {
    font-size: 18px;
    color: var(--accent-color, #b71c1c);
    margin-bottom: 15px;
    font-weight: 600;
}

.stream-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.stream-table th {
    text-align: left;
    padding: 10px 15px;
    font-size: 13px;
    color: #FFFFFF !important;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.stream-table th:first-child {
    width: 12%;
}

.stream-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    vertical-align: middle;
}

.stream-table tr:last-child td {
    border-bottom: none;
}

.stream-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.stream-server {
    font-weight: 600;
    color: var(--text-color, #333);
    font-size: 14px;
    white-space: nowrap;
    width: 12%;
}

/* Пометка лучшего для посетителя сервера (v5/js/stream-select.js) */
.stream-best {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-color, #b71c1c);
    white-space: nowrap;
}
.stream-best[hidden] {
    display: none;
}

.stream-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0;
}

.stream-link {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: rgba(183, 28, 28, 0.08);
    color: var(--accent-color, #b71c1c);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.stream-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0;
}

.stream-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    background: rgba(183, 28, 28, 0.08);
    color: var(--accent-color, #b71c1c);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.stream-link:hover {
    background: var(--accent-color, #b71c1c);
    color: white;
    transform: translateY(-1px);
}

.stream-link.active {
    background: var(--accent-color, #b71c1c);
    color: white;
}

.stream-format {
    font-weight: 700;
    margin-right: 4px;
}

.stream-bitrate {
    opacity: 0.8;
}

/* Блок чарта */
.chart-section {
    background: var(--card-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.chart-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.chart-section-header {
    display: grid;
    grid-template-columns: 40px 50px 1fr 2fr;
    gap: 10px;
    padding: 10px 15px;
    background: var(--accent-color);
    color: white;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 0;
}

.chart-section-row {
    display: grid;
    grid-template-columns: 40px 50px 1fr 2fr;
    gap: 10px;
    padding: 10px 15px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.chart-section-row:nth-child(even) {
    background-color: #f4f4f4;
}

.chart-section-row:nth-child(odd) {
    background-color: #fcfcfc;
}

.chart-section-col-tw {
    font-weight: 700;
    color: var(--accent-color);
}

.chart-section-col-lw {
    font-weight: 600;
    color: var(--accent-color);
}

.chart-section-col-artist {
    font-weight: 700;
    color: var(--text-color);
}

.chart-section-col-artist a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
}

.chart-section-col-artist a:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .chart-section-header,
    .chart-section-row {
        grid-template-columns: 30px 40px 1fr 1.5fr;
        font-size: 10px;
        gap: 4px;
        padding: 8px 8px;
    }
}
    
/* Блок "Ранее в эфире" - как на главной */
.history-section {
    background: var(--card-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.history-time {
    font-weight: 600;
    color: var(--accent-color);
    min-width: 35px;
    font-size: 14px;
    text-align: center;
}

.history-date {
    font-size: 11px;
    color: var(--secondary-text);
    font-weight: 400;
    text-align: center;
    margin-top: 2px;
}

.history-artist {
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
    word-break: break-word;
    font-size: 14px;
}

.history-artist:hover {
    color: var(--accent-color);
}

.history-track {
    color: var(--secondary-text);
    flex: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

@media (max-width: 768px) {
    .online-main {
        padding: 0 15px;
    }
    
    .online-title {
        font-size: 24px;
    }
    
    .online-player-compact {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 20px 15px;
    }

    /* При align-items: center колонка сжималась по содержимому, и длинное название трека
       (white-space: nowrap) растягивало её — а с ней и кнопки — за правый край карточки */
    .online-player-info {
        width: 100%;
        align-self: stretch;
    }
    
    .online-player-cover {
        width: 160px;
        aspect-ratio: 1 / 1;
        align-self: center;
    }
    
    .online-player-controls {
        flex-direction: row;
        flex-wrap: wrap; /* узкий экран: громкость переносится на вторую строку, а не за край */
        justify-content: center;
        width: 100%;
    }
    
    .online-play-btn {
        width: 64px;
        height: 64px;
    }
    
    .online-volume-control {
        max-width: 100px;
    }
    
    .stream-table {
        font-size: 13px;
    }
    
    .stream-table th,
    .stream-table td {
        padding: 8px 10px;
    }
    
    .stream-table th {
        color: #ffffff !important;
    }
    
    .stream-links {
        gap: 5px;
    }
    
    .stream-link {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .history-item {
        flex-wrap: wrap;
    }
    
    .history-track {
        flex-basis: 100%;
        margin-top: 5px;
    }
    
    .history-time {
        min-width: 60px;
    }
    
    .history-date {
        font-size: 10px;
    }
}
