/* Random Music Player - Matching Site Style */

.random-player-card {
    background-color: white;
    border-radius: 4px;
    padding: 20px;
    max-width: 1000px;
    margin: 20px auto;
    box-shadow: 0 0 10px #000;
    border-color: #ccc8c8;
    border-style: solid;
    border-width: 1px;
}

.random-player-card h3 {
    color: #803052;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Song Display Window (Slot Machine Style) */
.song-display-window {
    background: #f8f9fa;
    border: 3px solid #ddd;
    border-radius: 12px;
    margin: 20px 0;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Fade effect at edges for slot machine feel */
.song-display-window::before,
.song-display-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    z-index: 1;
}

.song-display-window::before {
    top: 0;
    background: linear-gradient(to bottom, #f8f9fa, transparent);
}

.song-display-window::after {
    bottom: 0;
    background: linear-gradient(to top, #f8f9fa, transparent);
}

.song-display-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa; /* Match the window background */
}

.song-display-reel {
    position: absolute;
    width: 100%;
    /* GPU acceleration */
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Smooth transitions when not animating */
    transition: none;
    /* Remove any gaps between items */
    margin: 0;
    padding: 0;
    opacity: 1;
}

/* Fade out reel when transitioning */
.song-display-reel.fading {
    transition: opacity 0.2s ease-out;
    opacity: 0;
}

.song-display-item {
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    text-align: center;
    box-sizing: border-box;
    /* Ensure no gaps between items */
    margin: 0;
    flex-shrink: 0;
    background-color: #f8f9fa;
}

.song-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-folder {
    font-size: 0.85rem;
    color: #666;
    margin: 2px 0 0 0;
    padding: 0;
    font-style: italic;
    line-height: 1.2;
}

/* Landing animation - subtle bounce */
.song-display-window.landing .song-display-reel {
    animation: slotLand 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slotLand {
    0% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Random Button */
.random-button {
    background-color: #803052;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.random-button:hover:not(:disabled) {
    background-color: #6b2844;
    opacity: 0.9;
}

.random-button:active:not(:disabled) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.random-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.random-button.shuffling {
    animation: buttonPulse 0.8s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Audio Player */
.random-audio-player {
    margin-top: 20px;
}

.random-audio-player audio {
    width: 100%;
    border-radius: 8px;
    outline: none;
}

.random-audio-player audio::-webkit-media-controls-panel {
    background-color: var(--green, #28a745);
}

/* Loading State */
.song-display-window.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.song-display-window.loading .song-name {
    color: transparent;
    background: linear-gradient(90deg, #ddd 25%, #e8e8e8 50%, #ddd 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .random-player-card {
        margin: 15px;
        padding: 15px;
    }
    
    .random-player-card h3 {
        font-size: 1.25rem;
    }
    
    .song-name {
        font-size: 0.95rem;
    }
    
    .song-folder {
        font-size: 0.75rem;
    }
    
    .random-button {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .song-display-window {
        height: 80px;
    }
    
    .song-display-item {
        height: 80px;
        min-height: 80px;
        max-height: 80px;
        padding: 8px 15px;
    }
}
