/* =============================================
   Element Player — Public Styles v1.0
   Apple Vision Pro Spatial Audio Aesthetic
   ============================================= */
:root {
    --ep-accent:              #ffffff;
    --ep-bg:                  transparent;
    --ep-card-bg:             rgba(255,255,255,0.10);
    --ep-card-border-color:   rgba(255,255,255,0.18);
    --ep-card-border-width:   1px;
    --ep-card-border-style:   solid;
    --ep-text:                #ffffff;
    --ep-muted:               rgba(255,255,255,0.55);
    --ep-bar:                 rgba(255,255,255,0.18);
    --ep-bar-fill:            #ffffff;
    --ep-shadow:              0 24px 64px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
    --ep-radius:              22px;
    --ep-transition:          0.3s ease;
    --ep-cards-per-row:       3;
    --ep-card-gap:            20px;
    --ep-cover-bar-gap:       0px;
    --ep-cover-width:         100%;
    --ep-cover-height:        auto;
    --ep-cover-aspect:        100%;
    --ep-cover-fit:           cover;
    --ep-cover-border-color:  transparent;
    --ep-cover-border-width:  0px;
    --ep-cover-border-style:  solid;
    --ep-cover-border-radius: 0px;
    --ep-bar-bg:              rgba(0,0,0,0.3);
    --ep-bar-border-color:    transparent;
    --ep-bar-border-width:    0px;
    --ep-bar-border-style:    solid;
    --ep-controls-border-color:  transparent;
    --ep-controls-border-width:  0px;
    --ep-controls-border-style:  solid;
    --ep-controls-bg:            transparent;
    --ep-dot-color:           rgba(255,255,255,0.25);
    --ep-dot-active-color:    rgba(255,255,255,0.9);
    --ep-dot-size:            7px;
    --ep-dot-gap:             7px;
    --ep-dot-radius:          50%;
    --ep-wrapper-border-color:  transparent;
    --ep-wrapper-border-width:  0px;
    --ep-wrapper-border-style:  solid;
    --ep-wrapper-border-radius: 24px;
    --ep-wrapper-width:         100%;
    --ep-wrapper-height:        auto;
    --ep-text-align:          center;
    --ep-glossy-tint:         rgba(255,255,255,0.18);
    --ep-card-hover-shadow:       0 32px 80px rgba(0,0,0,0.65), 0 8px 24px rgba(0,0,0,0.4);
    --ep-card-hover-translateY:   -8px;
    --ep-card-hover-scale:        1.04;
    --ep-cover-hover-scale:       1.06;
    --ep-cover-hover-brightness:  1.05;
    --ep-btn-hover-scale:         1.12;
    --ep-btn-hover-color:         #ffffff;
    --ep-progress-hover-fill:     #a78bfa;
}

/* ---- Background Widget ---- */
.ep-bg-widget {
    position: relative;
    overflow: hidden;
    border-radius: var(--ep-bg-radius, 0px);
}
.ep-bg-widget__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    transform: scale(1.03);
    transition: transform 8s ease;
}
.ep-bg-widget__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--ep-bg-overlay, rgba(10,10,20,0.45));
    backdrop-filter: blur(var(--ep-bg-blur, 0px));
    -webkit-backdrop-filter: blur(var(--ep-bg-blur, 0px));
}
.ep-bg-widget__content {
    position: relative;
    z-index: 2;
}

/* ---- Wrapper ---- */
.ep-player-wrapper {
    background: var(--ep-bg);
    border-radius: var(--ep-wrapper-border-radius);
    border: var(--ep-wrapper-border-width) var(--ep-wrapper-border-style) var(--ep-wrapper-border-color);
    padding: 36px 0 28px;
    width: var(--ep-wrapper-width);
    height: var(--ep-wrapper-height);
    overflow: hidden;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.ep-no-tracks {
    text-align: center; padding: 40px; color: #888; font-style: italic;
}

/* ---- Album Title Label ---- */
.ep-album-label {
    text-align: center;
    margin-bottom: 22px;
    padding: 0 20px;
}
.ep-album-label__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ep-text);
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.ep-album-label__artist {
    font-size: 13px;
    color: var(--ep-muted);
    margin-top: 3px;
    letter-spacing: 0.03em;
}

/* ---- Carousel ---- */
.ep-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px 40px 20px;
    user-select: none;
    perspective: 1200px;
}
.ep-carousel-track-wrap {
    flex: 1;
    overflow: visible;
    cursor: grab;
    touch-action: pan-y;
}
.ep-carousel-track-wrap.ep-dragging { cursor: grabbing; }
.ep-carousel-track {
    display: flex;
    gap: var(--ep-card-gap);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    align-items: center;
}
.ep-carousel-track.ep-no-transition { transition: none !important; }

/* ---- Navigation ---- */
.ep-nav { display: none !important; }

/* ---- Dots ---- */
.ep-dots {
    display: flex;
    justify-content: center;
    gap: var(--ep-dot-gap);
    margin-top: 20px;
    padding: 0 20px;
    flex-wrap: wrap;
}
.ep-dot {
    width: var(--ep-dot-size);
    height: var(--ep-dot-size);
    border-radius: var(--ep-dot-radius);
    background: var(--ep-dot-color);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--ep-transition), transform var(--ep-transition);
    flex-shrink: 0;
}
.ep-dot:hover { background: rgba(255,255,255,0.6); }
.ep-dot.ep-dot-active {
    background: var(--ep-dot-active-color);
    transform: scale(1.4);
}

/* ---- Card ---- */
.ep-card {
    flex: 0 0 var(--ep-card-width, calc((100% - 2 * var(--ep-card-gap)) / 3));
    background: var(--ep-card-bg);
    border: var(--ep-card-border-width) var(--ep-card-border-style) var(--ep-card-border-color);
    border-radius: var(--ep-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, background 0.3s ease, border-color 0.3s ease, opacity 0.4s ease;
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: var(--ep-shadow);
    min-width: 0;
    transform-origin: bottom center;
}

/* Side cards appear slightly rotated and smaller (spatial depth effect) */
.ep-carousel-track .ep-card:not(.ep-active) {
    opacity: 0.72;
    transform: scale(0.88) translateY(10px);
}
.ep-carousel-track .ep-card.ep-active {
    opacity: 1;
    transform: scale(1) translateY(0px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 32px 80px rgba(0,0,0,0.65), 0 8px 24px rgba(0,0,0,0.4);
    z-index: 10;
    position: relative;
}
.ep-card:hover {
    opacity: 1 !important;
    transform: translateY(var(--ep-card-hover-translateY)) scale(var(--ep-card-hover-scale)) !important;
    box-shadow: var(--ep-card-hover-shadow);
    border-color: rgba(255,255,255,0.35);
}

/* ---- Cover ---- */
.ep-cover-wrap {
    position: relative;
    width: var(--ep-cover-width);
    padding-bottom: var(--ep-cover-aspect);
    overflow: hidden;
    background: transparent;
    border: var(--ep-cover-border-width) var(--ep-cover-border-style) var(--ep-cover-border-color);
    border-radius: var(--ep-cover-border-radius);
    flex-shrink: 0;
}
.ep-cover-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: var(--ep-cover-fit);
    transition: transform 0.5s ease, filter 0.5s ease;
}
.ep-card:hover .ep-cover-wrap img {
    transform: scale(var(--ep-cover-hover-scale));
    filter: brightness(var(--ep-cover-hover-brightness));
}
.ep-cover-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
}
.ep-cover-placeholder svg { width: 60%; height: 60%; }
.ep-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,0.55) 100%);
}

/* Gap spacer */
.ep-cover-bar-spacer {
    height: var(--ep-cover-bar-gap);
    flex-shrink: 0;
    display: block;
}

/* ---- Player Bar ---- */
.ep-player-bar {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--ep-bar-bg);
    border: var(--ep-bar-border-width) var(--ep-bar-border-style) var(--ep-bar-border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex: 1;
}
.ep-track-info {
    display: flex; flex-direction: column; gap: 3px;
    text-align: var(--ep-text-align);
}
.ep-track-title {
    font-size: 12px; font-weight: 700; color: var(--ep-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: 0.06em; text-transform: uppercase;
}
.ep-track-artist {
    font-size: 10px; color: var(--ep-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: 0.02em;
}

/* ---- Controls ---- */
.ep-controls {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    background: var(--ep-controls-bg);
    border: var(--ep-controls-border-width) var(--ep-controls-border-style) var(--ep-controls-border-color);
    padding: 4px 0;
}

/* ---- Base Button ---- */
.ep-btn {
    background: transparent;
    border: none;
    color: var(--ep-text);
    cursor: pointer;
    padding: 0; line-height: 1; font-size: 13px;
    transition: color var(--ep-transition), transform var(--ep-transition), opacity var(--ep-transition);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ep-btn:hover {
    transform: scale(var(--ep-btn-hover-scale));
    color: var(--ep-btn-hover-color);
}
.ep-btn svg { display: block; pointer-events: none; }

/* ---- Glossy Circle (Spatial UI Buttons) ---- */
.ep-btn.ep-glossy-circle {
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.30) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.15) inset, 0 -1px 0 rgba(0,0,0,0.25) inset;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.ep-btn.ep-glossy-circle::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: var(--ep-glossy-tint, rgba(255,255,255,0.18));
    pointer-events: none; z-index: 0;
}
.ep-btn.ep-glossy-circle::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    border-radius: 50% 50% 0 0 / 50% 50% 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.04) 100%);
    pointer-events: none; z-index: 1;
}
.ep-btn.ep-glossy-circle svg,
.ep-btn.ep-glossy-circle span { position: relative; z-index: 2; }
.ep-btn.ep-glossy-circle:hover {
    transform: scale(var(--ep-btn-hover-scale, 1.10));
    box-shadow: 0 6px 22px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.22) inset, 0 -1px 0 rgba(0,0,0,0.3) inset;
    opacity: 1;
}
.ep-btn.ep-glossy-circle:active { transform: scale(0.95); }

.ep-play-pause.ep-glossy-circle { width: 48px; height: 48px; }
.ep-prev-track.ep-glossy-circle,
.ep-next-track.ep-glossy-circle { width: 38px; height: 38px; opacity: 0.82; }
.ep-prev-track.ep-glossy-circle:hover,
.ep-next-track.ep-glossy-circle:hover { opacity: 1; }

/* ---- Progress ---- */
.ep-progress-wrap { display: flex; align-items: center; gap: 8px; }
.ep-current-time,
.ep-duration {
    font-size: 10px; color: var(--ep-muted);
    white-space: nowrap; min-width: 30px;
    font-variant-numeric: tabular-nums;
}
.ep-duration { text-align: right; }
.ep-progress-bar {
    flex: 1; position: relative; height: 3px;
    background: var(--ep-bar);
    border-radius: 99px; cursor: pointer; overflow: hidden;
    transition: height 0.2s ease;
}
.ep-progress-bar:hover { height: 5px; }
.ep-progress-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--ep-bar-fill);
    border-radius: 99px; width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}
.ep-seeker {
    position: absolute; inset: -6px 0;
    width: 100%; height: 16px;
    opacity: 0; cursor: pointer; margin: 0; padding: 0;
}
.ep-progress-bar:hover .ep-progress-fill {
    background: linear-gradient(90deg, var(--ep-progress-hover-fill, #a78bfa), var(--ep-bar-fill));
}

/* ---- Playing animation ---- */
.ep-card.ep-playing .ep-cover-wrap::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(108,99,255,0.1);
    animation: ep-pulse 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ep-pulse {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}
.ep-audio { display: none; }

/* ---- Frosted Pill Nav Bar ---- */
.ep-nav-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 28px;
    padding: 6px 20px;
    flex-wrap: wrap;
}
.ep-nav-bar__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    background: transparent;
    letter-spacing: 0.02em;
    font-family: inherit;
}
.ep-nav-bar__item:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.ep-nav-bar__item.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}
.ep-nav-bar__icon {
    width: 14px; height: 14px;
    opacity: 0.85;
    flex-shrink: 0;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 900px) {
    .ep-card { flex: 0 0 calc(50% - var(--ep-card-gap) / 2) !important; }
    .ep-carousel-track .ep-card:not(.ep-active) { opacity: 0.8; transform: scale(0.92) translateY(6px); }
}
@media (max-width: 560px) {
    .ep-card { flex: 0 0 calc(90% - var(--ep-card-gap) / 2) !important; }
    .ep-carousel-container { padding: 16px 10px 20px; }
    .ep-carousel-track .ep-card:not(.ep-active) { opacity: 0.85; transform: scale(0.96) translateY(4px); }
}
