/* =====================================================
   MODERN FLIP CLOCK – MUSIC VISUALIZER CSS
   ===================================================== */

.music-player-card {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    position: relative;
    overflow: hidden;
}

.music-player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-3), var(--clr-accent-2));
    animation: musicBorder 3s linear infinite;
    background-size: 200% 100%;
}

@keyframes musicBorder {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

.music-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.music-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--clr-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.music-section-title .bi {
    color: var(--clr-accent);
}

/* ---- Visualizer ---- */
.music-visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 56px;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.viz-bar {
    width: 4px;
    min-height: 4px;
    background: linear-gradient(180deg, var(--clr-accent), var(--clr-accent-3));
    border-radius: 2px;
    transition: height 0.1s ease;
    transform-origin: bottom;
}

.viz-bar.active {
    animation: vizDance var(--viz-speed, 0.8s) ease infinite alternate;
}

.viz-bar:nth-child(1) {
    animation-delay: 0.00s;
    --vh: 15px;
}

.viz-bar:nth-child(2) {
    animation-delay: 0.05s;
    --vh: 28px;
}

.viz-bar:nth-child(3) {
    animation-delay: 0.10s;
    --vh: 40px;
}

.viz-bar:nth-child(4) {
    animation-delay: 0.15s;
    --vh: 52px;
}

.viz-bar:nth-child(5) {
    animation-delay: 0.20s;
    --vh: 44px;
}

.viz-bar:nth-child(6) {
    animation-delay: 0.25s;
    --vh: 36px;
}

.viz-bar:nth-child(7) {
    animation-delay: 0.30s;
    --vh: 50px;
}

.viz-bar:nth-child(8) {
    animation-delay: 0.35s;
    --vh: 56px;
}

.viz-bar:nth-child(9) {
    animation-delay: 0.40s;
    --vh: 48px;
}

.viz-bar:nth-child(10) {
    animation-delay: 0.45s;
    --vh: 38px;
}

.viz-bar:nth-child(11) {
    animation-delay: 0.50s;
    --vh: 30px;
}

.viz-bar:nth-child(12) {
    animation-delay: 0.55s;
    --vh: 44px;
}

.viz-bar:nth-child(13) {
    animation-delay: 0.60s;
    --vh: 56px;
}

.viz-bar:nth-child(14) {
    animation-delay: 0.65s;
    --vh: 46px;
}

.viz-bar:nth-child(15) {
    animation-delay: 0.70s;
    --vh: 34px;
}

.viz-bar:nth-child(16) {
    animation-delay: 0.75s;
    --vh: 22px;
}

.viz-bar:nth-child(17) {
    animation-delay: 0.80s;
    --vh: 40px;
}

.viz-bar:nth-child(18) {
    animation-delay: 0.85s;
    --vh: 52px;
}

.viz-bar:nth-child(19) {
    animation-delay: 0.90s;
    --vh: 32px;
}

.viz-bar:nth-child(20) {
    animation-delay: 0.95s;
    --vh: 18px;
}

.viz-bar:nth-child(21) {
    animation-delay: 1.00s;
    --vh: 42px;
}

.viz-bar:nth-child(22) {
    animation-delay: 1.05s;
    --vh: 54px;
}

.viz-bar:nth-child(23) {
    animation-delay: 1.10s;
    --vh: 38px;
}

.viz-bar:nth-child(24) {
    animation-delay: 1.15s;
    --vh: 24px;
}

.viz-bar:nth-child(25) {
    animation-delay: 1.20s;
    --vh: 14px;
}

@keyframes vizDance {
    0% {
        height: 4px;
    }

    100% {
        height: var(--vh, 30px);
    }
}

.music-visualizer.paused .viz-bar.active {
    animation-play-state: paused;
    height: 4px !important;
}

/* ---- Track Info ---- */
.track-info {
    text-align: center;
    margin-bottom: 1rem;
}

.track-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.track-name .bi-music-note-beamed {
    color: var(--clr-accent);
    animation: spinNote 2s linear infinite;
}

@keyframes spinNote {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

.track-type {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
}

/* ---- Progress Bar ---- */
.music-progress-wrap {
    margin-bottom: 1rem;
}

.music-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--clr-border);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.music-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-3));
    transition: width 0.5s linear;
    position: relative;
}

.music-progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--clr-accent);
    box-shadow: 0 0 8px var(--clr-accent);
    transition: transform var(--trans-fast);
}

.music-progress-wrap:hover .music-progress-fill::after {
    transform: scale(1.4);
}

.music-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--clr-text-muted);
    margin-top: 0.25rem;
}

/* ---- Controls Row ---- */
.music-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.music-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--clr-text-secondary);
    font-size: 1.1rem;
    transition: all var(--trans-fast);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    color: var(--clr-accent);
    transform: scale(1.15);
}

.music-btn-play {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
    color: #fff !important;
    border-radius: 50%;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}

.music-btn-play:hover {
    transform: scale(1.12) !important;
    filter: brightness(1.15);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);
}

.music-btn.active {
    color: var(--clr-accent);
}

/* ---- Volume Row ---- */
.music-volume-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.music-vol-icon {
    color: var(--clr-text-muted);
    font-size: 1rem;
    min-width: 20px;
}

.music-vol-slider {
    flex: 1;
}

/* ---- Ambient Sounds Grid ---- */
.ambient-section {
    margin-top: 1rem;
}

.ambient-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--clr-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.65rem;
}

.ambient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.ambient-btn {
    background: var(--clr-bg-glass);
    border: 1px solid var(--clr-border);
    border-radius: 0.7rem;
    padding: 0.6rem 0.4rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--trans-fast);
    font-family: var(--font-ui);
    color: var(--clr-text-secondary);
}

.ambient-btn:hover {
    border-color: var(--clr-accent);
    color: var(--clr-accent);
}

.ambient-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--clr-accent);
    color: var(--clr-accent);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.ambient-btn .amb-icon {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 0.25rem;
}

.ambient-btn .amb-name {
    font-size: 0.68rem;
    font-weight: 600;
    display: block;
}

/* Mix mode indicator */
.mix-indicator {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

.mix-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--clr-accent);
    border-radius: 99px;
    padding: 0.1rem 0.5rem;
    font-size: 0.68rem;
    color: var(--clr-accent);
    margin: 0.15rem;
}

/* ---- Transport (auto-stop timer) ---- */
.auto-stop-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.auto-stop-label {
    font-size: 0.78rem;
    color: var(--clr-text-muted);
}

.auto-stop-btn {
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    border: 1px solid var(--clr-border);
    background: var(--clr-bg-glass);
    color: var(--clr-text-secondary);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--trans-fast);
    font-family: var(--font-ui);
}

.auto-stop-btn.active {
    background: var(--clr-accent);
    border-color: var(--clr-accent);
    color: #fff;
}