@import url("../leather-seam-asset-path.css");

/* project/music_player.css — Messages page + iOS 6 Messenger glossy (spinning CD.png from site root) */

.music-player-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    margin: 1rem auto;
    padding: 0;
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    font-family: Helvetica, Arial, sans-serif;
}

/* Leather outer frame — matches messages/messages-container */
.music-player-container.skeuo-plate.music-player-ms {
    background-color: #d0b589;
    background-image:
        linear-gradient(135deg, rgba(212, 190, 156, 0.52) 0%, rgba(242, 232, 212, 0.45) 50%, rgba(212, 190, 156, 0.52) 100%),
        var(--leather-seam-png);
    background-size: 100% 100%, var(--leather-tile-size) var(--leather-tile-size);
    background-repeat: no-repeat, repeat;
    background-blend-mode: multiply, normal;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    border: 3px solid #958062;
    padding: 10px;
}

.music-player-container.skeuo-plate.music-player-ms::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
    border-radius: 14px 14px 0 0;
    pointer-events: none;
    z-index: 2;
}

.music-player-ms-shell {
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #e8e8ed;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Blue nav bar — matches messages .chat-header */
.music-player-ms-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(
        to bottom,
        #5c9fd6 0%,
        #3a7fc0 45%,
        #2868a8 51%,
        #4080be 100%
    );
    border-bottom: 1px solid #1f5090;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #fff;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.music-player-ms-header::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.music-player-ms-header-glyph {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.1));
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.music-player-ms-header-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.music-player-ms-header-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.92;
}

.music-player-ms-header-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat strip — matches .chat-messages */
.music-player-ms-chat {
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    background: #dce0e8;
}

.music-player-cd-row {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

/* CD + label spin together */
.music-player-cd-spin {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.music-player-cd-disc {
    width: 220px;
    height: 220px;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.music-player-container.playing .music-player-cd-spin {
    animation: music-player-cd-spin 3.2s linear infinite;
}

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

/* Green sent bubble — matches messages .message.sent */
.music-player-ms-chat .message.sent.music-player-track-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 100%;
    align-self: flex-end;
    position: relative;
    line-height: 1.4;
    background: linear-gradient(to bottom, #9fe070 0%, #5cbf2a 45%, #44aa18 51%, #65cc35 100%);
    border: 1px solid #2d8010;
    color: #fff;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.3);
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.music-player-ms-chat .message.sent.music-player-track-bubble::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

.music-player-ms-chat .message.sent.music-player-track-bubble::before {
    content: "";
    position: absolute;
    bottom: 0;
    right: -6px;
    width: 0;
    height: 0;
    border-top: 10px solid #44aa18;
    border-left: 10px solid transparent;
}

.music-player-track-bubble .message-content {
    position: relative;
    z-index: 1;
}

.music-player-track-bubble .song-title {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.35);
}

.music-player-track-bubble .artist-name {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95) !important;
}

.music-player-vu-wrap {
    border-radius: 12px;
    padding: 6px;
    background: linear-gradient(to bottom, #f0f2f5 0%, #d8dce3 100%);
    border: 1px solid #9aa4b4;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.6);
}

.audio-visualizer {
    display: block;
    width: 100%;
    height: 72px;
    border-radius: 8px;
    background: #c5ccd6;
    border: 1px solid #a8b0bc;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(to bottom, #f5f6f8 0%, #d8dce3 100%);
    border: 1px solid #8a9ab0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.7);
    color: #2a3a50;
}

.time-display .current-time,
.time-display .total-time {
    font-weight: 700;
}

.time-display .sep {
    opacity: 0.55;
}

.progress-bar-container {
    height: 18px;
    border-radius: 10px;
    padding: 3px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #b8c0cc 0%, #d0d6de 100%);
    border: 1px solid #8a9ab0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.5);
}

.progress-bar {
    height: 100%;
    width: 100%;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.06);
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    border-radius: 7px;
    background: linear-gradient(
        to bottom,
        #7dc9f8 0%,
        #45a8f0 45%,
        #2e8fd8 51%,
        #4aabf5 100%
    );
    border: 1px solid #1a6aaa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: width 0.08s linear;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* iOS 6 glossy blue play — matches messages search button */
.control-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid #1a6aaa;
    display: grid;
    place-items: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    background: linear-gradient(to bottom, #7dc9f8 0%, #45a8f0 45%, #2e8fd8 51%, #4aabf5 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    position: relative;
    overflow: hidden;
}

.control-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    border-radius: 50%;
    pointer-events: none;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.control-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.control-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.35));
    position: relative;
    z-index: 1;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #8a9ab0;
    background: linear-gradient(to bottom, #d8dce4 0%, #c0c5cf 45%, #b0b8c4 51%, #cdd2da 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
    position: relative;
    overflow: hidden;
}

.volume-control::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.volume-icon {
    width: 24px;
    height: 24px;
    fill: #2a3a50;
    stroke: #2a3a50;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 96px;
    height: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #8a9ab0;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #e8ecf2 0%, #b8c0cc 100%);
    border: 1px solid #6a7588;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #e8ecf2 0%, #b8c0cc 100%);
    border: 1px solid #6a7588;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (max-width: 520px) {
    .music-player-container.skeuo-plate.music-player-ms {
        margin-left: 0;
        margin-right: 0;
    }
    .music-player-cd-spin,
    .music-player-cd-disc {
        width: 190px;
        height: 190px;
    }
}
