/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    color: #333;
}

/* Top Navigation Bar - Combined row */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1002;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border-bottom: 2px solid lime;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.top-nav-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Source Selector Dropdown */
.source-selector {
    position: relative;
    display: inline-block;
}

.source-selector-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border: 2px solid #444;
    border-radius: 8px;
    color: lime;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    justify-content: space-between;
}

.source-selector-button:hover {
    border-color: lime;
    background: linear-gradient(135deg, #3a3a3a, #2d2d2d);
    box-shadow: 0 0 15px rgba(0, 255, 127, 0.2);
}

.source-selector-icon {
    font-size: 18px;
}

.source-selector-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.source-selector.open .source-selector-arrow {
    transform: rotate(180deg);
}

.source-selector-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 100%;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border: 2px solid lime;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1003;
    overflow: hidden;
}

.source-selector.open .source-selector-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.source-selector-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: deepskyblue;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #2d2d2d;
    cursor: pointer;
}

.source-selector-option:last-child {
    border-bottom: none;
}

.source-selector-option:hover {
    background: rgba(0, 255, 127, 0.15);
    color: lime;
}

.source-selector-option.active {
    background: rgba(0, 255, 127, 0.25);
    color: lime;
    border-left: 4px solid lime;
}

.source-option-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.source-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.source-option-name {
    font-weight: 600;
    font-size: 15px;
}

.source-option-location {
    font-size: 11px;
    opacity: 0.7;
}

.source-option-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.source-option-status.online {
    background: rgba(0, 255, 0, 0.2);
    color: #0f0;
}

.source-option-status.offline {
    background: rgba(255, 0, 0, 0.2);
    color: #f66;
}

.source-option-status.local {
    background: rgba(0, 191, 255, 0.2);
    color: deepskyblue;
}

.top-nav-link {
    color: deepskyblue;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
}

.top-nav-link:hover {
    background: rgba(0, 255, 127, 0.2);
    color: lime;
}

.top-nav-link.active {
    background: rgba(0, 255, 127, 0.3);
    color: lime;
    border: 1px solid lime;
}

/* Breadcrumb Navigation - now inside top-nav */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: lime;
    font-style: italic;
}

.breadcrumb-link {
    color: deepskyblue;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.breadcrumb-link:hover {
    background: rgba(0, 191, 255, 0.2);
    color: lime;
}

.breadcrumb-current {
    color: lime;
    font-weight: 500;
}

/* Search Bar - now inside top-nav-right */
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 300px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-input {
    flex: 1;
    padding: 15px 50px 15px 20px;
    font-size: 18px;
    border: 2px solid #444;
    border-radius: 25px;
    background: #000;
    color: deepskyblue;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.search-input:focus {
    border-color: deepskyblue;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.search-input::placeholder {
    color: #666;
    font-style: italic;
}

.search-icon {
    position: absolute;
    right: 20px;
    color: #666;
    font-size: 20px;
    pointer-events: none;
}

.search-results-count {
    color: lime;
    font-size: 14px;
    margin-left: 10px;
    white-space: nowrap;
}

.clear-search {
    background: #333;
    border: none;
    color: deepskyblue;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.clear-search:hover {
    background: #555;
    color: lime;
}

.rescan-button {
    background: #333;
    border: none;
    color: lime;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.rescan-button:hover {
    background: #555;
    color: #0f0;
}

.rescan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hide filtered items */
.link.search-hidden {
    display: none !important;
}

.song-row.search-hidden {
    display: none !important;
}

.folder-row.search-hidden {
    display: none !important;
}

/* Highlight search matches */
.search-highlight {
    background: rgba(255, 215, 0, 0.4);
    color: #000;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Existing styles with enhancements */
.container {
    display: block;
    background-color: #fafafa;
    padding: 40px;
    padding-top: 20px; /* Reduced top padding since search bar adds spacing */
    max-width: 1200px;
    margin: 0 auto;
}

/* Song row container for link + direct link button */
.song-row {
    display: flex;
    align-items: stretch;
    gap: 5px;
    margin-bottom: 15px;
}

/* Folder row styling - flows horizontally like tags/chips */
.folder-row {
    display: inline-block; /* Flow horizontally like inline elements */
    margin-right: 10px;
    margin-bottom: 10px;
    vertical-align: top;
}

/* Override song-row styles when it's also a folder-row */
.song-row.folder-row {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
}

.folder-link {
    display: inline-block;
    padding: 12px 16px;
    border: 2px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    white-space: nowrap; /* Prevent text wrapping inside button */
}

.folder-link:hover {
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
    border-color: deepskyblue;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,191,255,0.2);
}

/* Direct link button */
.direct-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 50px;
}

.direct-link:hover {
    background-color: #f5f5f5;
    border-color: #666;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.videocontainer {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-gap: 20px;
}

.video {
    width: 320px;
}

/* Style the links */
.link {
    display: block;
    height: auto;
    padding: 15px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    word-wrap: break-word;
    word-break: break-word;
    text-align: left;
    font-size: 18px;
    color: #000;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
}

/* Add a hover effect to the links */
.link:hover {
    background-color: #f5f5f5;
    border-color: #666;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Style for folder paths */
.folder-path {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 5px;
    font-weight: normal;
    letter-spacing: 0;
}

/* Tablet breakpoint - folders flow naturally */
@media screen and (max-width: 1024px) {
    .folder-link {
        font-size: 15px;
        padding: 10px 14px;
    }
}

/* Make the links responsive */
@media screen and (max-width: 768px) {
    .top-nav {
        padding: 8px 12px;
        gap: 10px;
        width: 100vw;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        left: 0;
        right: 0;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Mobile dropdown adjustments */
    .source-selector-button {
        min-width: auto;
        padding: 8px 12px;
        font-size: 14px;
        gap: 8px;
    }

    .source-selector-icon {
        font-size: 16px;
    }

    .source-selector-dropdown {
        left: -12px;
        right: -12px;
        min-width: auto;
        width: calc(100vw - 24px);
    }

    .source-selector-option {
        padding: 10px 12px;
        gap: 10px;
    }

    .source-option-icon {
        font-size: 16px;
        width: 20px;
    }

    .source-option-name {
        font-size: 14px;
    }

    .source-option-location {
        font-size: 10px;
    }

    .source-option-status {
        font-size: 10px;
        padding: 2px 6px;
    }

    .top-nav-right {
        min-width: 100%;
        order: 3; /* Search bar wraps to bottom on mobile */
    }

    .breadcrumb {
        order: 2;
        font-size: 12px;
    }

    .search-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .search-input {
        font-size: 16px;
        padding: 12px 40px 12px 15px;
        min-width: 0; /* Allow input to shrink */
    }

    .search-results-count {
        font-size: 12px;
        order: 3; /* Move to next line */
        width: 100%;
        text-align: center;
        margin: 0;
        padding-top: 5px;
    }

    .clear-search {
        order: 2;
        padding: 6px 12px;
        font-size: 12px;
        flex-shrink: 0; /* Don't shrink the button */
    }

    .rescan-button {
        order: 2;
        padding: 6px 12px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .container {
        padding: 20px;
        gap: 10px;
    }

    .song-row {
        gap: 3px;
    }

    /* On mobile, allow folder names to wrap and take full width if needed */
    .folder-link {
        font-size: 14px;
        padding: 10px 12px;
        white-space: normal; /* Allow wrapping on mobile */
        word-break: break-word; /* Break long words */
        max-width: 100%; /* Don't overflow screen */
    }

    .folder-row,
    .song-row.folder-row {
        max-width: 100%; /* Folders can take full width on mobile if needed */
    }

    .link {
        padding: 12px 15px;
        font-size: 16px;
    }

    .direct-link {
        padding: 0 12px;
        min-width: 45px;
        font-size: 18px;
    }

    .folder-path {
        font-size: 12px;
        margin-top: 3px;
    }

    .audio-player-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .speed-control {
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }

    .speed-slider {
        width: 100px;
    }
}

audio {
    max-width: 100%;
    max-height: 100%;
}

/* Audio player wrapper with speed control */
.audio-player-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

/* Speed control styles */
.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    padding: 10px 15px;
    border-radius: 8px;
    color: deepskyblue;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.speed-value {
    font-weight: bold;
    color: lime;
    min-width: 45px;
    text-align: center;
}

.speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: linear-gradient(to right, #444, #666);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: deepskyblue;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    background: lime;
    transform: scale(1.1);
}

.speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: deepskyblue;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.speed-slider::-moz-range-thumb:hover {
    background: lime;
    transform: scale(1.1);
}

/* Loading indicator for search */
.search-loading {
    display: none;
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

.search-loading.active {
    display: inline-block;
}

/* Sticky Audio Player */
.sticky-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #0f0f0f, #1a1a1a);
    border-top: 3px solid #333;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    transition: transform 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.sticky-audio-player.hidden {
    transform: translateY(100%);
}

/* Content wrapper that can be collapsed */
.player-content {
    transition: all 0.3s ease-in-out;
    max-height: 300px;
    overflow: visible;
}

/* Collapsed state - hide content completely */
.player-content.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Toggle button for show/hide - always visible when player is active */
.player-toggle-button {
    position: absolute;
    top: -30px;
    right: 20px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 2px solid #333;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: deepskyblue;
    font-size: 16px;
    width: 50px;
    height: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001; /* Above player content */
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

/* When player is hidden, hide ONLY the button (keep with parent) */
.sticky-audio-player.hidden {
    transform: translateY(100%);
}

.player-toggle-button:hover {
    background: linear-gradient(135deg, #2d2d2d, #3a3a3a);
    color: lime;
    border-color: lime;
}

.player-toggle-button:active {
    transform: scale(0.95);
}

.sticky-audio-player .now-playing-metadata {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.sticky-audio-player .now-playing-metadata img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    margin-right: 15px;
    object-fit: cover;
}

.sticky-audio-player .audio-player-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.sticky-audio-player audio {
    flex: 1;
    max-width: 600px;
}

/* Add padding to body to prevent content from being hidden behind sticky player */
body {
    padding-bottom: 0;
    transition: padding-bottom 0.3s ease-in-out;
}

body.player-active {
    padding-bottom: 200px;
}

/* Mobile responsive for sticky player - make everything 50% smaller */
@media screen and (max-width: 768px) {
    .sticky-audio-player {
        padding: 5px;
        width: 100vw;
        max-width: 100%;
        box-sizing: border-box;
        overflow: visible !important; /* Allow toggle button to show */
        margin: 0;
        left: 0;
        right: 0;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .sticky-audio-player .now-playing-metadata {
        padding: 6px 8px;
        margin-bottom: 5px;
        border-radius: 4px;
        overflow: hidden;
    }

    .sticky-audio-player .now-playing-metadata img {
        width: 40px;
        height: 40px;
        border-radius: 3px;
        margin-right: 8px;
        margin-bottom: 0;
    }

    .sticky-audio-player .now-playing-metadata > div {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .sticky-audio-player .now-playing-metadata > div > div:nth-child(1) {
        font-size: 11px;
        font-weight: bold;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sticky-audio-player .now-playing-metadata > div > div:nth-child(2) {
        font-size: 10px;
        opacity: 0.9;
        margin-bottom: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sticky-audio-player .now-playing-metadata > div > div:nth-child(3) {
        font-size: 9px;
        opacity: 0.7;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sticky-audio-player .now-playing-metadata a {
        font-size: 9px !important;
        padding: 2px 5px !important;
        margin-top: 2px !important;
    }

    .sticky-audio-player .audio-player-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 3px;
        flex-wrap: wrap;
        width: 100%;
        box-sizing: border-box;
    }

    .sticky-audio-player audio {
        flex: 1;
        min-width: 150px;
        max-width: 100%;
        height: 32px;
    }

    .sticky-audio-player .speed-control {
        padding: 3px 5px;
        border-radius: 4px;
        font-size: 10px;
        gap: 3px;
    }

    .sticky-audio-player .speed-control label {
        margin-right: 2px;
        display: none; /* Hide "Speed:" label on mobile to save space */
    }

    .sticky-audio-player .speed-value {
        min-width: 28px;
        font-size: 9px;
    }

    .sticky-audio-player .speed-slider {
        width: 40px;
        height: 4px;
    }

    .sticky-audio-player .speed-slider::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
    }

    .sticky-audio-player .speed-slider::-moz-range-thumb {
        width: 12px;
        height: 12px;
    }

    body.player-active {
        padding-bottom: 95px;
    }

    /* Mobile styles for toggle button */
    .player-toggle-button {
        top: -25px;
        right: 10px;
        width: 40px;
        height: 25px;
        font-size: 14px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 2002;
    }

    /* No additional mobile-specific collapsed styles needed - content wrapper handles it */
}

/* Discogs Integration Styles */
.discogs-result {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.discogs-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.discogs-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Collection link style */
.discogs-collection {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    border-color: rgba(255, 165, 0, 0.3);
}

.discogs-collection:hover {
    background: rgba(255, 165, 0, 0.25);
}

/* Match found style */
.discogs-match {
    background: rgba(135, 206, 250, 0.15);
    color: #87ceeb;
    border-color: rgba(135, 206, 250, 0.3);
}

.discogs-match:hover {
    background: rgba(135, 206, 250, 0.25);
}

.confidence-badge {
    display: inline-block;
    margin: 0 4px;
    font-weight: bold;
    font-size: 14px;
}

/* Search link style */
.discogs-search, .discogs-error {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.discogs-search:hover, .discogs-error:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* More results link */
.discogs-more {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 2px 6px;
    font-size: 11px;
}

.discogs-more:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: none;
    box-shadow: none;
}

/* Metadata badges */
.discogs-year, .discogs-format {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.discogs-loading {
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #discogs-info {
        margin-top: 4px !important;
    }

    .discogs-result {
        font-size: 10px;
        gap: 4px;
    }

    .discogs-link {
        padding: 2px 5px !important;
        font-size: 9px !important;
    }

    .discogs-link svg {
        width: 10px !important;
        height: 10px !important;
        margin-right: 3px !important;
    }

    .discogs-year, .discogs-format {
        font-size: 8px;
        padding: 1px 3px;
    }

    .discogs-more {
        font-size: 8px;
        padding: 1px 4px;
    }

    .discogs-loading,
    .discogs-offline {
        font-size: 9px !important;
    }

    .confidence-badge {
        font-size: 10px;
        margin: 0 2px;
    }
}

/* Media Section Headers */
.media-section {
    margin-top: 30px;
}

.section-header {
    color: deepskyblue;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0 15px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-left: 4px solid lime;
    border-radius: 5px;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,255,127,0.3);
}

.image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-filename {
    padding: 10px;
    font-size: 12px;
    color: #ccc;
    background: #1a1a1a;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Video Gallery */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.video-item {
    border-radius: 8px;
    overflow: hidden;
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.video-item.playing {
    box-shadow: 0 0 20px rgba(0,255,127,0.6);
    border: 2px solid lime;
    transform: scale(1.02);
}

.video-item video {
    width: 100%;
    display: block;
    background: #000;
}

.video-filename {
    padding: 10px;
    font-size: 13px;
    color: #ccc;
    background: #1a1a1a;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .image-item img {
        height: 150px;
    }

    .video-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section-header {
        font-size: 20px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Recent Songs Section - Compact with metadata (accessible colors) */
.recent-songs-section {
    margin-bottom: 25px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #1a2332, #0f1720);
    border: 2px solid #4fc3f7;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(79, 195, 247, 0.2);
}

.recent-songs-header {
    margin: 0 0 10px 0;
    padding: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #4fc3f7;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-songs-header::before {
    content: "🔥";
    font-size: 16px;
}

.recent-songs-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-song-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: stretch;
}

.recent-song-item:hover {
    background: rgba(79, 195, 247, 0.12);
    border-color: rgba(79, 195, 247, 0.5);
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.25);
}

/* Using .recent-song-item ancestor for higher specificity than .link (0,2,0 > 0,1,0) */
.recent-song-item .link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    border: none;
    background: #1a2332;
    background-color: #1a2332;
    background-image: none;
    flex: 1;
    min-width: 0;
}

.recent-song-item .link:hover {
    background: #243347;
    background-color: #243347;
    background-image: none;
}

.recent-song-artwork {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: #333;
}

.recent-song-artwork-placeholder {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
}

.recent-song-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.recent-song-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-song-artist {
    font-size: 10px;
    color: #ffd54f;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-song-album {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.recent-song-breadcrumb {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-song-meta {
    display: flex;
    gap: 8px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    flex-wrap: nowrap;
    white-space: nowrap;
}

.recent-song-meta span {
    display: inline-block;
}

.recent-song-meta strong {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 2px;
}

.recent-song-duration {
    font-size: 10px;
    color: #81d4fa;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
    padding-left: 10px;
}

.recent-song-item .direct-link {
    padding: 0 10px;
    min-width: 35px;
    font-size: 14px;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    border-radius: 0;
}

.recent-song-item .direct-link:hover {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
}

/* Mobile Responsive for Recent Songs */
@media (max-width: 768px) {
    .recent-songs-section {
        padding: 10px 12px;
        margin-bottom: 20px;
    }

    .recent-songs-header {
        font-size: 14px;
    }

    .recent-song-artwork,
    .recent-song-artwork-placeholder {
        width: 35px;
        height: 35px;
        min-width: 35px;
    }

    .recent-song-title {
        font-size: 11px;
    }

    .recent-song-artist {
        font-size: 9px;
    }

    .recent-song-album {
        font-size: 8px;
    }

    .recent-song-meta {
        font-size: 8px;
    }

    .recent-song-duration {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .recent-songs-section {
        padding: 8px 10px;
        margin-bottom: 15px;
    }

    .recent-songs-header {
        font-size: 13px;
    }

    .recent-song-link {
        padding: 5px 8px;
        gap: 8px;
    }

    .recent-song-artwork,
    .recent-song-artwork-placeholder {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .recent-song-title {
        font-size: 10px;
    }
}

/* Loading animations for recent songs */
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
    opacity: 0.5;
    animation: pulse 1.5s ease-in-out infinite;
}

.recent-song-item[data-loading="true"] {
    opacity: 0.85;
}

.recent-song-item[data-loading="false"] {
    animation: fadeInMeta 0.3s ease-out;
}

@keyframes fadeInMeta {
    from {
        background: rgba(79, 195, 247, 0.2);
    }
    to {
        background: rgba(255, 255, 255, 0.05);
    }
}

.recent-song-item .recent-song-artwork {
    animation: fadeInArt 0.3s ease-out;
}

@keyframes fadeInArt {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Endpoint Loading Overlay */
.endpoint-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.endpoint-loading-overlay.active {
    display: flex;
}

.endpoint-loading-content {
    text-align: center;
    color: lime;
}

.endpoint-loading-spinner {
    font-size: 48px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.endpoint-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}