/**
 * Modern Stream Selector Styles
 * Logo-based visual stream switching
 * 
 * @package WEEU830
 * @version 3.1.0
 */

/* Modern Stream Selector Container */
.modern-stream-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 9999;
}

/* "Selected Station" Label */
.stream-selector-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    font-weight: 600;
    color: var(--color-text);
}

/* Clickable Trigger (Logo + Name) — light chip on the light header bar */
.stream-selector-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--color-background);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: var(--color-text);
}

.stream-selector-trigger:hover {
    background: var(--color-background-alt);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stream-selector-trigger:active {
    transform: translateY(0);
}

/* Current Stream Icon */
.current-stream-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.current-stream-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.55);
}

/* Current Stream Name */
.current-stream-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown Arrow */
.selector-arrow {
    margin-left: auto;
    opacity: 0.7;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stream-selector-trigger:hover .selector-arrow {
    opacity: 1;
}

.stream-selector-dropdown.open ~ .stream-selector-trigger .selector-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.stream-selector-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    min-width: 300px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999999;
    overflow: hidden;
}

.stream-selector-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* Dropdown Header */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
}

.dropdown-header span {
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-close {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.dropdown-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Stream Options Container */
.dropdown-streams {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-streams::-webkit-scrollbar {
    width: 6px;
}

.dropdown-streams::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
}

.dropdown-streams::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.dropdown-streams::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Individual Stream Option */
.stream-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 4px;
}

.stream-option:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.stream-option.active {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.2) 0%, rgba(220, 0, 0, 0.2) 100%);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
}

.stream-option.active:hover {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.25) 0%, rgba(220, 0, 0, 0.25) 100%);
}

/* Stream Option Icon */
.stream-option-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.stream-option:hover .stream-option-icon {
    border-color: rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

.stream-option.active .stream-option-icon {
    border-color: rgba(var(--color-primary-rgb), 0.5);
}

.stream-option-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stream-option-default-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.45);
}

/* Stream Option Info */
.stream-option-info {
    flex: 1;
    min-width: 0;
}

.stream-option-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-option-type {
    font-size: var(--font-size-xs);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Active Checkmark */
.stream-option-check {
    width: 28px;
    height: 28px;
    background: var(--color-primary, #F80000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    font-weight: bold;
    color: var(--color-on-primary);
    flex-shrink: 0;
    animation: checkPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Backdrop */
.stream-selector-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999998;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.stream-selector-backdrop.visible {
    opacity: 1;
}

/* Modern Notification */
.weeu-modern-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999999;
    min-width: 280px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.weeu-modern-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notif-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notif-icon,
.notif-icon-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-h4);
}

.notif-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-text {
    flex: 1;
}

.notif-title {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.notif-stream {
    font-size: var(--font-size-base);
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .stream-selector-dropdown {
        min-width: 280px;
        max-width: calc(100vw - 40px);
    }
    
    .stream-selector-trigger {
        padding: 6px 12px;
    }
    
    .current-stream-icon {
        width: 40px;
        height: 40px;
    }
    
    .current-stream-name {
        font-size: var(--font-size-xs);
        max-width: 100px;
    }
    
    .stream-option {
        padding: 10px 12px;
    }
    
    .stream-option-icon {
        width: 50px;
        height: 50px;
    }
    
    .stream-option-name {
        font-size: var(--font-size-sm);
    }
    
    .weeu-modern-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stream-selector-trigger,
    .current-stream-icon {
        transition: none;
    }
}

@media (max-width: 480px) {
    .modern-stream-selector {
        gap: 3px;
    }
    
    .stream-selector-label {
        font-size: 9px;
    }
    
    .stream-selector-trigger {
        padding: 5px 10px;
        gap: 8px;
    }
    
    .current-stream-icon {
        width: 35px;
        height: 35px;
    }
    
    .current-stream-name {
        font-size: var(--font-size-xs);
        max-width: 80px;
    }
    
    .dropdown-streams {
        max-height: 300px;
    }
    
    .stream-option-icon {
        width: 45px;
        height: 45px;
    }
}
