/**
 * RadioWeb Player Pro - Frontend Styles
 *
 * @package RadioWeb_Player_Pro
 */

/* Reset */
.radioweb-player,
.radioweb-player * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Container */
.radioweb-player {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    padding: 12px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

.radioweb-player.radioweb-top {
    top: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.radioweb-player.radioweb-bottom {
    bottom: 0;
}

/* Container */
.radioweb-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Artwork Wrapper */
.radioweb-artwork-wrapper {
    flex-shrink: 0;
    position: relative;
}

/* Album Art */
.radioweb-album-art {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: opacity 0.5s ease;
}

.radioweb-album-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Logo */
.radioweb-logo {
    flex-shrink: 0;
    overflow: hidden;
    border: 0px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.radioweb-logo-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

.radioweb-logo-rectangle {
    width: 75px;
    height: 60px;
    border-radius: 8px;
}

.radioweb-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.radioweb-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.radioweb-logo-placeholder svg {
    width: 28px;
    height: 28px;
    fill: rgba(255, 255, 255, 0.6);
}

/* Pulse Ring Animation */
.radioweb-pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: 2;
    animation: radioweb-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes radioweb-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.1; transform: scale(1.05); }
}

/* Info */
.radioweb-info {
    flex: 1;
    min-width: 0;
    color: #fff;
}

.radioweb-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radioweb-name {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Audio Visualizer */
.radioweb-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.radioweb-viz-bar {
    width: 3px;
    background: #fff;
    border-radius: 1px;
    animation: radioweb-viz 0.5s ease-in-out infinite alternate;
}

.radioweb-viz-bar:nth-child(1) { animation-delay: 0s; }
.radioweb-viz-bar:nth-child(2) { animation-delay: 0.1s; }
.radioweb-viz-bar:nth-child(3) { animation-delay: 0.2s; }
.radioweb-viz-bar:nth-child(4) { animation-delay: 0.15s; }
.radioweb-viz-bar:nth-child(5) { animation-delay: 0.05s; }

@keyframes radioweb-viz {
    0% { height: 4px; }
    100% { height: 16px; }
}

/* Scrolling Text */
.radioweb-current-song {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 2px;
    overflow: hidden;
    max-width: 300px;
}

.radioweb-song-scroll {
    white-space: nowrap;
    overflow: hidden;
}

.radioweb-song-scroll.radioweb-scrolling .radioweb-song-text {
    display: inline-block;
    animation: radioweb-scroll 18s linear infinite;
}

.radioweb-song-scroll.radioweb-scrolling .radioweb-song-text:hover {
    animation-play-state: paused;
}

@keyframes radioweb-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Play Button */
.radioweb-play-wrapper {
    position: relative;
    flex-shrink: 0;
}

.radioweb-play-btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.radioweb-play-wrapper:hover .radioweb-play-btn-glow {
    opacity: 0.5;
}

.radioweb-play-btn-glow.radioweb-glow-active {
    opacity: 0.5;
    animation: radioweb-glow-pulse 2s ease-in-out infinite;
}

@keyframes radioweb-glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.radioweb-play-btn {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.radioweb-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.radioweb-play-btn:active {
    transform: scale(0.95);
}

.radioweb-play-btn .radioweb-icon {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.radioweb-play-btn .radioweb-icon-play {
    margin-left: 2px;
}

.radioweb-play-btn .radioweb-icon-loading {
    animation: radioweb-spin 1s linear infinite;
    stroke: #fff;
    fill: none;
}

@keyframes radioweb-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Volume */
.radioweb-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.radioweb-volume-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.radioweb-volume-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.radioweb-volume-btn .radioweb-icon {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.radioweb-volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.radioweb-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.radioweb-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Social Buttons */
.radioweb-social {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.radioweb-social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.radioweb-social-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.radioweb-social-svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* Mobile Menu Toggle */
.radioweb-mobile-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.radioweb-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.radioweb-mobile-toggle .radioweb-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Mobile Panel */
.radioweb-mobile-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    animation: radioweb-fade-in 0.2s ease;
}

@keyframes radioweb-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.radioweb-mobile-panel-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.radioweb-mobile-section {
    padding: 8px 0;
}

.radioweb-mobile-section + .radioweb-mobile-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 16px;
}

.radioweb-mobile-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 8px;
}

.radioweb-mobile-volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radioweb-mobile-volume .radioweb-volume-slider {
    display: block !important;
    flex: 1;
}

/* Desktop/Mobile visibility */
.radioweb-desktop-only {
    display: flex;
}

.radioweb-mobile-only {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .radioweb-player {
        padding: 10px 16px;
    }
    
    .radioweb-container {
        gap: 12px;
    }
    
    .radioweb-logo-circle {
        width: 48px;
        height: 48px;
    }
    
    .radioweb-logo-rectangle {
        width: 60px;
        height: 48px;
    }
    
    .radioweb-name {
        font-size: 13px;
    }
    
    .radioweb-current-song {
        font-size: 12px;
        max-width: 150px;
    }
    
    .radioweb-play-btn {
        width: 48px;
        height: 48px;
    }
    
    .radioweb-play-btn .radioweb-icon {
        width: 20px;
        height: 20px;
    }
    
    .radioweb-desktop-only {
        display: none !important;
    }
    
    .radioweb-mobile-only {
        display: flex !important;
    }
    
    .radioweb-mobile-panel {
        padding: 12px 16px;
    }
}

/* Accessibility */
.radioweb-play-btn:focus,
.radioweb-volume-btn:focus,
.radioweb-volume-slider:focus,
.radioweb-mobile-toggle:focus,
.radioweb-social-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Print */
@media print {
    .radioweb-player {
        display: none !important;
    }
}