html, body {
    margin-top: 20px;
    height: auto;
    overflow-y: auto;
    font-family: Arial, sans-serif;
}

/* Smooth Fade-In Effect */
body {
    opacity: 0;
    animation: fadeIn 1s ease-in-out forwards;
    /* Default Light Mode */
    background-color: white;
    color: black;
    cursor: default !important;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

/* Only change cursor when actually dragging */
body.dragging {
    cursor: grabbing !important;
}

/* If dark mode is enabled, override before fade-in */
body.dark-mode {
    background-color: black;
    color: white;
}

/* Dark Mode Styles for Song List */
body.dark-mode #songList {
    background-color: #222; /* Dark background */
}

body.dark-mode #songList .list-group-item {
    background-color: #333; /* Darker shade for items */
    color: white; /* White text */
    border-bottom: 1px solid white !important;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

body.dark-mode #songList .list-group-item:hover {
    background-color: #444; /* Lighter shade on hover */
}

body.dark-mode #songList .list-group-item.selected {
    background-color: #007bff; /* Keep blue for selected */
    color: white;
}

/* Ensure text inside song list elements also adapts */
body.dark-mode #songList .song,
body.dark-mode #songList .author {
    color: white !important;
    transition: color 0.8s ease-in-out;
}

/* Enhanced Drag and Drop Styles */
#songList .list-group-item.dragging {
    opacity: 0.8;
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    position: relative;
}

#songList .list-group-item.drag-over-top {
    border-top: 3px solid #007bff !important;
    padding-top: 20px;
    transition: all 0.2s ease;
}

#songList .list-group-item.drag-over-bottom {
    border-bottom: 3px solid #007bff !important;
    padding-bottom: 20px;
    transition: all 0.2s ease;
}

#songList .list-group-item .drag-handle {
    cursor: grab;
    width: 24px;
    text-align: center;
    margin-left: 8px; /* Changed from margin-right */
    color: #6c757d;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 5px;
    border-radius: 4px;
    order: 4; /* Position before delete button */
}

#songList .list-group-item .drag-handle:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

#songList .list-group-item .drag-handle:active {
    cursor: grabbing;
    color: #0056b3;
}

/* Dark mode support for drag handle */
body.dark-mode #songList .list-group-item .drag-handle {
    color: #aaa;
}

body.dark-mode #songList .list-group-item .drag-handle:hover {
    color: #007bff;
    background-color: rgba(77, 171, 247, 0.1);
}

/* Drag placeholder */
.drag-ghost {
    opacity: 0.7;
    background-color: #f8f9fa;
    border: 2px dashed #007bff !important;
    border-radius: 8px;
}

body.dark-mode .drag-ghost {
    background-color: #2d3748;
    border-color: #007bff !important;
}

/* Ensure proper spacing with drag handle */
#songList .list-group-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    transition: all 0.3s ease;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

/* Adjust column widths to accommodate drag handle */
#songList .song-number {
    width: 35px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    order: 1; /* First column */
}

#songList .song-name {
    flex: 2;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    order: 2; /* Second column */
}

#songList .author-column {
    flex: 1.5;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    order: 3; /* Third column */
}

#songList .song-action {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
    order: 5; /* Last column - delete button */
}

/* Hide number when dragging */
#songList .list-group-item.dragging .song-number {
    opacity: 0;
}

/* Drag preview styling */
.drag-preview {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    max-width: 300px;
    opacity: 0.9;
    transform: translate(-50%, -50%);
}

body.dark-mode .drag-preview {
    background: #333;
    border-color: #555;
    color: white;
}

/* Keyframe Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dark Mode */
body.dark-mode {
    background-color: black;
    color: white;
}

/* Dark Mode for Cards */
.card {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

.card.dark-mode {
    background-color: #222;
    color: white;
}

/* Dark Mode - Toggle to White */
body.dark-mode #darkModeToggle {
    background-color: white;
    color: black;
}

/* Click Animation (Shrink Effect) */
#darkModeToggle:active {
    transform: scale(0.9); /* Shrinks when clicked */
}

/* Default Light Mode */
box-icon {
    fill: #333; /* Default dark gray color */
    transition: fill 0.8s ease-in-out;
}

/* Dark Mode */
body.dark-mode box-icon {
    fill: #ddd !important; /* Lighter color for dark mode */
}

.btn-dark-mode-toggle {
    background-color: black !important;
    color: white !important;
    border: 2px solid black !important;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border 0.8s ease-in-out, opacity 0.8s ease-in-out !important;
    opacity: 1;
}

/* Dark Mode - Fade to White */
body.dark-mode .btn-dark-mode-toggle {
    background-color: white !important;
    color: black !important;
    border: 2px solid white !important;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

/* Fade Effect */
.btn-dark-mode-toggle:hover {
    opacity: 0.7;
    transition: opacity 0.8s ease-in-out;
}

body.dark-mode .btn-dark-mode-toggle:hover {
    opacity: 0.7;
    transition: opacity 0.8s ease-in-out;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding-bottom: 20px;
}

/* 🎵 Music Player Card */
.music-player {
    width: 350px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 🎵 Center Album Art */
.album-art-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 250px; /* Maximum size */
    margin: 0 auto; /* Center the container */
}

#albumArt {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1; /* Maintain square aspect ratio */
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 250px; /* Maximum size */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .album-art-container {
        max-width: 250px;
    }
    
    #albumArt {
        max-width: 250px;
    }
}

/* 🎵 Controls */
.controls {
    padding-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}        

/* Play/Pause Button */
#playPauseBtn, #prevBtn, #nextBtn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: #007bff;
    color: white;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.1s;
    padding: 10px;
    line-height: 1; /* Ensures vertical centering */
    flex-shrink: 0; /* Prevent shrinking */
}

/* Auto-play and Repeat controls container */
.d-flex.justify-content-between.align-items-center.mt-3 {
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 15px;
    justify-content: space-between !important;
}

/* Auto-play toggle - always on left side */
.auto-play-toggle {
    order: 1; /* Force to left side */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Repeat button section - always on right side */
.d-flex.align-items-center.gap-2 {
    order: 2; /* Force to right side */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Default layout - items in row */
.auto-play-toggle,
.d-flex.align-items-center.gap-2 {
    flex-direction: row;
    flex-wrap: nowrap;
}

/* Text labels */
.auto-play-toggle span,
.d-flex.align-items-center.gap-2 span {
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* Switch and button styling */
.switch {
    margin-bottom: 2px;
}

#repeatBtn {
    margin-bottom: 2px;
}

/* For larger screens - switch to horizontal layout */
@media (min-width: 1025px) {
    .auto-play-toggle,
    .d-flex.align-items-center.gap-2 {
        flex-direction: row;
        gap: 10px;
    }
    
    .auto-play-toggle span,
    .d-flex.align-items-center.gap-2 span {
        font-size: 14px;
    }
}

/* For medium screens - keep text below but adjust spacing */
@media (max-width: 1024px) and (min-width: 769px) {
    .auto-play-toggle,
    .d-flex.align-items-center.gap-2 {
        gap: 3px;
    }
    
    .auto-play-toggle span,
    .d-flex.align-items-center.gap-2 span {
        font-size: 11px;
    }
}

/* For very small screens - make text even smaller */
@media (max-width: 400px) {
    .auto-play-toggle span,
    .d-flex.align-items-center.gap-2 span {
        font-size: 10px;
    }
}

/* Responsive adjustments for medium screens */
@media (max-width: 992px) {
    .auto-play-toggle span,
    .d-flex.align-items-center.gap-2 span {
        font-size: 13px;
    }
}

/* Ensure text doesn't overflow */
.song-title, .author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

#playPauseBtn:active, #prevBtn:active, #nextBtn:active {
    transform: scale(0.9);
}        

#playPauseBtn:hover, #prevBtn:hover, #nextBtn:hover {
    background: #0056b3;
}

.progress-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    touch-action: none; /* Prevent browser scrolling on touch */

}

.progress {
    width: 95%;
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    margin: 5px auto;
    display: block;
    -webkit-user-select: none; /* Disable selection on iOS */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.time-display {
    display: flex;
    justify-content: space-between;
    width: 95%;
    font-size: 12px;
    margin-top: 2px; /* Reduce space between progress bar and time */
}


/* 🎵 Song Selector */
select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-top: 10px;
    cursor: pointer;
}

/* 🎵 Hide YouTube Player */
.player-container {
    display: flex;
    gap: 20px;
}

.song-selector {
    width: 800px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 🎵 Error Message */
#errorMessage {
    color: red;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 5s linear infinite;
}

.rotate-paused {
    animation-play-state: paused;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px; /* Adjust spacing */
}

.volume-control input[type="range"] {
    flex-grow: 1; /* Makes slider take available space */
}

/* Remove border from the song list container */
#songList {
    border: none !important;
    border-radius: 0 !important;
}

/* Playlist Headers and Items Alignment */
.playlist-headers {
    display: flex;
    justify-content: space-between;
    padding: 0 15px 10px 15px;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 10px;
    transition: all 0.8s ease-in-out;
}

.playlist-headers span {
    font-size: 14px;
    color: #495057;
    transition: color 0.8s ease-in-out;
}
/* Header order matches the item order */
.playlist-headers .number-header {
    width: 35px;
    text-align: center;
    order: 1;
}

.playlist-headers .song-header {
    flex: 2;
    text-align: left;
    order: 2;
}

.playlist-headers .author-header {
    flex: 1.5;
    text-align: left;
    order: 3;
}

.playlist-headers .action-header {
    width: 70px;
    text-align: center;
    order: 5;
}

/* Add a spacer for the drag handle column */
.playlist-headers::after {
    content: "";
    width: 40px; /* Width of drag handle + spacing */
    order: 4;
    flex-shrink: 0;
}

/* Song list items - 4-column layout */
#songList .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    transition: all 0.8s ease-in-out;
    gap: 10px;
}

#songList .list-group-item:last-child {
    border-bottom: none !important;
}

#songList .list-group-item:hover {
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

#songList .list-group-item.selected {
    background-color: #007bff !important;
    color: white;
}

/* Column 1: Number - Simple 1. 2. 3. format */
#songList .song-number {
    width: 50px;
    text-align: center;
    font-size: 14px;
    color: #212529; /* Normal black color (not muted) */
    flex-shrink: 0;
    transition: color 0.8s ease-in-out;
}

/* Column 2: Song Name - Clean, no author name */
#songList .song-name {
    flex: 2;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    color: #212529; /* Normal text color */
    transition: color 0.8s ease-in-out;
}

/* Column 3: Author Name - Separate column */
#songList .author-column {
    flex: 1.5;
    text-align: left;
    font-size: 13px;
    color: #212529; /* Normal black color (not muted) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    transition: color 0.8s ease-in-out;
}

/* Column 4: Action */
#songList .song-action {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
}

/* Remove button styling */
.remove-song-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.8s ease-in-out;
}

/* Selected song - White text in both light and dark modes */
#songList .list-group-item.selected .song-number,
#songList .list-group-item.selected .song-name,
#songList .list-group-item.selected .author-column {
    color: white !important;
}

/* Dark mode support */
body.dark-mode .playlist-headers {
    border-bottom-color: #444;
}

body.dark-mode .playlist-headers span {
    color: #ffffff; /* White color for headers in dark mode */
}

body.dark-mode #songList .list-group-item {
    border-bottom-color: #444 !important;
    background-color: #333;
    color: #ffffff;
}

body.dark-mode #songList .song-number {
    color: #ffffff; /* White color for numbers in dark mode */
}

body.dark-mode #songList .song-name {
    color: #ffffff; /* White color for song names in dark mode */
}

body.dark-mode #songList .author-column {
    color: #ffffff; /* White color for author names in dark mode */
}

body.dark-mode #songList .list-group-item:hover {
    background-color: #3a3a3a;
}

body.dark-mode #songList .list-group-item.selected {
    background-color: #007bff !important;
}

body.dark-mode #songList .list-group-item.selected .song-number,
body.dark-mode #songList .list-group-item.selected .song-name,
body.dark-mode #songList .list-group-item.selected .author-column {
    color: white;
}

/* Light mode: Ensure normal colors */
body:not(.dark-mode) #songList .song-number,
body:not(.dark-mode) #songList .author-column {
    color: #212529 !important; /* Force normal black color in light mode */
}

body:not(.dark-mode) #songList .list-group-item.selected .song-number,
body:not(.dark-mode) #songList .list-group-item.selected .song-name,
body:not(.dark-mode) #songList .list-group-item.selected .author-column {
    color: white !important;
}

/* Ensure the card itself transitions smoothly */
.card {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

.card.dark-mode {
    background-color: #222;
    color: white;
}

/* Remove border from the last item to avoid extra line */
#songList .list-group-item:last-child {
    border-bottom: none !important;
}

#songList li {
    display: flex;
    justify-content: space-between; /* Creates left-right separation */
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    transition: background 0.3s;
}

#songList li:last-child {
    border-bottom: none;
}

#songList li:hover {
    background: #f0f0f0;
}

#songList li.selected {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.song {
    flex: 1;
    text-align: left;  /* Align song name to the left */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.author {
    flex: 1;
    text-align: right; /* Align author name to the right */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px); /* Adjust blur intensity */
    z-index: -1; /* Send background behind everything */
    transition: background-image 0.5s ease-in-out;
}

/* 🎵 Auto-Play Toggle Styling */
.auto-play-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
}

/* 🎵 Switch Container */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

/* 🎵 Hide Default Checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 🎵 Slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 25px;
}

/* 🎵 Slider Circle */
.slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

/* 🎵 Toggle ON */
.switch input:checked + .slider {
    background-color: #007bff;
}

/* 🎵 Move Circle when ON */
.switch input:checked + .slider::before {
    transform: translateX(24px);
}

.form-switch .form-check-input:checked {
    background-color: #007bff !important;
    border-color: #007bff !important;
}

/* 🎵 Repeat Button Styling */
/* 🎵 Controls Container */
.controls-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Center horizontally */
    gap: 15px; /* Adjust spacing */
    margin-top: 10px;
}

/* 🎵 Auto-Play Toggle */
.auto-play-toggle, .repeat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
}

/* 🎵 Repeat Button */
/* Add scale animation effect */
#repeatBtn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #ccc;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s; /* Smooth animation */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Active state (when clicked) */
#repeatBtn:active {
    transform: scale(0.9); /* Slight shrink effect */
}

/* Active styling when repeat mode is on */
#repeatBtn.active {
    background: #007bff; /* Blue when active */
    transform: scale(1.1); /* Slight increase in size */
    transition: background 0.3s, transform 0.1s;
}

#nowPlaying {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    line-height: 0.8; /* Reduce line height to bring text closer */
}

#nowPlaying .status {
    font-size: 20px;
    font-weight: bold;
    display: block;
    margin-bottom: 2px; /* Reduce space below "Now Playing" */
}

#nowPlaying .song-title {
    transition: color 0.8s ease-in-out; /* Smooth transition */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Fix descender cutoff issue */
    line-height: 1.0; /* Ensure enough space for descenders */
    padding-bottom: 2px; /* Prevent letters like "g, j, y" from being cut off */
    display: inline-block; /* Ensure proper text alignment */
    
    font-size: 18px;
    font-weight: bold;
    display: block;
    margin-bottom: 2px; /* Reduce space below Song Name */
}

/* Smooth transition for song title and author name */
#nowPlaying .author-name,
#songList .author { /* Apply to second card */
    transition: color 0.8s ease-in-out, opacity 0.5s ease-in-out !important;
}

/* Dark Mode Colors */
body.dark-mode #nowPlaying .song-title,
body.dark-mode #nowPlaying .author-name {
    color: white !important; /* Ensure both elements turn white in dark mode */
}

/* Light Mode Colors (Fix transition when turning OFF dark mode) */
body:not(.dark-mode) #nowPlaying .song-title {
    color: black; /* Match original light mode text color */
}

body:not(.dark-mode) #nowPlaying .author-name {
    color: #666 !important;
}

#nowPlaying .author-name {
    font-size: 14px;
    font-weight: normal;
    color: #666;
    display: block;
}        

/* Default Light Mode */
.author-name {
    color: #666; /* Light mode text */
    transition: color 0.8s ease-in-out; /* Smooth transition */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Fix descender cutoff issue */
    line-height: 1.0; /* Ensure enough space for descenders */
    padding-bottom: 2px; /* Prevent letters like "g, j, y" from being cut off */
    display: inline-block; /* Ensure proper text alignment */
}

/* Dark Mode */
body.dark-mode .author-name {
    color: #bbb !important; /* Lighter text for dark mode */
}

/* Dark mode support for empty playlist and footer */
body.dark-mode .text-muted {
    color: #aaa !important; /* brighter gray for readability */
}

body.dark-mode .list-group-item.text-muted {
    background-color: transparent !important;
    border: none !important;
    color: #aaa !important;
}

body.dark-mode .text-muted a {
    color: #bbb !important;  /* links lighter gray */
}

body.dark-mode .text-muted a:hover {
    color: #fff !important;  /* hover = white */
}

/* Volume Control - Simplified */
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-top: 15px;
    position: relative;
    touch-action: none;
    margin: 0 auto;
}

.volume-icon {
    font-size: 20px;
    color: #007bff;
    min-width: 24px;
    transition: color 0.8s ease-in-out;
}

body.dark-mode .volume-icon {
    color: #007bff;
}

.volume-bar-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: visible;
    cursor: pointer;
    transition: background-color 0.8s ease-in-out;
}

body.dark-mode .volume-bar-container {
    background: #444;
}

.volume-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #007bff;
    border-radius: 10px;
    transition: width 0.1s ease;
    width: 70%; /* Default to 70% */
}

.volume-thumb {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid #007bff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.1s ease;
    cursor: grab;
    z-index: 2;
    left: 70%; /* Default to 70% */
}

.volume-thumb:active {
    cursor: grabbing;
}

#volumeControl {
    -webkit-appearance: none;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: transparent;
    z-index: 3;
    cursor: pointer;
    opacity: 0;
    margin: 0;
    padding: 0;
}

#volumeControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

#volumeControl::-moz-range-thumb {
    width: 24px;
    height: 24px;
    cursor: pointer;
    border: none;
    background: transparent;
}

#playerContainer {
    width: 100%; 
    min-height: 200px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

#player {
    width: 100%;
    max-width: 260px;
    height: 150px;
}

#playerContainer iframe {
    width: 260px;
    height: 170px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

#togglePlayerBtn {
    background-color: #007bff;
    border-color: #007bff;
    transition: transform 0.1s ease-in-out;
}

#togglePlayerBtn:hover {
    background-color: #0056b3; /* Darker shade for hover effect */
    border-color: #0056b3;
}

#togglePlayerBtn:active {
    transform: scale(0.9); /* Shrink effect on click */
}

.card {
    border: none !important;
    box-shadow: none !important; /* Removes shadow if needed */
}

/* 🎵 General Button Styling */
.card .btn {
    transition: transform 0.1s ease-in-out, background-color 0.3s;
}

/* 🎵 Click Animation (Shrink Effect) */
.card .btn:active {
    transform: scale(0.9);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 5s linear infinite;
}

.rotate-paused {
    animation-play-state: paused;
}

/* Floating Settings Button */
.floating-settings {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hover state - ease out for smooth entry */
.settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Active state when menu is open - instant apply */
.floating-settings.active .settings-btn {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

/* Return to normal state - ease in for smooth exit */
.settings-btn:not(:hover):not(.floating-settings.active .settings-btn) {
    transition: transform 0.4s ease-in, box-shadow 0.4s ease-in;
}

/* Target the <i> icon inside button */
.settings-btn i {
    display: inline-block;
    transition: transform 0.4s ease-in-out;
}

/* Rotate icon on hover - ease out */
.settings-btn:hover i {
    transform: rotate(180deg);
    transition: transform 0.3s ease-out;
}

/* Rotate icon when menu is open */
.floating-settings.active .settings-btn i {
    transform: rotate(180deg);
    transition: transform 0.3s ease-out;
}

/* Return icon to normal - ease in */
.settings-btn:not(:hover):not(.floating-settings.active .settings-btn) i {
    transform: rotate(0deg);
    transition: transform 0.5s ease-in;
}

.settings-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.settings-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.settings-header h6 {
    margin: 0;
    font-weight: 600;
}

.settings-close-btn {
    padding: 0;
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.settings-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-body .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Dark mode support for settings menu */
body.dark-mode .settings-menu {
    background: #222;
    border: 1px solid #444;
}

body.dark-mode .settings-header {
    border-bottom: 1px solid #444;
}

body.dark-mode .settings-header h6 {
    color: white;
}

body.dark-mode .settings-close-btn {
    filter: invert(1);
}

/* Scroll to Top Button */
.floating-top {
    position: fixed;
    bottom: 160px; /* Position above the settings button */
    z-index: 999; /* Just below settings button */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.floating-top button {
    border: none;
}

.floating-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.go-top-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: 2px solid white;
    color: white;
}

.go-top-btn:hover {
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3, #004494);
    color: white;
}

/* === Lyrics Panel === */
#lyricsPanel {
  transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
  background-color: #fafafa;
  color: #222;
  border-radius: 6px;
  padding: 10px;
  width: 800px;
  margin: 20px auto;
  max-height: 400px;
  overflow-y: auto;
  font-family: "Segoe UI", sans-serif;
  border: none;
}

#lyricsTitle {
    font-weight: bold;
    transition: color 0.8s ease-in-out;
}

body.dark-mode #lyricsPanel {
  background-color: #222;
  color: #e6e6e6;
  border: none
}

#lyricsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  transition: all 0.8s ease-in-out;
}

#lyricsMeta {
    font-size: 12px;
    color: gray;
    transition: color 0.8s ease-in-out;
}

#lyricsText {
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.7;
  max-height: 300px;
  scroll-behavior: smooth;
  transition: color 0.8s ease-in-out;
}

.lrc-line {
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.8s ease-in-out, color 0.8s ease-in-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lrc-time {
  font-size: 13px;
  color: #a0a0a0;
  width: 50px;
  text-align: right;
  transition: color 0.8s ease-in-out;
}

.lrc-line.highlight {
  background: rgba(0, 123, 255, 0.18);
  color: #fff;
  font-weight: bold;
  transition: background 0.8s ease-in-out, color 0.8s ease-in-out;
}

.plain-line {
  transition: color 0.8s ease-in-out;
}

/* Dark Mode Lyrics */
body.dark-mode #lyricsPanel {
  background-color: #222;
  color: #e6e6e6;
  border: none;
}

body.dark-mode #lyricsTitle {
    color: #ffffff;
}

body.dark-mode #lyricsMeta {
    color: #bbb !important;
}

body.dark-mode .lrc-line {
  color: #e0e0e0;
}

body.dark-mode .lrc-line .lrc-time {
  color: #aaa;
}

/* Lyrics Control Buttons - Match Dark Mode Toggle Style */
.lyrics-controls button {
  background: black;
  color: white;
  border: 2px solid black;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border 0.8s ease-in-out, opacity 0.8s ease-in-out !important;
  opacity: 1;
}

.lyrics-controls button:hover {
  opacity: 0.7;
  transition: opacity 0.8s ease-in-out;
}

/* Dark Mode - Switch to white background like dark mode toggle */
body.dark-mode .lyrics-controls button {
  background: white !important;
  color: black !important;
  border: 2px solid white !important;
  transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

body.dark-mode .lyrics-controls button:hover {
  opacity: 0.7;
  transition: opacity 0.8s ease-in-out;
}

/* Click Animation (Shrink Effect) - Match dark mode toggle */
.lyrics-controls button:active {
  transform: scale(0.9);
  transition: transform 0.1s ease-in-out;
}

/* Ensure all buttons have consistent styling */
#toggleSyncBtn,
#refreshLyricsBtn, 
#openRawBtn {
  border-radius: 8px !important;
}

/* Highlighted lyric line */
.lrc-line.highlight {
  color: black;
}

body.dark-mode .lrc-line.highlight {
  color: white;
}

#lyricsPanel {
  transition: all 0.8s ease-in-out;
  opacity: 1;
}

#lyricsPanel.hidden {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.8s ease-in-out;
}

/* Smooth transitions for lyrics text content */
#lyricsText * {
  transition: color 0.8s ease-in-out, background-color 0.8s ease-in-out;
}

/* Fix: Settings Menu Dark Mode Transitions - Synchronized (0.8s) */
.settings-menu {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out, opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.settings-header {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

.settings-header h6 {
    transition: color 0.8s ease-in-out;
}

.settings-body {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

/* Settings form labels and text */
.form-check-label,
#languageLabel {
    transition: color 0.8s ease-in-out;
}

.btn-group .btn {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

/* Settings icons transition */
.settings-header i {
    transition: color 0.8s ease-in-out;
}

/* Dark mode specific styles for settings */
body.dark-mode .settings-menu {
    background: #222;
    border: 1px solid #444;
}

body.dark-mode .settings-header {
    border-bottom: 1px solid #444;
}

body.dark-mode .settings-header h6 {
    color: white;
}

body.dark-mode .settings-header i {
    color: white;
}

body.dark-mode .form-check-label,
body.dark-mode #languageLabel {
    color: white !important;
}

body.dark-mode .btn-group .btn-outline-primary:hover {
    color: white;
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

body.dark-mode .btn-group .btn-outline-primary.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Settings close button dark mode - SYNCHRONIZED */
body.dark-mode .settings-close-btn {
    filter: invert(1);
    transition: filter 0.8s ease-in-out;
}

/* Smooth transition for all text content in settings - SYNCHRONIZED */
.settings-menu *:not(input):not(button):not(.form-check-input) {
    transition: color 0.8s ease-in-out, background-color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

/* Dark Mode for Cards in settings menu */
.settings-menu .card {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

body.dark-mode .settings-menu .card {
    background-color: #333;
    color: white;
}

/* Text color transitions for all text elements */
.settings-menu span,
.settings-menu label,
.settings-menu h6,
.settings-menu p {
    transition: color 0.8s ease-in-out;
}

/* Specific for form check text */
.form-check-label {
    transition: color 0.8s ease-in-out !important;
}

/* Specific for language label */
#languageLabel {
    transition: color 0.8s ease-in-out !important;
}

/* Light mode text colors (ensure proper contrast) */
body:not(.dark-mode) .form-check-label,
body:not(.dark-mode) #languageLabel,
body:not(.dark-mode) .settings-header h6 {
    color: #212529 !important;
}

/* Ensure all settings menu items transition at 0.8s */
.settings-menu .form-check,
.settings-menu .form-switch,
.settings-menu .mb-2,
.settings-menu .btn-group {
    transition: all 0.8s ease-in-out;
}

/* Smooth transition for the settings menu background when opening/closing */
.settings-menu.show {
    transition: all 0.3s ease-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out !important;
}

/* ================================
   SETTINGS MENU BORDER – NO SNAP
   ================================ */

/* Base (LIGHT MODE) — border exists */
.settings-menu {
    border: 1px solid transparent; /* IMPORTANT */
    transition:
        background-color 0.8s ease-in-out,
        color 0.8s ease-in-out,
        border-color 0.8s ease-in-out,
        opacity 0.3s ease-in-out,
        transform 0.3s ease-in-out,
        visibility 0.3s ease-in-out;
}

/* DARK MODE — ONLY change border-color */
body.dark-mode .settings-menu {
    background-color: #222;
    border-color: #444;
}

/* ================================
   SETTINGS HEADER BORDER – NO SNAP
   ================================ */

/* Base state */
.settings-header {
    border-bottom: 1px solid transparent;
    transition:
        background-color 0.8s ease-in-out,
        color 0.8s ease-in-out,
        border-color 0.8s ease-in-out;
}

/* Dark mode */
body.dark-mode .settings-header {
    border-bottom-color: #444;
}

/* ================================
   SETTINGS CARDS BORDER – NO SNAP
   ================================ */

.settings-menu .card {
    border: 1px solid transparent;
    transition:
        background-color 0.8s ease-in-out,
        color 0.8s ease-in-out,
        border-color 0.8s ease-in-out;
}

body.dark-mode .settings-menu .card {
    background-color: #333;
    color: white;
    border-color: #444;
}

.btn-close {
    filter: none;
    opacity: 1;
    transition: filter 0.8s ease-in-out, opacity 0.8s ease-in-out;
    box-shadow: none !important;
    outline: none !important;
}

/* Dark mode */
body.dark-mode .btn-close {
    filter: invert(1);
}

/* Combined Container Toggle Styles */
#showSongListBtn.active,
#showLyricsBtn.active {
    background-color: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
}

#showSongListBtn:not(.active),
#showLyricsBtn:not(.active) {
    background-color: transparent !important;
    color: #007bff !important;
    border-color: #007bff !important;
}

/* Lyrics Container Styles */
#lyricsContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#lyricsText {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.7;
    padding: 10px;
    border-radius: 6px;
    background-color: #fafafa;
    color: #222;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

/* Dark mode for lyrics container */
body.dark-mode #lyricsText {
    background-color: #222;
    color: #e6e6e6;
}

#lyricsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

/* Lyrics controls button styling */
.lyrics-controls {
    display: flex;
    gap: 8px;
}

.lyrics-controls button {
    background: black;
    color: white;
    border: 2px solid black;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.8s ease-in-out;
    opacity: 1;
}

.lyrics-controls button:hover {
    opacity: 0.7;
}

body.dark-mode .lyrics-controls button {
    background: white !important;
    color: black !important;
    border: 2px solid white !important;
}

.lyrics-controls button:active {
    transform: scale(0.9);
}

/* Add to the existing toggle button styles */
#showSongListBtn .btn-text,
#showLyricsBtn .btn-text {
    transition: color 0.8s ease-in-out;
}

body.dark-mode #showSongListBtn.active .btn-text,
body.dark-mode #showLyricsBtn.active .btn-text {
    color: white !important;
}

/* Lyrics Text Container - Default (Desktop) */
#lyricsText {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.7;
    padding: 10px;
    border-radius: 6px;
    background-color: #fafafa;
    color: #222;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
    
    /* Default max-height for desktop */
    max-height: 500px;
}

@media (max-width: 2000px) {
    #lyricsText {
        max-height: 530px;
    }

    .lyrics-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .lyrics-controls button {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (max-width: 1000px) {
    #lyricsText {
        height: 505px;
    }
}

@media (max-width: 991px) {
    #lyricsText {
        max-height: 510px; /* Smaller for mobile */
        min-height: 460px; /* Ensure minimum height */
        font-size: 14px; /* Optional: smaller font for mobile */
        padding: 8px; /* Optional: less padding for mobile */
    }
    
    /* Optional: Adjust lyrics controls for mobile */
    .lyrics-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .lyrics-controls button {
        padding: 4px 8px;
        font-size: 11px;
    }

    .card2 {
        max-height: 670px;
    }

    #songList {
        max-height: 450px;
    }
}

@media (min-width: 800px) {
    .card2 {
        max-height: 680px;
        min-height: 680px;
    }

    #songList {
        max-height: 490px;
    }
}

/* Very small mobile devices (480px and below) */
@media (max-width: 480px) {
    #lyricsText {
        max-height: 400px; /* Even smaller for very small screens */
        font-size: 13px;
        padding: 6px;
    }
    
    #lyricsHeader {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lyrics-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 481px) {
    #lyricsText {
        max-height: 360px; /* Even smaller for very small screens */
        font-size: 13px;
        padding: 6px;
    }
}

/* Dark mode for lyrics text */
body.dark-mode #lyricsText {
    background-color: #222;
    color: #e6e6e6;
}

/* Floating Experimental Button */
.floating-experimental {
    position: fixed;
    bottom: 90px; /* Position above the settings button */
    right: 20px;
    z-index: 1000;
}

.experimental-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ffc107, #e0a800);
    border: none;
    color: #000;
}

.experimental-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.4);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.floating-experimental.active .experimental-btn {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.4);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.experimental-btn:not(:hover):not(.floating-experimental.active .experimental-btn) {
    transition: transform 0.4s ease-in, box-shadow 0.4s ease-in;
}

.experimental-btn i {
    display: inline-block;
    transition: transform 0.4s ease-in-out;
}

.experimental-btn:hover i {
    transform: rotate(180deg);
    transition: transform 0.3s ease-out;
}

.floating-experimental.active .experimental-btn i {
    transform: rotate(180deg);
    transition: transform 0.3s ease-out;
}

.experimental-btn:not(:hover):not(.floating-experimental.active .experimental-btn) i {
    transform: rotate(0deg);
    transition: transform 0.5s ease-in;
}

/* Experimental Window */
.experimental-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
    border: 1px solid transparent;
    max-height: 500px;
    overflow-y: auto;
}

.experimental-window.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s ease-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

.experimental-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid transparent;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

.experimental-header h6 {
    margin: 0;
    font-weight: 600;
    transition: color 0.8s ease-in-out;
}

.experimental-close-btn {
    padding: 0;
    width: 20px;
    height: 20px;
    font-size: 12px;
    transition: filter 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

.experimental-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

.experimental-body .card {
    margin-bottom: 10px;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
    border: 1px solid transparent;
}

.experimental-body .card-body {
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

.experimental-body .card-title {
    transition: color 0.8s ease-in-out;
}

/* Dark mode support for experimental window */
body.dark-mode .experimental-window {
    background: #222;
    border-color: #444;
}

body.dark-mode .experimental-header {
    border-bottom-color: #444;
}

body.dark-mode .experimental-header h6 {
    color: white;
}

body.dark-mode .experimental-close-btn {
    filter: invert(1);
}

body.dark-mode .experimental-body {
    background-color: #222;
    color: #fff;
}

body.dark-mode .experimental-body .card {
    background-color: #333;
    color: white;
    border-color: #444;
}

body.dark-mode .experimental-body .card-title {
    color: white;
}

body.dark-mode .experimental-body .text-danger {
    color: #ff6b6b !important;
}

/* Ensure text colors transition smoothly */
.experimental-window *:not(input):not(button):not(.form-check-input) {
    transition: color 0.8s ease-in-out, background-color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

/* About Window Styles */
.about-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    opacity: 0;
    visibility: hidden;
    z-index: 10000;
    transition: all 0.3s ease-in-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
    border: none;
    overflow: hidden;
}

.about-window.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.3s ease-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

.about-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid transparent;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    transition: background-color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

.about-header h6 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-close-btn {
    padding: 0;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    opacity: 0.8;
}

.about-close-btn:hover {
    opacity: 1;
}

.about-body {
    padding: 0;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
    transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

.about-content {
    padding: 20px;
}

.about-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: border-color 0.8s ease-in-out;
}

.about-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.about-section h6 {
    margin-bottom: 10px;
    color: #007bff;
    font-weight: 600;
    transition: color 0.8s ease-in-out;
}

.about-section p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.8s ease-in-out;
}

.about-section ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    transition: color 0.8s ease-in-out;
}

.about-section ul li {
    margin-bottom: 5px;
    transition: color 0.8s ease-in-out;
}

.about-section small {
    color: #666;
    transition: color 0.8s ease-in-out;
}

.creator-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.8s ease-in-out;
}

.creator-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.creator-info {
    flex-grow: 1;
}

.creator-info strong {
    display: block;
    font-size: 14px;
    transition: color 0.8s ease-in-out;
}

.creator-info small {
    font-size: 12px;
    color: #666;
    transition: color 0.8s ease-in-overflow;
}

.link-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Dark mode support for About window */
body.dark-mode .about-window {
    background: #222;
    border-color: #444;
}

body.dark-mode .about-header {
    background: linear-gradient(135deg, #333, #222);
    border-bottom-color: #444;
}

body.dark-mode .about-section {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .about-section h6 {
    color: #007bff;
}

body.dark-mode .about-section p,
body.dark-mode .about-section ul li {
    color: #e0e0e0;
}

body.dark-mode .about-section small {
    color: #aaa;
}

body.dark-mode .creator-card {
    background: rgba(77, 171, 247, 0.1);
}

body.dark-mode .creator-info strong {
    color: #ffffff;
}

body.dark-mode .creator-info small {
    color: #bbb;
}

body.dark-mode .about-close-btn {
    color: white;
}

/* Overlay backdrop */
.about-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
    transition: all 0.3s ease;
}

.about-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Add to style.css if you want to keep the info color but with white text */
.btn-info {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

.btn-info:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: white !important;
}

/* For dark mode support */
body.dark-mode .btn-info {
    background-color: #007bff !important;
    border-color: #007bff !important;
}

body.dark-mode .btn-info:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

/* Add to style.css */

/* Album Art Display Mode Toggle */
.album-art-display-toggle {
    margin-bottom: 15px;
}

.album-art-display-toggle .btn-group {
    width: 100%;
    margin-top: 5px;
}

.album-art-display-toggle .btn-group .btn {
    font-size: 12px;
    padding: 4px 8px;
    flex: 1;
}

/* Video in album art position styles */
#albumArt.video-mode {
    display: none !important;
}

#videoPlayerInAlbumArt {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    max-width: 250px;
    margin: 0 auto;
    display: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

#videoPlayerInAlbumArt #player {
    width: 100% !important;
    height: 100% !important;
    min-height: 250px;
    border-radius: 10px;
}

/* Show video player when in video mode */
.album-art-video-mode #videoPlayerInAlbumArt {
    display: block;
}

/* Hide the separate video player card when video is in album art position */
.album-art-video-mode #togglePlayerBtn,
.album-art-video-mode #togglePlayerBtn + div {
    display: none !important;
}

/* Show the separate video player when not in video mode */
.album-art-spin-mode #togglePlayerBtn,
.album-art-none-mode #togglePlayerBtn {
    display: inline-block !important;
}

.album-art-spin-mode #playerContainer,
.album-art-none-mode #playerContainer {
    display: none !important;
}

.album-art-spin-mode #playerContainer.d-none,
.album-art-none-mode #playerContainer.d-none {
    display: none !important;
}

.album-art-spin-mode #playerContainer:not(.d-none),
.album-art-none-mode #playerContainer:not(.d-none) {
    display: flex !important;
}

/* ================ LYRICS TRANSLATION STYLES ================ */

.lyrics-pair {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.original-lyric,
.translated-lyric {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.8s ease-in-out; /* Changed from 0.3s to 0.8s to match other transitions */
}

.original-lyric::before,
.translated-lyric::before {
    content: attr(data-label);
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    color: #666;
    background: rgba(0, 0, 0, 0.1);
    padding: 1px 4px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
    transition: all 0.8s ease-in-out; /* Added transition for smooth dark mode changes */
}

body.dark-mode .original-lyric::before,
body.dark-mode .translated-lyric::before {
    color: #aaa;
    background: rgba(255, 255, 255, 0.1);
}

.translated-lyric {
    color: #555;
    font-style: italic;
    background: rgba(0, 123, 255, 0.05);
    border-left: 2px solid rgba(0, 123, 255, 0.3);
    transition: all 0.8s ease-in-out;
    border-left-color: rgba(0, 123, 255, 0.5);
}

body.dark-mode .translated-lyric {
    color: #bbb;
    background: rgba(0, 123, 255, 0.1);
}

.lrc-line.highlight .original-lyric {
    font-weight: bold;
    transition: all 0.8s ease-in-out;
}

.lrc-line.highlight .translated-lyric {
    font-weight: bold;
    color: #0056b3;
    background: rgba(0, 123, 255, 0.1);
    transition: all 0.8s ease-in-out;
}

body.dark-mode .lrc-line.highlight .original-lyric {
    color: #007bff;
}

body.dark-mode .lrc-line.highlight .translated-lyric {
    color: #a5d8ff;
    background: rgba(77, 171, 247, 0.2);
}

/* Plain lyrics with translation */
.plain-line .lyrics-pair {
    margin-bottom: 8px;
}

/* Translation toggle button */
#toggleTranslationBtn {
    margin-left: 5px;
}

/* Translation status indicator */
.translation-status {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-left: 5px;
    transition: color 0.8s ease-in-out;
}

body.dark-mode .translation-status {
    color: #aaa;
}

/* Also update the existing .lrc-line styles to ensure proper transitions */
.lrc-line {
    padding: 6px 8px;
    border-radius: 4px;
    transition: background 0.8s ease-in-out, color 0.8s ease-in-out; /* Already 0.8s, good */
    display: flex;
    align-items: center;
    gap: 10px;
}

.lrc-line.highlight {
    background: rgba(0, 123, 255, 0.18);
    font-weight: bold;
    transition: background 0.8s ease-in-out, color 0.8s ease-in-out; /* Already 0.8s, good */
}

/* Ensure the .lyrics-pair and its children inherit transitions */
.lyrics-pair * {
    transition: color 0.8s ease-in-out, background-color 0.8s ease-in-out, border-color 0.8s ease-in-out;
}

/* Auto-play button styling */
#autoPlayToggle {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #ccc;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Active state (when auto-play is ON) */
#autoPlayToggle.active {
    background: #007bff;
    transform: scale(1.1);
    transition: background 0.3s, transform 0.1s;
}

/* Click animation */
#autoPlayToggle:active {
    transform: scale(0.9);
}

/* Hover effect */
#autoPlayToggle:hover {
    background: #aaa;
}

#autoPlayToggle.active:hover {
    background: #0056b3;
}

/* Container for both buttons */
.d-flex.align-items-center.gap-2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.d-flex.align-items-center.gap-2 span {
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .d-flex.align-items-center.gap-2 {
        flex-direction: column;
        gap: 5px;
    }
    
    .d-flex.align-items-center.gap-2 span {
        font-size: 14px;
    }
}

/* Cache Manager Window */
.cache-manager-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    opacity: 0;
    visibility: hidden;
    z-index: 10000;
    transition: all 0.3s ease-in-out, background-color 0.8s ease-in-out, color 0.8s ease-in-out, border-color 0.8s ease-in-out;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cache-manager-window.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cache-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
}

.cache-manager-header h6 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.cache-manager-close-btn {
    padding: 0;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    opacity: 0.8;
}

.cache-manager-close-btn:hover {
    opacity: 1;
}

.cache-manager-body {
    padding: 0;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
    background: white;
}

.cache-manager-content {
    padding: 20px;
}

/* Cache Categories */
.cache-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cache-categories .btn {
    font-size: 13px;
    padding: 6px 12px;
}

/* Cache Stats */
.cache-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

/* Cache Actions */
.cache-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Cache List */
.cache-list-container {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.cache-list-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
    font-size: 13px;
}

.cache-checkbox {
    width: 40px;
    text-align: center;
}

.cache-checkbox .form-check-input {
    cursor: pointer;
    margin: 0;
}

.cache-key {
    flex: 3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cache-type {
    width: 100px;
    text-align: center;
}

.cache-size {
    width: 80px;
    text-align: right;
}

.cache-age {
    width: 100px;
    text-align: center;
}

.cache-actions-header {
    width: 80px;
    text-align: center;
}

.cache-list {
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

.cache-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    font-size: 13px;
}

.cache-item:hover {
    background: rgba(0, 123, 255, 0.05);
}

.cache-item.selected {
    background: rgba(0, 123, 255, 0.1);
}

.cache-item .cache-checkbox {
    width: 40px;
    text-align: center;
}

.cache-item .cache-key {
    flex: 3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.cache-item .cache-type {
    width: 100px;
    text-align: center;
}

.cache-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.cache-type-badge.search {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}

.cache-type-badge.lyrics {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid #28a745;
}

.cache-type-badge.translation {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.cache-item .cache-size {
    width: 80px;
    text-align: right;
    color: #666;
}

.cache-item .cache-age {
    width: 100px;
    text-align: center;
    color: #666;
    font-size: 11px;
}

.cache-item .cache-item-actions {
    width: 80px;
    text-align: center;
}

.cache-item .cache-item-actions .btn {
    padding: 2px 6px;
    font-size: 11px;
}

/* Cache Item Details Modal */
.cache-item-details-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    opacity: 0;
    visibility: hidden;
    z-index: 10001;
    transition: all 0.3s ease-in-out;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cache-item-details-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cache-item-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.cache-item-details-header h6 {
    margin: 0;
    font-weight: 600;
    color: white;
}

.cache-item-details-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
}

.detail-value {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    word-break: break-all;
}

.detail-content {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cache-item-details-footer {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: flex-end;
}

/* Cache Manager Overlay */
.cache-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
    transition: all 0.3s ease;
}

.cache-manager-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Empty Cache List */
.empty-cache-list {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.empty-cache-list i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
}

/* Dark mode support */
body.dark-mode .cache-manager-window {
    background-color: #222 !important;
    border-color: #444 !important;
}

body.dark-mode .cache-manager-body {
    background-color: #222 !important;
}

body.dark-mode .cache-manager-content {
    background-color: #222 !important;
}

body.dark-mode .cache-list-container {
    background-color: #222 !important;
    border-color: #444 !important;
}

body.dark-mode .cache-list-header {
    background: linear-gradient(135deg, #333, #222) !important;
    color: white !important;
    border-bottom-color: #444 !important;
}

body.dark-mode .cache-list {
    background-color: #222 !important;
}

body.dark-mode .cache-item {
    background-color: #222 !important;
    border-bottom-color: #333 !important;
    color: white !important;
}

body.dark-mode .cache-item:hover {
    background-color: #333 !important;
}

body.dark-mode .cache-item.selected {
    background-color: #2a3f5a !important;
}

body.dark-mode .cache-item .cache-key {
    color: white !important;
}

body.dark-mode .cache-item .cache-size,
body.dark-mode .cache-item .cache-age {
    color: #aaa !important;
}

/* Cache Type Badges in Dark Mode */
body.dark-mode .cache-type-badge.search {
    background: rgba(23, 162, 184, 0.2) !important;
    color: #5bc0de !important;
    border-color: #17a2b8 !important;
}

body.dark-mode .cache-type-badge.lyrics {
    background: rgba(40, 167, 69, 0.2) !important;
    color: #5cb85c !important;
    border-color: #28a745 !important;
}

body.dark-mode .cache-type-badge.translation {
    background: rgba(255, 193, 7, 0.2) !important;
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

/* Cache Stats in Dark Mode */
body.dark-mode .cache-stats {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #444 !important;
}

body.dark-mode .stat-label {
    color: #aaa !important;
}

body.dark-mode .stat-value {
    color: #007bff !important;
}

/* Cache Actions Buttons in Dark Mode */
body.dark-mode .cache-actions .btn-outline-primary {
    color: #007bff !important;
    border-color: #007bff !important;
    background-color: transparent !important;
}

body.dark-mode .cache-actions .btn-outline-primary:hover {
    color: white !important;
    background-color: #007bff !important;
}

body.dark-mode .cache-actions .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

body.dark-mode .cache-actions .btn-outline-danger:hover {
    color: white !important;
    background-color: #dc3545 !important;
}

/* Cache Item Details Modal in Dark Mode */
body.dark-mode .cache-item-details-modal {
    background-color: #222 !important;
    border-color: #444 !important;
}

body.dark-mode .cache-item-details-header {
    border-bottom-color: #444 !important;
}

body.dark-mode .cache-item-details-body {
    background-color: #222 !important;
}

body.dark-mode .detail-section label {
    color: #aaa !important;
}

body.dark-mode .detail-value,
body.dark-mode .detail-content {
    background-color: #333 !important;
    border-color: #444 !important;
    color: #ddd !important;
}

body.dark-mode .cache-item-details-footer {
    background-color: #222 !important;
    border-top-color: #444 !important;
}

/* Empty Cache List in Dark Mode */
body.dark-mode .empty-cache-list {
    color: #aaa !important;
}

body.dark-mode .empty-cache-list i {
    color: #444 !important;
}

body.dark-mode .form-check-input:checked {
    background-color: #007bff !important;
    border-color: #007bff !important;
}

/* Scrollbar in Dark Mode */
body.dark-mode .cache-list::-webkit-scrollbar-track {
    background: #222 !important;
}

body.dark-mode .cache-list::-webkit-scrollbar-thumb {
    background: #444 !important;
}

body.dark-mode .cache-list::-webkit-scrollbar-thumb:hover {
    background: #555 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .cache-manager-window {
        width: 95%;
        max-height: 90vh;
    }

    .cache-list-header {
        font-size: 11px;
    }

    .cache-key {
        flex: 2;
    }

    .cache-type,
    .cache-size,
    .cache-age {
        display: none;
    }

    .cache-actions-header {
        width: 60px;
    }

    .cache-item .cache-type,
    .cache-item .cache-size,
    .cache-item .cache-age {
        display: none;
    }

    .cache-stats {
        flex-direction: column;
        gap: 10px;
    }

    .cache-actions {
        flex-direction: column;
    }

    .cache-actions .btn {
        width: 100%;
    }
}