/* ==========================================
   REDESIGNED MUSIC PLAYER (Music Box Style)
   - Smaller size, enhanced title
   ========================================== */

/* ==========================================
   ENHANCED TITLE SECTION
   ========================================== */
.title-section {
    position: relative;
    margin-bottom: 2rem;
}

.title-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.title-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(179, 57, 57, 0.4), transparent);
    position: relative;
}

.title-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: rgba(179, 57, 57, 0.3);
    border-radius: 50%;
}

.title-diamond {
    color: #b33939;
    opacity: 0.5;
    font-size: 14px;
}

.main-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 300;
    font-style: italic;
    color: #2d2926;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-align: center;
}

.main-title span {
    font-weight: 500;
    color: #b33939;
    font-style: normal;
    position: relative;
}

.main-title span::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(179, 57, 57, 0.3), transparent);
}

.title-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: #2d2926;
    opacity: 0.5;
    text-align: center;
    margin-top: 0.75rem;
    letter-spacing: 0.03em;
}

/* ==========================================
   TRACK INFO (Below music box)
   ========================================== */
.track-info-card {
    position: absolute;
    bottom: -55px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(245, 241, 232, 0.9) 100%);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow:
        0 6px 20px -5px rgba(0, 0, 0, 0.15),
        0 2px 6px -2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(179, 57, 57, 0.15);
    text-align: center;
    min-width: 160px;
    z-index: 20;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.track-info-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(255, 255, 255, 0.95);
}

.track-song-title {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: #2d2926;
    line-height: 1.2;
    margin-bottom: 1px;
}

.track-artist {
    font-family: 'Cormorant Garamond', serif;
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #b33939;
    opacity: 0.8;
}

/* Side labels */
.track-side-label {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-family: 'Cormorant Garamond', serif;
    font-size: 9px;
    letter-spacing: 0.3em;
    color: rgba(212, 175, 55, 0.5);
    text-transform: uppercase;
    pointer-events: none;
}

.track-catalog-number {
    position: absolute;
    right: -25px;
    bottom: 50px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 8px;
    letter-spacing: 0.15em;
    color: rgba(212, 175, 55, 0.4);
    transform: rotate(90deg);
    pointer-events: none;
}

/* ==========================================
   MUSIC BOX CONTAINER (SMALLER)
   ========================================== */
.music-box-container {
    position: relative;
    width: 85vw;
    max-width: 360px;
    perspective: 1000px;
}

/* Wooden Base */
.music-box-base {
    position: relative;
    background: linear-gradient(145deg,
            #3d3229 0%,
            #2d2420 30%,
            #3d3229 50%,
            #2d2420 70%,
            #3d3229 100%);
    border-radius: 16px;
    padding: 18px 18px 22px 18px;
    box-shadow:
        0 25px 50px -10px rgba(0, 0, 0, 0.4),
        0 12px 20px -5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -3px 10px rgba(0, 0, 0, 0.3);
    overflow: visible;
}

.music-box-base::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(139, 90, 43, 0.05) 3px, rgba(139, 90, 43, 0.05) 6px);
    pointer-events: none;
}

.music-box-base::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    pointer-events: none;
}

/* Inner Lining */
.music-box-interior {
    position: relative;
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 50%, #151515 100%);
    border-radius: 10px;
    padding: 24px 18px 32px 18px;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.8), inset 0 -2px 5px rgba(255, 255, 255, 0.05);
}

.music-box-interior::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(179, 57, 57, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(179, 57, 57, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ==========================================
   VINYL RECORD (SMALLER)
   ========================================== */
.vinyl-record {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #f5f1e8 0%, #f5f1e8 22%, transparent 22.5%),
        repeating-radial-gradient(circle at center, #0a0a0a 0px, #0a0a0a 1px, #141414 1px, #141414 2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.vinyl-record:hover {
    transform: scale(1.02);
}

.vinyl-record.playing {
    animation: vinylSpin 1.8s linear infinite;
}

@keyframes vinylSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.vinyl-record::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%, transparent 60%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.vinyl-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5f1e8 0%, #e8e4d9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.5);
}

.vinyl-label::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 1px solid rgba(179, 57, 57, 0.3);
}

.vinyl-label::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(45, 41, 38, 0.15);
}

.vinyl-label-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 8px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #b33939;
    text-align: center;
    line-height: 1.4;
}

.vinyl-label-title {
    font-family: 'Caveat', cursive;
    font-size: 14px;
    color: #2d2926;
    margin-top: 2px;
    transform: rotate(-2deg);
}

.vinyl-spindle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 7px;
    background: #0d0d0d;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ==========================================
   TONE ARM (ADJUSTED)
   ========================================== */
.tone-arm-container {
    position: absolute;
    top: 16px;
    right: 24px;
    width: 50px;
    height: 115px;
    z-index: 10;
}

.tone-arm-pivot {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #c9b896 0%, #a08b6d 50%, #8b7355 100%);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.tone-arm {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 85px;
    background: linear-gradient(90deg, #a0a0a0 0%, #d0d0d0 30%, #e0e0e0 50%, #d0d0d0 70%, #a0a0a0 100%);
    border-radius: 4px;
    transform-origin: top center;
    transform: rotate(-30deg);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.tone-arm.playing {
    transform: rotate(15deg);
}

.tone-arm::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 17px;
    background: linear-gradient(145deg, #2d2926, #1a1a1a);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   CONTROLS (ADJUSTED)
   ========================================== */
.control-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.play-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5f1e8 0%, #e8e4d9 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.play-button::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1px solid rgba(179, 57, 57, 0.2);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.play-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.play-button .icon-play,
.play-button .icon-pause {
    color: #b33939;
    font-size: 22px;
    transition: all 0.3s ease;
}

.play-button .icon-pause {
    display: none;
}

.play-button.playing .icon-play {
    display: none;
}

.play-button.playing .icon-pause {
    display: block;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-icon {
    color: rgba(245, 241, 232, 0.6);
    font-size: 16px;
}

.volume-slider {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(245, 241, 232, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: linear-gradient(145deg, #f5f1e8, #e8e4d9);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

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

/* ==========================================
   VISUALIZER
   ========================================== */
.visualizer {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
    opacity: 0.4;
}

.visualizer-bar {
    width: 3px;
    background: linear-gradient(to top, #b33939, transparent);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.visualizer-bar:nth-child(1) {
    height: 7px;
}

.visualizer-bar:nth-child(2) {
    height: 12px;
}

.visualizer-bar:nth-child(3) {
    height: 9px;
}

.visualizer-bar:nth-child(4) {
    height: 14px;
}

.visualizer-bar:nth-child(5) {
    height: 5px;
}

.music-box-container.playing .visualizer-bar {
    animation: visualize 0.5s ease-in-out infinite alternate;
}

.music-box-container.playing .visualizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.music-box-container.playing .visualizer-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.music-box-container.playing .visualizer-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.music-box-container.playing .visualizer-bar:nth-child(4) {
    animation-delay: 0.15s;
}

.music-box-container.playing .visualizer-bar:nth-child(5) {
    animation-delay: 0.05s;
}

@keyframes visualize {
    0% {
        height: 4px;
        opacity: 0.3;
    }

    100% {
        height: 16px;
        opacity: 0.8;
    }
}

/* ==========================================
   HAND-DRAWN ARROW
   ========================================== */
.music-box-arrow {
    position: absolute;
    top: 16px;
    right: -90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.music-box-arrow-text {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: #2d2926;
    opacity: 0.6;
    transform: rotate(-5deg);
    margin-bottom: 4px;
}

.music-box-arrow svg {
    opacity: 0.4;
    transform: rotate(-15deg);
}

/* ==========================================
   CONTINUE BUTTON
   ========================================== */
.music-continue-btn {
    margin-top: 80px;
    padding: 12px 32px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 241, 232, 0.9) 100%);
    border: 1px solid rgba(179, 57, 57, 0.2);
    border-radius: 30px;
    font-family: 'Crimson Pro', serif;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #2d2926;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.15), 0 3px 8px -2px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.music-continue-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.music-continue-btn:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 5px 10px -2px rgba(0, 0, 0, 0.1);
    border-color: rgba(179, 57, 57, 0.35);
}

.music-continue-btn:active {
    transform: translateY(0);
}

.music-continue-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: #b33939;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.music-continue-brand:hover {
    opacity: 0.8;
}

.music-continue-brand span {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .music-box-base {
        padding: 16px 14px 20px 14px;
    }

    .music-box-interior {
        padding: 20px 16px 28px 16px;
    }

    .vinyl-record {
        width: 170px;
        height: 170px;
    }

    .vinyl-label {
        width: 72px;
        height: 72px;
    }

    .vinyl-label-text {
        font-size: 7px;
    }

    .vinyl-label-title {
        font-size: 12px;
    }

    .tone-arm-container {
        right: 18px;
        width: 45px;
        height: 100px;
    }

    .tone-arm {
        height: 75px;
    }

    .play-button {
        width: 48px;
        height: 48px;
    }

    .play-button .icon-play,
    .play-button .icon-pause {
        font-size: 20px;
    }

    .volume-slider {
        width: 50px;
    }

    .music-box-arrow {
        display: none;
    }

    .title-ornament {
        gap: 0.75rem;
    }

    .title-line {
        width: 40px;
    }

    .main-title {
        font-size: 2rem;
    }

    .title-subtitle {
        font-size: 1rem;
    }

    .track-info-card {
        min-width: 140px;
        padding: 8px 14px;
        bottom: -48px;
    }

    .track-song-title {
        font-size: 16px;
    }

    .track-artist {
        font-size: 8px;
    }

    .track-side-label,
    .track-catalog-number {
        display: none;
    }

    .music-continue-btn {
        margin-top: 70px;
        padding: 10px 28px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
}

.animate-music-box-in {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ==========================================
   TRACK NAVIGATION BUTTONS
   ========================================== */
.track-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(245, 241, 232, 0.15) 0%, rgba(200, 196, 187, 0.1) 100%);
    border: 1px solid rgba(245, 241, 232, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.track-nav-btn:hover {
    background: rgba(245, 241, 232, 0.25);
    transform: scale(1.1);
}

.track-nav-btn:active {
    transform: scale(0.95);
}

.track-nav-btn .material-symbols-outlined {
    color: rgba(245, 241, 232, 0.8);
    font-size: 20px;
}

/* Track Counter */
.track-counter {
    font-family: 'Cormorant Garamond', serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: rgba(45, 41, 38, 0.5);
    margin-top: 6px;
}

.track-counter #currentTrackNum {
    font-weight: 600;
    color: #b33939;
}

/* Mobile adjustments for track nav */
@media (max-width: 480px) {
    .track-nav-btn {
        width: 32px;
        height: 32px;
    }

    .track-nav-btn .material-symbols-outlined {
        font-size: 18px;
    }

    .control-panel {
        gap: 12px;
    }
}