/**
 * Media Player Styles
 * Clean, modern styling for the Celtic Fiddlers music player
 */

/* ===== CSS Variables ===== */
:root {
    --mp-primary: #0d7f3e;
    --mp-primary-hover: #0a6030;
    --mp-bg-dark: #121212;
    --mp-bg-card: #1a1a1a;
    --mp-bg-hover: #252525;
    --mp-text: #ffffff;
    --mp-text-muted: #a0a0a0;
    --mp-border: #333333;
    --mp-radius: 8px;
    --mp-radius-lg: 12px;
}

/* ===== Component Container ===== */
.media-player-component {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== Modal Overlay ===== */
.mp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== Modal Container ===== */
.mp-modal {
    background: var(--mp-bg-dark);
    border-radius: var(--mp-radius-lg);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* ===== Modal Header ===== */
.mp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--mp-primary) 0%, var(--mp-primary-hover) 100%);
    color: white;
}

.mp-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.mp-modal-title i {
    font-size: 1.2rem;
}

.mp-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--mp-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mp-close-btn:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* ===== Modal Content Layout ===== */
.mp-modal-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===== Albums Panel (Sidebar) ===== */
.mp-albums-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--mp-bg-card);
    border-right: 1px solid var(--mp-border);
    display: flex;
    flex-direction: column;
}

.mp-panel-title {
    padding: 16px 20px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--mp-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-albums-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.mp-album-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--mp-radius);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.mp-album-item:hover {
    background: var(--mp-bg-hover);
}

.mp-album-item.active {
    background: rgba(13, 127, 62, 0.2);
}

.mp-album-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.mp-album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-album-placeholder {
    width: 100%;
    height: 100%;
    background: var(--mp-bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mp-text-muted);
}

.mp-album-playing-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--mp-primary);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.mp-album-info {
    flex: 1;
    min-width: 0;
}

.mp-album-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-album-meta {
    font-size: 0.75rem;
    color: var(--mp-text-muted);
    margin-top: 2px;
}

/* ===== Main Content Panel ===== */
.mp-main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px;
    background: var(--mp-bg-dark);
}

/* ===== Album Header ===== */
.mp-album-header {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.mp-album-cover-large {
    width: 200px;
    height: 200px;
    border-radius: var(--mp-radius);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.mp-album-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-album-placeholder-large {
    width: 100%;
    height: 100%;
    background: var(--mp-bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mp-text-muted);
    font-size: 3rem;
}

.mp-album-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mp-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mp-text-muted);
    margin-bottom: 8px;
}

.mp-album-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--mp-text);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.mp-album-year {
    font-size: 0.9rem;
    color: var(--mp-text-muted);
    margin-bottom: 4px;
}

.mp-album-stats {
    font-size: 0.85rem;
    color: var(--mp-text-muted);
    margin-bottom: 16px;
}

.mp-play-album-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mp-primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mp-play-album-btn:hover {
    background: var(--mp-primary-hover);
    transform: scale(1.02);
}

/* ===== Tracks Section ===== */
.mp-tracks-section {
    flex: 1;
}

.mp-tracks-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mp-text);
    margin: 0 0 16px 0;
}

.mp-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mp-track-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--mp-radius);
    cursor: pointer;
    transition: background 0.2s;
}

.mp-track-item:hover {
    background: var(--mp-bg-hover);
}

.mp-track-item:hover .mp-track-play-icon {
    opacity: 1;
}

.mp-track-item.active {
    background: rgba(13, 127, 62, 0.15);
}

.mp-track-number {
    width: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--mp-text-muted);
}

.mp-playing-icon {
    color: var(--mp-primary);
    animation: pulse 1.5s infinite;
}

.mp-paused-icon {
    color: var(--mp-text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mp-track-info {
    flex: 1;
    min-width: 0;
}

.mp-track-title {
    font-size: 0.95rem;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-track-play-icon {
    opacity: 0;
    color: var(--mp-text-muted);
    transition: opacity 0.2s;
}

/* ===== Empty States ===== */
.mp-empty-state,
.mp-empty-state-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--mp-text-muted);
    text-align: center;
}

.mp-empty-state i,
.mp-empty-state-large i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.mp-empty-state-large {
    flex: 1;
}

.mp-empty-state-large h3 {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
    color: var(--mp-text);
}

.mp-empty-state-large p {
    margin: 0;
    font-size: 0.9rem;
}

/* ===== Modal Footer (Now Playing Bar) ===== */
.mp-modal-footer {
    border-top: 1px solid var(--mp-border);
    background: var(--mp-bg-card);
}

.mp-now-playing-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
}

.mp-now-playing-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 220px;
    flex-shrink: 0;
}

.mp-np-cover {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
}

.mp-np-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-np-placeholder {
    width: 100%;
    height: 100%;
    background: var(--mp-bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mp-text-muted);
}

.mp-np-details {
    flex: 1;
    min-width: 0;
}

.mp-np-track {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-np-album {
    font-size: 0.8rem;
    color: var(--mp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Controls Center ===== */
.mp-controls-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mp-control-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-ctrl-btn {
    background: transparent;
    border: none;
    color: var(--mp-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.mp-ctrl-btn:hover {
    color: var(--mp-text);
    background: var(--mp-bg-hover);
}

.mp-ctrl-btn.active {
    color: var(--mp-primary);
}

.mp-ctrl-btn.mp-play-btn {
    background: var(--mp-primary);
    color: white;
    width: 42px;
    height: 42px;
}

.mp-ctrl-btn.mp-play-btn:hover {
    background: var(--mp-primary-hover);
    transform: scale(1.05);
}

.mp-repeat-one {
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    bottom: 4px;
    right: 4px;
}

/* ===== Progress Bar ===== */
.mp-progress-bar {
    width: 100%;
    max-width: 500px;
    height: 6px;
    cursor: pointer;
}

.mp-progress-track {
    width: 100%;
    height: 100%;
    background: var(--mp-border);
    border-radius: 3px;
    overflow: hidden;
}

.mp-progress-fill {
    height: 100%;
    background: var(--mp-primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.mp-time-display {
    display: flex;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--mp-text-muted);
}

/* ===== Volume Control ===== */
.mp-controls-right {
    width: 160px;
    display: flex;
    justify-content: flex-end;
}

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

.mp-volume-slider {
    width: 80px;
    height: 6px;
    cursor: pointer;
}

.mp-volume-track {
    width: 100%;
    height: 100%;
    background: var(--mp-border);
    border-radius: 3px;
    overflow: hidden;
}

.mp-volume-fill {
    height: 100%;
    background: var(--mp-text-muted);
    border-radius: 3px;
}

/* ===== Mini Player (Persistent Bottom Bar) ===== */
.mp-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mp-bg-card);
    border-top: 1px solid var(--mp-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    z-index: 9998;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mp-mini-cover {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.mp-mini-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-mini-placeholder {
    width: 100%;
    height: 100%;
    background: var(--mp-bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mp-text-muted);
}

.mp-mini-info {
    flex: 0 0 180px;
    min-width: 0;
}

.mp-mini-track {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-mini-album {
    font-size: 0.8rem;
    color: var(--mp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-mini-progress {
    flex: 1;
    padding: 0 20px;
}

.mp-mini-progress-bar {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--mp-border);
    border-radius: 3px;
    overflow: hidden;
}

.mp-mini-progress-fill {
    height: 100%;
    background: var(--mp-primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.mp-mini-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mp-mini-btn {
    background: transparent;
    border: none;
    color: var(--mp-text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
}

.mp-mini-btn:hover {
    color: var(--mp-text);
    background: var(--mp-bg-hover);
}

.mp-mini-btn.mp-mini-play {
    background: var(--mp-primary);
    color: white;
    width: 44px;
    height: 44px;
}

.mp-mini-btn.mp-mini-play:hover {
    background: var(--mp-primary-hover);
}

.mp-mini-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
    .mp-modal-content {
        flex-direction: column;
    }

    .mp-albums-panel {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--mp-border);
    }

    .mp-albums-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding: 12px;
    }

    .mp-album-item {
        flex-direction: column;
        width: 100px;
        text-align: center;
        padding: 8px;
        flex-shrink: 0;
    }

    .mp-album-thumb {
        width: 80px;
        height: 80px;
    }

    .mp-album-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mp-album-cover-large {
        width: 160px;
        height: 160px;
    }

    .mp-album-details {
        align-items: center;
    }

    .mp-album-name {
        font-size: 1.5rem;
    }

    .mp-now-playing-bar {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .mp-now-playing-info {
        width: 100%;
        margin-bottom: 8px;
    }

    .mp-controls-center {
        width: 100%;
        order: 3;
    }

    .mp-controls-right {
        display: none;
    }
}

@media (max-width: 600px) {
    .mp-modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .mp-mini-player {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .mp-mini-info {
        flex: 1;
    }

    .mp-mini-progress {
        width: 100%;
        order: 4;
        padding: 8px 0 0 0;
    }

    .mp-mini-actions {
        margin-left: auto;
    }
}

/* ===== Scrollbar Styling ===== */
.mp-albums-list::-webkit-scrollbar,
.mp-main-panel::-webkit-scrollbar {
    width: 6px;
}

.mp-albums-list::-webkit-scrollbar-track,
.mp-main-panel::-webkit-scrollbar-track {
    background: transparent;
}

.mp-albums-list::-webkit-scrollbar-thumb,
.mp-main-panel::-webkit-scrollbar-thumb {
    background: var(--mp-border);
    border-radius: 3px;
}

.mp-albums-list::-webkit-scrollbar-thumb:hover,
.mp-main-panel::-webkit-scrollbar-thumb:hover {
    background: var(--mp-text-muted);
}
