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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#widget-container {
    width: 100%;
    max-width: 1400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 24px;
}

/* ===== БЛОК 1: Сейчас в эфире ===== */
#now-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    border-radius: 12px 12px 0 0;
    padding: 12px 20px;
    border-left: 4px solid #ff5500;
}

#now-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.play-btn {
    background: none;
    border: none;
    color: #ff5500;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 85, 0, 0.1);
}

.play-btn.playing {
    color: #ff5500;
}

#now-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#now-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 14px;
}

#listeners-label {
    color: #666;
    font-weight: 400;
}

#listeners-now-count {
    font-weight: 700;
    color: #ff5500;
    font-size: 16px;
}

/* ===== ПОЛЗУНОК ГРОМКОСТИ ===== */
#volume-block {
    background: #f8f8f8;
    border-radius: 0 0 12px 12px;
    padding: 6px 20px 12px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #ff5500;
}

#volume-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

#volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff5500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

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

#volume-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    min-width: 44px;
    text-align: right;
}

/* ===== БЛОК 2: Статистика /meganight ===== */
#stats-block {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

#stats-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

#stats-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

#stats-summary span {
    font-weight: 700;
    color: #ff5500;
}

/* ===== НАВИГАЦИЯ ПО МЕСЯЦАМ ===== */
#month-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.nav-btn {
    background: #ff5500;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    transform: scale(1.05);
    background: #e64a00;
}

#current-month {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    min-width: 150px;
    text-align: center;
}

/* ===== КОЛОНКИ ===== */
#columns-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.column {
    background: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
}

.column-header {
    background: #ff5500;
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

.column-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 450px;
    overflow-y: auto;
}

.column-list li {
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.column-list li:last-child {
    border-bottom: none;
}

.column-list .rank {
    font-weight: 600;
    color: #999;
    margin-right: 10px;
    font-size: 12px;
    min-width: 20px;
}

.column-list .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-list .value {
    font-weight: 700;
    color: #ff5500;
    flex-shrink: 0;
    margin-left: 10px;
}

.column-list::-webkit-scrollbar {
    width: 4px;
}

.column-list::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.column-list::-webkit-scrollbar-thumb {
    background: #ff5500;
    border-radius: 2px;
}

/* ===== БЛОК 3: Расписание ===== */
#schedule-block {
    margin-top: 8px;
    border-top: 2px solid #f0f0f0;
    padding-top: 20px;
}

#schedule-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

#schedule-summary {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

#schedule-summary span {
    font-weight: 700;
    color: #ff5500;
}

#schedule-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.schedule-nav {
    background: #ff5500;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-nav:hover {
    transform: scale(1.05);
    background: #e64a00;
}

#schedule-current-day {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    min-width: 120px;
    text-align: center;
}

#schedule-list-wrapper {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 8px 0;
    max-height: none;
    overflow-y: visible;
}

#schedule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#schedule-list li {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

#schedule-list li:last-child {
    border-bottom: none;
}

.schedule-time {
    font-weight: 600;
    color: #ff5500;
    flex-shrink: 0;
    min-width: 44px;
}

.schedule-title {
    color: #1a1a1a;
}

.schedule-title.guest {
    color: #22a65e;
}

.schedule-empty {
    text-align: center;
    color: #999;
    padding: 16px;
    font-size: 14px;
}

#schedule-list-wrapper::-webkit-scrollbar {
    display: none;
}

/* ===== БЛОК 4: Записи эфира за 24 часа ===== */
#episodes-block {
    margin-top: 24px;
    border-top: 2px solid #f0f0f0;
    padding-top: 20px;
}

#episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#episodes-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

#episodes-count {
    font-size: 14px;
    color: #666;
}

#episodes-list-wrapper {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 4px 0;
    max-height: none;
    overflow-y: visible;
}

#episodes-list-wrapper::-webkit-scrollbar {
    display: none;
}

#episodes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===== СТИЛЬ ЭПИЗОДА ===== */
.episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

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

.episode-item .episode-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Кнопки эпизода в стиле главного плеера */
.episode-item .episode-btn {
    background: none;
    border: none;
    color: #ff5500;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.episode-item .episode-btn:hover {
    background: rgba(255, 85, 0, 0.1);
    transform: scale(1.05);
}

.episode-item .episode-btn.playing {
    color: #ff5500;
}

.episode-item .episode-btn.download-ep {
    color: #22a65e;
}

.episode-item .episode-btn.download-ep:hover {
    background: rgba(34, 166, 94, 0.1);
}

.episode-item .episode-btn.seek-btn {
    color: #666;
    font-size: 14px;
}

.episode-item .episode-btn.seek-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.episode-item .episode-name {
    flex: 1;
    font-size: 13px;
    color: #1a1a1a;
    min-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-item .episode-size {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
    min-width: 50px;
    text-align: right;
}

#episodes-list-wrapper::-webkit-scrollbar {
    width: 4px;
}

#episodes-list-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 12px;
}

#episodes-list-wrapper::-webkit-scrollbar-thumb {
    background: #ff5500;
    border-radius: 12px;
}

/* ===== ЗАГРУЗКА ===== */
#loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    display: none;
}

#loading.active {
    display: block;
}

/* ===== НАЗАД ===== */
#back-container {
    margin-top: 30px;
    border-top: 2px solid #f0f0f0;
    padding-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #999;
}

#back-container a {
    color: #ff5500;
    text-decoration: none;
    font-weight: 500;
}

#back-container a:hover {
    text-decoration: underline;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    #columns-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #stats-summary {
        font-size: 13px;
    }
    
    .episode-item {
        gap: 8px;
        padding: 8px 12px;
    }
    
    .episode-item .episode-name {
        font-size: 12px;
        min-width: 100px;
        flex-basis: 100%;
    }
    
    .episode-item .episode-controls {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    #widget-container {
        padding: 16px;
    }
    
    #columns-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    #now-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }
    
    #volume-block {
        padding: 4px 16px 10px 16px;
    }
    
    #now-right {
        font-size: 13px;
    }
    
    #now-title {
        font-size: 14px;
    }
    
    #stats-header h1 {
        font-size: 17px;
    }
    
    #stats-summary {
        font-size: 12px;
        line-height: 1.8;
    }
    
    #current-month {
        font-size: 15px;
        min-width: 120px;
    }
    
    .column-list li {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    #schedule-header h2,
    #episodes-header h2 {
        font-size: 17px;
    }
    
    #schedule-summary {
        font-size: 12px;
    }
    
    #schedule-list li {
        font-size: 12px;
        padding: 5px 12px;
    }
    
    .schedule-time {
        min-width: 38px;
        font-size: 12px;
    }
    
    #volume-label {
        font-size: 12px;
        min-width: 38px;
    }
    
    .episode-item .episode-btn {
        font-size: 14px;
        min-width: 28px;
        min-height: 28px;
    }
    
    .episode-item .episode-size {
        font-size: 10px;
        min-width: 40px;
    }
}

/* ===== ДУБЛИРОВАННЫЙ ПЛЕЕР ВНИЗУ ===== */
#player-bottom {
    margin-top: 24px;
    border-top: 2px solid #f0f0f0;
    padding-top: 20px;
}

#player-bottom-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    border-radius: 12px 12px 0 0;
    padding: 12px 20px;
    border-left: 4px solid #ff5500;
}

#player-bottom-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

#now-title-bottom {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#player-bottom-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 14px;
}

#listeners-label-bottom {
    color: #666;
    font-weight: 400;
}

#listeners-now-count-bottom {
    font-weight: 700;
    color: #ff5500;
    font-size: 16px;
}

#volume-block-bottom {
    background: #f8f8f8;
    border-radius: 0 0 12px 12px;
    padding: 6px 20px 12px 20px;
    border-left: 4px solid #ff5500;
}

#volume-slider-wrapper-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

#volume-slider-bottom {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

#volume-slider-bottom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff5500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#volume-slider-bottom::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

#volume-slider-bottom::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff5500;
    cursor: pointer;
    border: none;
}

#volume-label-bottom {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    min-width: 44px;
    text-align: right;
}

@media (max-width: 640px) {
    #player-bottom-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }
    
    #player-bottom-right {
        font-size: 13px;
    }
    
    #now-title-bottom {
        font-size: 14px;
    }
    
    #volume-block-bottom {
        padding: 4px 16px 10px 16px;
    }
    
    #volume-label-bottom {
        font-size: 12px;
        min-width: 38px;
    }
}

