/* Media Player Styles - Matches Östgöta Barock design */

:root {
    --player-primary: #7A1F1F;       /* vinröd */
    --player-accent: #F2C94C;        /* guldgul */
    --player-bg: #F8F5F2;            /* ljus beige */
    --player-border: #E8DCC8;        /* beige ton */
}

.music-player-main {
    background: #ffffff;
    border: 2px solid var(--player-border);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.player-display {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--player-border);
}

.album-art {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, var(--player-primary) 0%, #5a1515 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(122, 31, 31, 0.15);
}

.player-info {
    flex: 1;
    overflow: hidden;
}

.player-title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 22px;
    margin: 0 0 6px 0;
    font-weight: 600;
    color: var(--player-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-composer {
    color: #555555;
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-description {
    color: #555555;
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.4;
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 22px;
}

.control-btn {
    background: transparent;
    border: 2px solid var(--player-primary);
    color: var(--player-primary);
    font-size: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    background: var(--player-primary);
    color: #ffffff;
    transform: scale(1.08);
}

.control-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.play-btn {
    background: var(--player-primary);
    color: #ffffff;
    width: 62px;
    height: 62px;
    font-size: 24px;
    border-color: var(--player-primary);
}

.play-btn:hover:not(:disabled) {
    background: #5a1515;
    border-color: #5a1515;
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-size: 12px;
    color: #555555;
}

.time-current,
.time-total {
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.progress-bar-container {
    flex: 1;
    position: relative;
    height: 6px;
    background: var(--player-border);
    border-radius: 3px;
    cursor: pointer;
    overflow: visible;
}

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

.progress-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 5;
    transform: translateY(-50%);
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--player-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(122, 31, 31, 0.3);
    transition: all 0.2s;
}

.progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.progress-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--player-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(122, 31, 31, 0.3);
    transition: all 0.2s;
}

.progress-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.player-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--player-border);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex: 1;
    max-width: 180px;
    color: #555555;
}

.volume-control label {
    flex-shrink: 0;
    font-weight: 500;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--player-border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--player-primary);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--player-primary);
    cursor: pointer;
    border: none;
}

.player-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: transparent;
    border: 2px solid var(--player-accent);
    color: var(--player-primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.action-btn:hover:not(:disabled) {
    background: var(--player-accent);
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(242, 201, 76, 0.2);
}

/* Playlist */

.playlist-section {
    margin-top: 40px;
}

.playlist-section h2 {
    font-family: "Georgia", "Times New Roman", serif;
    margin-bottom: 18px;
    font-size: 20px;
    color: var(--player-primary);
}

.playlist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.playlist-item {
    background: #ffffff;
    border: 2px solid var(--player-border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-item:hover {
    border-color: var(--player-accent);
    box-shadow: 0 6px 20px rgba(242, 201, 76, 0.15);
    transform: translateY(-2px);
}

.playlist-item.active {
    background: var(--player-primary);
    color: #ffffff;
    border-color: var(--player-primary);
}

.playlist-item-title {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: inherit;
}

.playlist-item-composer {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

.playlist-item-description {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: inherit;
}

.playlist-item-duration {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    margin-top: auto;
    opacity: 0.85;
    color: inherit;
}

.playlist-item.active .playlist-item-duration {
    opacity: 1;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Responsive */

@media (max-width: 768px) {
    .music-player-main {
        padding: 20px;
    }

    .player-display {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .album-art {
        width: 96px;
        height: 96px;
        font-size: 36px;
    }

    .player-title {
        font-size: 16px;
    }

    .player-composer {
        font-size: 12px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .play-btn {
        width: 58px;
        height: 58px;
        font-size: 22px;
    }

    .player-progress {
        font-size: 10px;
    }

    .player-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        border-top: 2px solid var(--player-border);
        padding-top: 16px;
    }

    .volume-control {
        justify-content: space-between;
        max-width: 100%;
    }

    .playlist {
        grid-template-columns: 1fr;
    }
}
