/* Persistent Audio Player Styles */
:root {
    --pap-red: #AC2125;
    --pap-gray: #666;
    --pap-blue: #0e4976;
    --pap-bg: rgba(14, 73, 118, 0.95);
    --pap-hover: rgba(172, 33, 37, 0.1);
    --pap-shadow: rgba(0, 0, 0, 0.3);
}

/* Main Player Container */
.pap-player {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1200px;
    background: var(--pap-bg);
    color: white;
    z-index: 999999;
    box-shadow: 0 -2px 20px var(--pap-shadow);
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pap-player {
        width: 100%;
        border-radius: 0;
    }
}

.pap-player-inner {
    padding: 15px 20px;
}

/* Track Info */
.pap-track-info {
    margin-bottom: 15px;
    text-align: center;
}

.pap-track-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pap-track-artist {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls */
.pap-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pap-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pap-btn:hover {
    background: var(--pap-hover);
    transform: scale(1.1);
}

.pap-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.pap-play-pause {
    background: var(--pap-red);
    width: 48px;
    height: 48px;
}

.pap-play-pause:hover {
    background: var(--pap-red);
    opacity: 0.9;
}

/* Volume Control */
.pap-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pap-volume-slider {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.pap-volume-control:hover .pap-volume-slider {
    width: 80px;
    opacity: 1;
}

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

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

/* Progress Bar */
.pap-progress {
    margin-top: 10px;
}

.pap-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pap-progress-filled {
    height: 100%;
    background: var(--pap-red);
    width: 0;
    transition: width 0.1s linear;
    position: relative;
}

.pap-progress-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--pap-red);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--pap-shadow);
}

.pap-time {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Queue Panel */
.pap-queue {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--pap-bg);
    border-radius: 8px 8px 0 0;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pap-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pap-queue-header h3 {
    margin: 0;
    font-size: 18px;
}

.pap-queue-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.pap-queue-close:hover {
    background: var(--pap-hover);
}

.pap-queue-list {
    overflow-y: auto;
    padding: 10px;
}

.pap-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 5px;
}

.pap-queue-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pap-queue-item.active {
    background: rgba(172, 33, 37, 0.2);
    border-left: 3px solid var(--pap-red);
}

.pap-queue-info {
    flex: 1;
    overflow: hidden;
}

.pap-queue-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pap-queue-artist {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pap-queue-remove {
    background: none;
    border: none;
    color: var(--pap-red);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pap-queue-remove:hover {
    background: rgba(172, 33, 37, 0.2);
}

/* Sortable Ghost */
.pap-sortable-ghost {
    opacity: 0.4;
}

/* Inline Track Elements */
.pap-track-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(14, 73, 118, 0.1);
    border-radius: 4px;
    margin: 2px 0;
}

.pap-track-link {
    color: var(--pap-blue);
    font-weight: 500;
}

.pap-inline-play,
.pap-inline-add {
    color: var(--pap-red);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.pap-inline-play:hover,
.pap-inline-add:hover {
    background: var(--pap-hover);
    transform: scale(1.1);
}

.pap-inline-add.added {
    color: #4CAF50;
}

/* Hide original audio elements */
audio.pap-processed,
.pap-processed {
    display: none !important;
}

/* Page transition styles for Barba.js */
.barba-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Accessibility */
.pap-btn:focus,
.pap-queue-close:focus,
.pap-queue-remove:focus {
    outline: 2px solid var(--pap-red);
    outline-offset: 2px;
}

/* Animations */
@keyframes pap-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pap-playing .pap-play-pause {
    animation: pap-pulse 2s infinite;
}