/**
 * NEXCURE Radio Player Styles
 * Version: 1.0.0
 */

/* CSS Reset for the player */
.nexcure-radio-container,
.nexcure-radio-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: normal;
}

.nexcure-radio-container button {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
}

.nexcure-radio-container svg {
    vertical-align: middle;
}

/* CSS Variables */
.nexcure-radio-container {
    --nexcure-primary: #dc503c;
    --nexcure-primary-light: #ff6b54;
    --nexcure-bg: rgba(20, 20, 20, 0.85);
    --nexcure-border: rgba(255, 255, 255, 0.08);
    --nexcure-text: rgba(255, 255, 255, 0.7);
    --nexcure-text-active: #ffffff;
}

/* Main Container */
.nexcure-radio-container {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 16px 28px;
    background: var(--nexcure-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 1px solid var(--nexcure-border);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.5),
        0 0 60px color-mix(in srgb, var(--nexcure-primary) 10%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.nexcure-radio-container *,
.nexcure-radio-container *::before,
.nexcure-radio-container *::after {
    box-sizing: border-box;
}

/* Play/Pause Button */
.nexcure-play-btn {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #dc503c, #ff6b54) !important;
    background: linear-gradient(145deg, var(--nexcure-primary), var(--nexcure-primary-light)) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 
        0 4px 15px rgba(220, 80, 60, 0.4),
        0 0 30px rgba(220, 80, 60, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.nexcure-play-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.2), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.nexcure-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 
        0 6px 25px color-mix(in srgb, var(--nexcure-primary) 50%, transparent),
        0 0 50px color-mix(in srgb, var(--nexcure-primary) 30%, transparent);
}

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

.nexcure-play-btn:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(255, 255, 255, 0.3),
        0 4px 15px color-mix(in srgb, var(--nexcure-primary) 40%, transparent);
}

.nexcure-play-btn svg {
    width: 22px !important;
    height: 22px !important;
    fill: #ffffff !important;
    position: relative !important;
    z-index: 10 !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)) !important;
    display: block !important;
}

.nexcure-play-btn .nexcure-play-icon {
    display: block !important;
}

.nexcure-play-btn .nexcure-pause-icon {
    display: none !important;
}

.nexcure-play-btn.playing .nexcure-play-icon {
    display: none !important;
}

.nexcure-play-btn.playing .nexcure-pause-icon {
    display: block !important;
}

/* Loading Spinner */
.nexcure-loading-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: nexcure-spin 1s linear infinite;
    position: relative;
    z-index: 1;
}

.nexcure-play-btn.loading .nexcure-play-icon,
.nexcure-play-btn.loading .nexcure-pause-icon {
    display: none;
}

.nexcure-play-btn.loading .nexcure-loading-spinner {
    display: block;
}

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

/* Equalizer */
.nexcure-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 36px;
    padding: 0 8px;
}

.nexcure-eq-bar {
    width: 4px;
    height: 4px;
    background: linear-gradient(to top, var(--nexcure-primary), var(--nexcure-primary-light));
    border-radius: 2px;
    transition: height 0.1s ease;
    box-shadow: 0 0 8px color-mix(in srgb, var(--nexcure-primary) 50%, transparent);
}

.nexcure-eq-bar.inactive {
    height: 4px !important;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* Divider */
.nexcure-divider {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
}

/* Volume Control */
.nexcure-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nexcure-volume-icon {
    width: 20px;
    height: 20px;
    fill: var(--nexcure-text);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nexcure-volume-icon:hover {
    fill: var(--nexcure-text-active);
}

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

.nexcure-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

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

.nexcure-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nexcure-volume-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    height: 4px;
}

/* Status */
.nexcure-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
}

.nexcure-live-dot {
    width: 8px;
    height: 8px;
    background: var(--nexcure-primary);
    border-radius: 50%;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.nexcure-live-dot.active {
    opacity: 1;
    animation: nexcure-pulse 1.5s ease-in-out infinite;
}

@keyframes nexcure-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--nexcure-primary) 60%, transparent);
    }
    50% {
        box-shadow: 0 0 0 8px color-mix(in srgb, var(--nexcure-primary) 0%, transparent);
    }
}

.nexcure-status-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nexcure-status-text.active {
    color: var(--nexcure-primary);
}

/* Hidden Audio */
.nexcure-audio {
    display: none;
}

/* Size Variations */
.nexcure-radio-small {
    padding: 10px 20px;
    gap: 12px;
}

.nexcure-radio-small .nexcure-play-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.nexcure-radio-small .nexcure-play-btn svg {
    width: 18px;
    height: 18px;
}

.nexcure-radio-small .nexcure-equalizer {
    height: 28px;
}

.nexcure-radio-small .nexcure-eq-bar {
    width: 3px;
}

.nexcure-radio-small .nexcure-volume-slider {
    width: 60px;
}

.nexcure-radio-large {
    padding: 20px 36px;
    gap: 24px;
}

.nexcure-radio-large .nexcure-play-btn {
    width: 64px;
    height: 64px;
    min-width: 64px;
}

.nexcure-radio-large .nexcure-play-btn svg {
    width: 28px;
    height: 28px;
}

.nexcure-radio-large .nexcure-equalizer {
    height: 48px;
}

.nexcure-radio-large .nexcure-eq-bar {
    width: 5px;
    gap: 4px;
}

.nexcure-radio-large .nexcure-volume-slider {
    width: 100px;
}

.nexcure-radio-large .nexcure-status-text {
    font-size: 12px;
}

/* Style Variations */
.nexcure-radio-style-minimal {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 10px;
}

.nexcure-radio-style-minimal .nexcure-divider {
    display: none;
}

.nexcure-radio-style-minimal .nexcure-status {
    display: none;
}

.nexcure-radio-style-dark {
    background: rgba(0, 0, 0, 0.95);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 600px) {
    .nexcure-radio-container {
        padding: 12px 20px;
        gap: 12px;
    }

    .nexcure-play-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .nexcure-equalizer {
        display: none;
    }

    .nexcure-volume-slider {
        width: 60px;
    }

    .nexcure-status-text {
        display: none;
    }
}

@media (max-width: 400px) {
    .nexcure-radio-container {
        padding: 10px 16px;
        gap: 10px;
        border-radius: 40px;
    }

    .nexcure-divider {
        display: none;
    }

    .nexcure-volume-control {
        gap: 6px;
    }

    .nexcure-volume-slider {
        width: 50px;
    }
}

/* RTL Support */
[dir="rtl"] .nexcure-radio-container {
    direction: rtl;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nexcure-radio-container {
        border-width: 2px;
        border-color: white;
    }

    .nexcure-play-btn {
        border: 2px solid white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .nexcure-play-btn,
    .nexcure-eq-bar,
    .nexcure-volume-slider::-webkit-slider-thumb,
    .nexcure-live-dot {
        transition: none;
        animation: none;
    }
}
