/* ============================================
   ПЛАВАЮЩАЯ КНОПКА РАДИО-ПЛЕЕРА
   ============================================ */

.floating-radio-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    z-index: 9995;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
}

/* Правильное позиционирование относительно других кнопок */
/* Все кнопки выровнены в столбик по правому краю (right: 20px) */
/* Порядок снизу вверх: Chatbot (20px) -> Radio (90px) -> Scroll-to-top (160px) */

/* Адаптивность для правильного позиционирования */
/* На мобильных: Chatbot (20px) -> Radio (90px) -> Scroll-to-top (160px) */
@media (max-width: 768px) {
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
    }
    
    .floating-radio-panel {
        bottom: 160px !important;
        right: 20px !important;
    }
}

@media (max-width: 480px) {
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
        width: 56px;
        height: 56px;
    }
    
    .floating-radio-panel {
        bottom: 160px !important;
        right: 20px !important;
    }
}

.floating-radio-btn:hover {
    transform: scale(1.1);
}

.floating-radio-btn.playing {
    /* Убрали моргание, оставили только плавное свечение */
}

.floating-radio-btn.playing .floating-radio-btn-inner {
    animation: radioGlow 2s ease-in-out infinite;
}

@keyframes radioGlow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    }
    50% {
        box-shadow: 0 4px 24px rgba(124, 58, 237, 0.6);
    }
}

.floating-radio-btn-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    transition: all 0.3s ease;
}

.floating-radio-btn:hover .floating-radio-btn-inner {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.6);
    transform: scale(1.05);
}

.floating-radio-icon {
    font-size: 1.5rem;
    color: white;
    z-index: 2;
    transition: transform 0.3s ease;
}

.floating-radio-btn.playing .floating-radio-icon {
    animation: radioIconBounce 0.6s ease-in-out infinite;
}

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

.floating-radio-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-radio-btn.playing .floating-radio-waves {
    opacity: 1;
}

.wave-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: white;
    transform: scale(0.5);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.floating-radio-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
}

.floating-radio-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--bg-surface);
}

.floating-radio-btn:hover .floating-radio-tooltip {
    opacity: 1;
    visibility: visible;
}

.floating-radio-station {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.floating-radio-status {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Панель управления радио */
.floating-radio-panel {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9994;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.floating-radio-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.floating-radio-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(16, 185, 129, 0.1));
}

.floating-radio-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}

.floating-radio-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-body);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.floating-radio-panel-close:hover {
    background: var(--color-primary);
    color: white;
    transform: rotate(90deg);
}

.floating-radio-panel-content {
    padding: 20px;
}

.floating-radio-station-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-body);
    border-radius: 12px;
}

.floating-radio-station-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.floating-radio-station-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.floating-radio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.floating-radio-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-body);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.floating-radio-control-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.floating-radio-play-btn {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.floating-radio-play-btn:hover {
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.floating-radio-stations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.floating-radio-station-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.floating-radio-station-item:hover {
    border-color: var(--color-primary);
    background: rgba(124, 58, 237, 0.05);
    transform: translateX(4px);
}

.floating-radio-station-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(16, 185, 129, 0.15));
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.station-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.station-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.floating-radio-station-item.active .station-name {
    color: var(--color-primary);
    font-weight: 600;
}

.floating-radio-station-item .fa-check {
    color: var(--color-primary);
    font-size: 0.875rem;
}

/* Адаптивность - правильное позиционирование относительно других кнопок */
@media (max-width: 768px) {
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
    }
    
    .floating-radio-panel {
        bottom: 160px !important;
        right: 20px !important;
        width: calc(100vw - 40px);
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .floating-radio-btn {
        bottom: 90px !important;
        right: 20px !important;
        width: 56px;
        height: 56px;
    }
    
    .floating-radio-icon {
        font-size: 1.25rem;
    }
    
    .floating-radio-panel {
        bottom: 160px !important;
        right: 20px !important;
        width: calc(100vw - 40px);
    }
}

/* Темная тема */
[data-theme="dark"] .floating-radio-panel {
    background: var(--bg-surface);
    border-color: var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .floating-radio-tooltip {
    background: var(--bg-surface);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

