/**
 * Radio Feature Styles - World-Class Design
 * Premium UI/UX for Global Radio Streaming
 */

/* Radio Modal Specific Styles */
.radio-modal .modal-content {
    max-width: 1200px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.radio-modal .radio-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
}

.radio-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.radio-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.radio-title-section h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.radio-subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

.radio-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.radio-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.station-count {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Radio Controls */
.radio-controls {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.station-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.station-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.genre-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.genre-filter {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.genre-filter:hover {
    border-color: #667eea;
    color: #667eea;
}

.genre-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Radio Body */
.radio-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #ffffff;
}

/* Radio Loading */
.radio-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.radio-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Radio Stations Grid */
.radio-stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

/* Radio Station Card */
.radio-station-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.radio-station-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.radio-station-card.playing {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: #667eea;
}

.radio-station-card.playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradient-shift 2s linear infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.radio-station-card.loading {
    opacity: 0.7;
}

.radio-station-card.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Station Header */
.station-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.station-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem;
}

.favorite-btn:hover {
    color: #fbbf24;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #fbbf24;
}

/* Station Info */
.station-info {
    flex: 1;
}

.station-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.station-genre {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.station-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.quality-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.quality-badge.quality-ultra {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.quality-badge.quality-hd,
.quality-badge.quality-high {
    background: #10b981;
    color: white;
}

.quality-badge.quality-standard {
    background: #3b82f6;
    color: white;
}

.quality-badge.quality-low {
    background: #6b7280;
    color: white;
}

.votes {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Play Button */
.play-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.play-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.play-btn.stop-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.play-icon, .stop-icon {
    font-size: 0.875rem;
}

.spinner-icon {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* No Stations Message */
.no-stations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #6b7280;
}

.no-stations svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Audio Visualizer */
.radio-visualizer {
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

/* Now Playing Bar */
.now-playing-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 1rem 2rem;
    transition: bottom 0.3s ease;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.now-playing-bar.visible {
    bottom: 0;
}

.now-playing-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.now-playing-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.now-playing-label {
    background: rgba(239, 68, 68, 0.9);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.now-playing-station {
    font-size: 1.125rem;
    font-weight: 600;
}

.now-playing-genre {
    color: #9ca3af;
    font-size: 0.875rem;
}

.now-playing-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.stop-button {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stop-button:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-control input[type="range"] {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Radio Error Message */
.radio-error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #dc2626;
}

.error-icon {
    font-size: 1.25rem;
}

/* Radio Footer */
.radio-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.radio-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .radio-modal .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .radio-header {
        border-radius: 0;
    }

    .radio-stations-grid {
        grid-template-columns: 1fr;
    }

    .now-playing-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .now-playing-controls {
        justify-content: space-between;
    }

    .volume-control input[type="range"] {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .radio-title-section h2 {
        font-size: 1.25rem;
    }

    .genre-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .genre-filter {
        flex-shrink: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .radio-modal .modal-content {
        background: #1f2937;
        color: #f3f4f6;
    }

    .radio-body {
        background: #1f2937;
    }

    .station-search {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .genre-filter {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .radio-station-card {
        background: #374151;
        border-color: #4b5563;
    }

    .station-name {
        color: #f3f4f6;
    }

    .station-genre {
        color: #9ca3af;
    }

    .radio-controls {
        background: #374151;
        border-color: #4b5563;
    }

    .radio-footer {
        background: #374151;
        border-color: #4b5563;
    }
}

/* Print Styles */
@media print {
    .radio-modal,
    .now-playing-bar {
        display: none !important;
    }
}