/* Custom rainbow skin for HTML5 audio player */
audio {
    border-radius: 10px;
    width: 100%;
    border-style: none;
    padding-bottom: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

audio::-webkit-media-controls-panel {
    border-radius: 10px;
    border-style: none;
    box-shadow: none;
}

/* Make play button larger */
audio::-webkit-media-controls-play-button {
    transform: scale(2);
    filter: brightness(1.2) contrast(1.2);
}

audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-volume-slider {
    filter: brightness(1.2) contrast(1.2);
}

/* Add some fun hover effects */
audio:hover {
    filter: brightness(1.1);
    transition: filter 0.3s ease;
}

/* Hide native audio controls */
.snd-player-container audio {
    display: none !important;
}

/* Double-layered player design - Custom theme only */
.snd-controls {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 0;
    background: transparent !important;
    padding: 0;
    border-radius: 12px;
    min-height: 60px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* Rainbow accent border */
.snd-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

/* Create virtual track info area above progress bar */
.snd-controls::after {
    content: 'Now Playing • ';
    grid-column: 2 / 5;
    grid-row: 1;
    color: #ccc;
    font-size: 13px;
    text-align: left;
    align-self: end;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    margin-left: 0;
    margin-bottom: 2px;
    z-index: 1;
}

/* BIG play button on the left - spans both rows */
.snd-play-btn {
    grid-column: 1;
    grid-row: 1 / 3;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: block;
    text-align: center;
    line-height: 58px;
    transition: all 0.3s ease;
    box-shadow: none;
    font-size: 28px;
    font-weight: bold;
    align-self: center;
    justify-self: start;
    outline: none;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.snd-play-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
    color: white;
}

.snd-play-btn:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.snd-play-btn:active {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* Playing state for the play button */
.snd-play-btn.playing,
.snd-player-container.playing .snd-play-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.snd-play-btn.playing:hover,
.snd-player-container.playing .snd-play-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Fix for play/pause icons to allow clicks to pass through to button */
.snd-icon-play,
.snd-icon-pause {
    pointer-events: none;
    display: inline-block;
}

/* Progress section in bottom right */
.snd-progress {
    grid-column: 2;
    grid-row: 2;
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    cursor: pointer;
    position: relative;
    overflow: visible;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 8px;
    margin-right: 0;
    align-self: center;
    margin-top: -3px;
}

/* Navigation buttons - positioned in their own grid columns */
.snd-prev-btn,
.snd-next-btn {
    background: transparent !important;
    border: none !important;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: right;
    transition: all 0.3s ease;
    font-size: 19px;
    grid-row: 2;
    align-self: right;
    width: 40px;
    height: 40px;
  padding: 0;
   
    box-shadow: none !important;
    outline: none !important;
}

.snd-prev-btn {
    grid-column: 3;
    margin-left: 0;
    margin-right: 0;
}

.snd-next-btn {
    grid-column: 4;
    margin-left: 0;
    margin-right: 0;
}

.snd-prev-btn:hover,
.snd-next-btn:hover {
    color: #8A2BE2 !important;
    background: transparent !important;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.8);
}

.snd-prev-btn:focus,
.snd-next-btn:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.snd-prev-btn:active,
.snd-next-btn:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Enhanced visual effects */
.snd-player-wrapper {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.snd-player-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Show time display - positioned to the right side */
.snd-time-display,
.snd-time {
    grid-column: 2 / 5;
    grid-row: 1;
    color: #ccc;
    font-size: 13px;
    text-align: right;
    align-self: end;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    margin-left: 0;
    margin-bottom: 2px;
    display: block;
    z-index: 2;
    position: relative;
}

.snd-progress:hover .snd-progress-bar {
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.8);
    transition: box-shadow 0.3s ease;
}

.snd-progress.seeking {
    cursor: grabbing;
}

.snd-progress.seeking .snd-progress-handle {
    background: linear-gradient(45deg, #ff6b00, #ffb93d);
    box-shadow: 0 3px 12px rgba(255, 152, 0, 0.6);
}

/* Enhanced scrubber handle for the long progress bar */
.snd-progress-handle {
    position: absolute;
    top: -1px;
    left: 0;
    width: 20px;
    height: 8px;
    background: #888;
    border: 1px solid #666;
    border-radius: 0;
    cursor: grab;
    opacity: 1;
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    margin-left: -10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.snd-progress:hover .snd-progress-handle,
.snd-progress.seeking .snd-progress-handle {
    opacity: 1;
}

.snd-progress-handle:hover {
    background: #aaa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.snd-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ffd93d, #6bcf7f);
    border-radius: 0;
    width: 0%;
    transition: width 0.1s;
    position: relative;
    overflow: hidden;
}

.snd-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Track info styling - above the progress bar */
.snd-track-title-display {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.snd-time {
    font-size: 12px;
    color: #ccc;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* Style the time separator */
.snd-time-separator {
    color: #666;
    margin: 0;
    padding: 0;
}

/* Cool tooltip styling for progress bar */
.snd-progress-tooltip {
    position: absolute;
    top: 20px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    border: 1px solid rgba(255, 152, 0, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.snd-progress-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

/* Keep existing track list styling */
.snd-track-list {
    margin: 10px 0 0 0;
    padding: 0;
    list-style: none;
    border: none;
    border-radius: 4px;
    background: #000000;
}

/* Keep existing track item styling */
.snd-track-item {
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #524938;
}

.snd-track-item:last-child {
    border-bottom: none;
}

.snd-track-item:hover {
    background-color: #222222;
}

.snd-track-item.active,
.snd-track-item.snd-active-track {
    background-color: #1486d873;
    color: white !important;
    position: relative;
}

/* Add cute rainbow stripe to active track */
.snd-track-item.active::before,
.snd-track-item.snd-active-track::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4ecdc4, #4e89ae, #a77dc2);
    border-radius: 0 2px 2px 0;
    animation: rainbow-pulse 3s ease-in-out infinite alternate;
}

@keyframes rainbow-pulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Keep existing track title styling */
.snd-track-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.9em;
    padding: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: white;
}

.snd-track-item:hover .snd-track-title {
    color: #cccccc;
}

.snd-track-item.active .snd-track-title,
.snd-track-item.snd-active-track .snd-track-title {
    color: white !important;
}

.snd-track-duration {
    color: #666;
    font-size: 0.85em;
    font-family: monospace;
}

/* Optional current track title - replaces "Now Playing •" when track is playing */
.snd-current-track-title {
    grid-column: 2;
    grid-row: 1;
    color: #fff;
    font-size: 13px;
    text-align: left;
    align-self: end;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    margin-left: 8px;
    margin-bottom: 4px;
    margin-right: 20px;
    z-index: 3;
    position: relative;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4ecdc4, #4e89ae, #a77dc2);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-text 4s ease-in-out infinite;
}

@keyframes rainbow-text {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hide the default "Now Playing •" text when current track title is present */
.snd-controls:has(.snd-current-track-title)::after {
    display: none;
}

/* Single player mode */
.snd-single-player .snd-player-container:not(:first-child) {
    display: none;
}