
/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e5a36d 0%, #d4894f 50%, #871554 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

img {
    max-width: 100%;
    max-height: 100%;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ============================================
   VOICE SEARCH
   ============================================ */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    flex: 1;
    padding-right: 50px;
}

.mic-button {
    position: absolute;
    right: 8px;
    background: linear-gradient(135deg, #871554 0%, #a93670 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mic-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(135, 21, 84, 0.3);
}

.mic-button:active {
    transform: scale(0.95);
}

.mic-button.listening {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.mic-button.processing {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, #871554 0%, #a93670 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
}

/* Developer Mode Toggle Button */
.dev-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.dev-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.dev-mode-toggle.active {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.dev-icon {
    font-size: 1.2em;
}

#devModeStatus {
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Homepage Button */
.homepage-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    text-decoration: none;
    z-index: 10;
}

.homepage-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.homepage-button:active {
    transform: translateY(0);
}

.homepage-icon {
    font-size: 18px;
    line-height: 1;
}

.homepage-text {
    font-size: 14px;
}

/* Mobile responsive homepage button */
@media (max-width: 768px) {
    .homepage-button {
        position: static;
        margin: 0 auto 15px;
        width: fit-content;
        font-size: 13px;
        padding: 8px 16px;
        display: flex;
    }
    
    .homepage-button:hover {
        transform: scale(1.02);
    }
    
    .homepage-button:active {
        transform: scale(0.98);
    }
    
    .homepage-text {
        font-size: 13px;
    }
    
    .header h1 {
        margin-top: 10px;
    }
}

/* ============================================
   PASSWORD SECTION
   ============================================ */
.password-section {
    background: #f8f9fa;
    padding: 20px 40px;
    border-bottom: 1px solid #e9ecef;
}

.password-label {
    display: inline-block;
    font-weight: 600;
    margin-right: 10px;
    color: #495057;
}

#input_pass {
    padding: 10px 15px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 1em;
    width: 200px;
    transition: all 0.3s ease;
}

#input_pass:focus {
    outline: none;
    border-color: #871554;
    box-shadow: 0 0 0 3px rgba(135, 21, 84, 0.1);
}

/* ============================================
   OTP MODAL POPUP
   ============================================ */
.otp-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.otp-modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.otp-modal-content h2 {
    margin: 0 0 15px 0;
    color: #871554;
    font-size: 1.5em;
}

.otp-modal-content p {
    margin: 8px 0;
    color: #495057;
    font-size: 1em;
}

.otp-hint {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}

#modal_otp_input {
    width: 100%;
    padding: 12px 15px;
    margin: 20px 0;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 1.1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#modal_otp_input:focus {
    outline: none;
    border-color: #871554;
    box-shadow: 0 0 0 3px rgba(135, 21, 84, 0.1);
}

.otp-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.otp-submit-btn,
.otp-cancel-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.otp-submit-btn {
    background: linear-gradient(135deg, #871554, #a5195e);
    color: white;
}

.otp-submit-btn:hover {
    background: linear-gradient(135deg, #6d1044, #871554);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 21, 84, 0.3);
}

.otp-cancel-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #ced4da;
}

.otp-cancel-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-section {
    padding: 30px 40px;
    background: white;
}

.search-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #871554;
    box-shadow: 0 0 0 3px rgba(135, 21, 84, 0.1);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ============================================
   BUTTONS
   ============================================ */
.button-container {
    text-align: center;
    margin-top: 20px;
}

.button {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    text-decoration: none;
    color: #ffffff;
    background-color: #871554;
    outline: none;
}

.button-reset {
    background: transparent;
    color: #718096;
    border: 1px solid #cbd5e0;
    font-weight: 400;
    text-transform: none;
    padding: 10px 20px;
    font-size: 0.9em;
}

.button-reset:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(135, 21, 84, 0.3);
}

.button-reset:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    color: #4a5568;
    box-shadow: none;
    transform: none;
}

.text-center {
    text-align: center;
}

/* ============================================
   RESULTS SECTION - YOUTUBE STYLE GRID
   ============================================ */
.results-section {
    padding: 30px 40px;
    background: #f7fafc;
    min-height: 300px;
}

#main_message {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2em;
    color: #4a5568;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#results {
    margin-top: 20px;
}

/* Hide default table borders for album grid */
#results table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

#results tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 80px 40px; /* Increased vertical to 80px, horizontal to 40px */
    width: 100%;
}

#results tr {
    display: contents;
}

#results td {
    background: white;
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#results td:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(-6px);
}

/* ============================================
   ALBUM CARD STYLES
   ============================================ */
.album-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.album-card.playing {
    border-color: #871554;
    box-shadow: 0 0 0 3px rgba(135, 21, 84, 0.3), 0 8px 24px rgba(135, 21, 84, 0.2);
    transform: translateY(-2px);
}

/* Gradient overlay when playing */
.album-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(135, 21, 84, 0.4) 0%, rgba(169, 54, 112, 0.5) 50%, rgba(212, 137, 79, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

.album-card.playing::before {
    opacity: 1;
}

/* Ensure content appears above overlay (but not the thumbnail) */
.album-card > *:not(.album-thumbnail) {
    position: relative;
    z-index: 30;
}

.album-header {
    background: linear-gradient(135deg, #871554 0%, #a93670 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
}

/* Thumbnail overlay specifically for album header */
.album-header-thumbnail {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

/* Show header thumbnail when album is playing */
.album-card.playing .album-header-thumbnail {
    opacity: 0.9;
}

/* Ensure header content appears above thumbnail */
.album-header-top,
.album-meta {
    position: relative;
    z-index: 10;
}

.album-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    transition: padding-left 0.6s ease;
}

/* Add left padding when playing to make room for thumbnail */
.album-card.playing .album-header-top {
    padding-left: 150px;
}

/* Album thumbnail - overlays entire card including header when playing */
.album-card .album-thumbnail {
    /* Position absolutely to cover entire album card */
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    border-radius: 12px;
    /* Start hidden */
    opacity: 0;
    transform: scale(1.1);
    transition: all 0.6s ease;
    /* Layer above header background but below interactive elements */
    z-index: 25 !important;
    pointer-events: none;
}

/* Show thumbnail overlay when album is playing */
.album-card.playing .album-thumbnail {
    opacity: 0.35;
    transform: scale(1);
}

.album-title {
    font-size: 1.2em;
    font-weight: 700;
    word-wrap: break-word;
    flex: 1;
    display: flex;
    align-items: center;
}

.album-id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    color: #871554;
    border-radius: 50%;
    font-size: 1.3em;
    font-weight: 800;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.album-play-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #871554;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-left: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.album-play-btn:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: padding-left 0.6s ease;
}

/* Add left padding when playing to make room for thumbnail */
.album-card.playing .album-meta {
    padding-left: 150px;
}

.album-meta-tag {
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.album-body {
    padding: 15px; /* Added padding since we removed the header */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Inner songs header - HIDDEN */
.inner-songs-header {
    display: none;
}

.inner-songs-count {
    display: flex;
    align-items: center;
}

.inner-songs-count::before {
    content: '🎵';
    margin-right: 8px;
    font-size: 1.2em;
}

/* Inner song list */
.inner-song-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 8px; /* All corners rounded now that header is removed */
    background: white;
}

/* Custom scrollbar for song list */
.inner-song-list::-webkit-scrollbar {
    width: 8px;
}

.inner-song-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.inner-song-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.inner-song-list::-webkit-scrollbar-thumb:hover {
    background: #871554;
}

.inner-song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    background: white;
}

.inner-song-item:last-child {
    border-bottom: none;
}

.inner-song-item:hover {
    background: linear-gradient(90deg, #fef5f8 0%, #ffffff 100%);
}

.inner-song-item.active {
    background: linear-gradient(90deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 4px solid #4caf50;
    padding-left: 11px;
}

.inner-song-item.active .inner-play-btn {
    background: #4caf50;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4);
}

.inner-song-item.active .inner-song-time {
    background: #4caf50;
    color: white;
}

/* Matched items from search results */
.inner-song-item.matched {
    background: linear-gradient(90deg, #ffeb3b 0%, #fff59d 100%);
    border-left: 4px solid #fbc02d;
    padding-left: 11px;
}

.inner-song-item.matched .inner-song-time {
    background: #fbc02d;
    color: #000;
    font-weight: 700;
}

/* Active state takes precedence over matched */
.inner-song-item.active.matched {
    background: linear-gradient(90deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 4px solid #4caf50;
}

.inner-song-item.active.matched .inner-song-time {
    background: #4caf50;
}

/* Info-only items (no timestamp) */
.inner-song-item.info-only {
    padding-left: 50px;
    font-style: italic;
    color: #718096;
    background: #f7fafc;
}

.inner-song-item.info-only:hover {
    background: #f7fafc;
    cursor: default;
}

.inner-info-text {
    font-size: 0.9em;
}

/* Inner play button */
.inner-play-btn {
    background: #871554;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9em;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(135, 21, 84, 0.3);
    position: relative;
}

.inner-play-btn:hover {
    background: #a93670;
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(135, 21, 84, 0.4);
}

.inner-play-btn:active {
    transform: scale(1.05);
}

/* Pulse animation for play buttons */
@keyframes playPulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(135, 21, 84, 0.3);
    }
    50% {
        box-shadow: 0 2px 4px rgba(135, 21, 84, 0.3), 0 0 0 6px rgba(135, 21, 84, 0.1);
    }
}

.inner-song-item:hover .inner-play-btn {
    animation: playPulse 1.5s infinite;
}

/* Button container for play and share buttons */
.inner-button-container {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

/* Share button */
.inner-share-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inner-share-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
    border-color: #ccc;
}

.inner-share-btn:active {
    transform: scale(0.95);
}

/* Inner song info */
.inner-song-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.inner-song-time {
    display: inline-block;
    background: #871554;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    width: fit-content;
}

.inner-song-text-container {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.inner-song-text {
    color: #2d3748;
    font-size: 0.95em;
    line-height: 1.4;
    word-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.inner-song-text.truncated {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.show-more-btn {
    background: #f7fafc;
    border: 1px solid #cbd5e0;
    color: #667eea;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-transform: lowercase;
    flex-shrink: 0;
}

.show-more-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

/* ============================================
   AUDIO PLAYER STYLES
   ============================================ */
audio {
    width: 100%;
    margin-top: 10px;
    outline: none;
    height: 64px;
}

/* Custom time display - shows only current time */
.custom-time-display {
    font-size: 18px;
    font-weight: 600;
    color: #871554;
    text-align: center;
    padding: 8px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Album player within song-player-container */
.song-player-container {
    margin: 0;
    padding: 20px 25px;
    background: linear-gradient(135deg, #fef5f8 0%, #fce7f3 100%);
    border-top: 2px solid #871554;
    border-bottom: 2px solid #871554;
    display: none;
}

.song-player-container audio {
    margin-bottom: 15px;
    height: 64px;
    transition: transform 0.3s ease, margin 0.3s ease, height 0.3s ease;
    transform-origin: left center;
}

/* Hide the native time display only for individual song playback (not album playback) */
.song-player-container audio.song-playback::-webkit-media-controls-current-time-display,
.song-player-container audio.song-playback::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.song-player-container audio.song-playback::-moz-media-controls-time-remaining {
    display: none !important;
}

/* Expand audio player on hover for easier interaction */
.song-player-container audio:hover {
    transform: scaleX(1.15);
    margin-bottom: 25px;
    height: 72px;
}

/* Make the timeline/seek bar much larger and easier to click */
.song-player-container audio::-webkit-media-controls-timeline {
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    background: linear-gradient(to right, #d0d0d0, #e0e0e0) !important;
    padding: 4px 0 !important;
}

/* Increase the hover area for the timeline */
.song-player-container audio::-webkit-media-controls-timeline:hover {
    height: 32px !important;
    background: linear-gradient(to right, #c0c0c0, #d5d5d5) !important;
}

/* Make the scrubber/thumb much larger for easier dragging */
.song-player-container audio::-webkit-slider-thumb {
    height: 24px !important;
    width: 20px !important;
    cursor: grab !important;
    border-radius: 4px !important;
}

.song-player-container audio::-webkit-slider-thumb:active {
    cursor: grabbing !important;
}

/* Firefox-specific styles */
.song-player-container audio::-moz-range-track {
    height: 28px !important;
    cursor: pointer !important;
    border-radius: 8px !important;
}

.song-player-container audio::-moz-range-progress {
    height: 28px !important;
    border-radius: 8px !important;
}

.song-player-container audio::-moz-range-thumb {
    height: 24px !important;
    width: 20px !important;
    cursor: grab !important;
    border-radius: 4px !important;
}

.song-player-container audio::-moz-range-thumb:active {
    cursor: grabbing !important;
}

/* Give audio player extra space on large screens */
@media (min-width: 1200px) {
    .song-player-container {
        padding: 25px 30px;
    }
    
    audio {
        height: 60px;
    }
    
    .song-player-container audio {
        height: 60px;
    }
    
    /* Larger horizontal expansion on large screens */
    .song-player-container audio:hover {
        transform: scaleX(1.2);
    }
    
    .song-player-container audio::-webkit-media-controls-timeline {
        height: 18px !important;
        min-height: 18px !important;
    }
    
    .song-player-container audio::-webkit-slider-thumb {
        height: 18px !important;
        width: 16px !important;
    }
    
    .song-player-container audio::-moz-range-track {
        height: 18px !important;
    }
    
    .song-player-container audio::-moz-range-progress {
        height: 18px !important;
    }
    
    .song-player-container audio::-moz-range-thumb {
        height: 18px !important;
        width: 16px !important;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    audio {
        margin-top: 15px;
        height: 48px;
    }
    
    .song-player-container audio {
        height: 48px;
    }
    
    /* Moderate horizontal expansion on mobile */
    .song-player-container audio:hover,
    .song-player-container audio:active {
        transform: scaleX(1.1);
    }
    
    .song-player-container audio::-webkit-media-controls-timeline {
        height: 16px !important;
        min-height: 16px !important;
    }
    
    .song-player-container audio::-webkit-slider-thumb {
        height: 16px !important;
    }
    
    .song-player-container audio::-moz-range-track,
    .song-player-container audio::-moz-range-progress {
        height: 16px !important;
    }
    
    .song-player-container audio::-moz-range-thumb {
        height: 16px !important;
    }
}

/* Custom buffer indicator - HIDDEN by default, only show in dev mode */
.buffer-indicator {
    width: 100%;
    height: 20px; /* Increased for better visibility and control */
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    display: none; /* Hidden by default */
}

/* Show buffer indicator only in dev mode */
body.dev-mode .buffer-indicator {
    display: block;
}

/* Scale up on larger screens */
@media (min-width: 1200px) {
    .buffer-indicator {
        height: 24px;
        border-radius: 10px;
        margin-bottom: 10px;
    }
}

.buffer-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(to right, #a0a0a0, #c0c0c0);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.play-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(to right, #871554, #a5195e);
    border-radius: 6px;
    z-index: 2;
    transition: width 0.1s linear;
}

/* Progress percentage indicator - HIDDEN by default, only show in dev mode */
.progress-percentage {
    font-size: 12px;
    font-weight: 600;
    color: #871554;
    margin-top: 4px;
    text-align: right;
    font-family: 'Courier New', monospace;
    display: none; /* Hidden by default */
}

/* Show progress percentage only in dev mode */
body.dev-mode .progress-percentage {
    display: block;
}

@media (min-width: 1200px) {
    .progress-percentage {
        font-size: 14px;
        margin-top: 6px;
    }
}

.song-player-container.active {
    display: block;
}

/* ============================================
   UTILITY CLASSES (LEGACY SUPPORT)
   ============================================ */
.background-span-switch {
    display: inline-block;
    margin: 4px;
    padding: 4px 10px;
    background: rgba(135, 21, 84, 0.1);
    border-radius: 4px;
    font-size: 0.85em;
    color: #871554;
    font-weight: 600;
}

.background-switch {
    background: #871554;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s ease;
    margin: 5px;
}

.background-switch:hover {
    background: #a93670;
    transform: scale(1.05);
}

/* Legacy div styles */
.div-main {
    border-radius: 12px;
    background-color: #ffffff;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.div-sub {
    border-radius: 8px;
    background-color: #ffffff;
    padding: 15px;
    text-align: left;
}

.div-image {
    background-color: #ffffff;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    width: 10%;
    height: 100px;
    transition: all 0.3s ease;
}

.div-image:hover {
    background-color: #871554;
    border-color: #871554;
    color: white;
    transform: scale(1.05);
}

.div-image-no-border {
    padding: 2px;
    text-align: center;
    width: 20%;
    height: 100px;
    transition: all 0.3s ease;
}

.div-image-no-border:hover {
    background-color: #e5a36d;
    color: white;
}

/* Legacy positioning */
#east { top: 40%; left: 5%; }
#west { top: 40%; right: 5%; }
#north { top: 5%; right: 40%; }
#south { bottom: 5%; right: 40%; }
#midcore { bottom: 40%; right: 40%; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Extra Small Devices (Phones, < 576px) - 1 column */
@media (max-width: 575px) {
    body {
        padding: 8px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .header p {
        font-size: 0.9em;
    }
    
    /* Developer mode button for mobile */
    .dev-mode-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 0.75em;
        gap: 4px;
    }
    
    .dev-text {
        display: none; /* Hide text on very small screens, show only icon */
    }
    
    .dev-icon {
        font-size: 1.4em;
    }
    
    .password-section,
    .search-section,
    .results-section {
        padding: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    #results tbody {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .album-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .album-title {
        font-size: 1em;
    }
    
    .album-play-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        font-size: 1em;
    }
    
    /* Improve inner song list on mobile */
    .inner-song-item {
        padding: 10px;
        gap: 10px;
    }
    
    .inner-play-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 6px 10px;
    }
    
    .inner-song-info {
        gap: 6px;
    }
    
    .inner-song-time {
        font-size: 0.75em;
    }
    
    .inner-song-text {
        font-size: 0.85em;
    }
    
    .inner-song-text-container {
        flex-wrap: wrap;
    }
    
    .show-more-btn {
        font-size: 0.7em;
        padding: 2px 8px;
    }
    
    .inner-songs-header {
        padding: 10px 15px;
        font-size: 0.85em;
    }
}

/* Small Devices (Phones Landscape, Tablets Portrait, 576px - 768px) - 1-2 columns */
@media (min-width: 576px) and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    /* Developer mode button for tablets */
    .dev-mode-toggle {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .dev-text {
        display: inline; /* Show text on tablets */
    }
    
    .password-section,
    .search-section,
    .results-section {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    #results tbody {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .album-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .album-play-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* Medium Devices (Tablets, 769px - 1024px) - 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .password-section,
    .search-section,
    .results-section {
        padding: 25px;
    }
    
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    #results tbody {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .album-title {
        font-size: 1.05em;
    }
}

/* Large Devices (Laptops, 1025px - 1400px) - 2-3 columns */
@media (min-width: 1025px) and (max-width: 1400px) {
    #results tbody {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 28px;
    }
}

/* Extra Large Devices (Large Laptops and Desktops, > 1400px) - 3-4 columns */
@media (min-width: 1401px) {
    .container {
        max-width: 1600px;
    }
    
    #results tbody {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 30px;
    }
}

/* Ultra Wide Screens (> 1800px) - 4+ columns */
@media (min-width: 1801px) {
    .container {
        max-width: 1800px;
    }
    
    #results tbody {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 35px;
    }
}

#tab-space {
  -moz-tab-size: 4; /* Firefox */
  tab-size: 4;
}



a:link {
  color: white;
  text-decoration: none;
}

a:hover {
  color: pink;
}

a:active {
  color: yellow;
}

.background-switch {
  text-align: center;
  padding: 1em;
  max-width: 250px;
  font-size: 1em;
  border: 2px ;
  background-color: #871554;
  color: white;
  padding: 10px;
  border-radius: 25px;
}
.background-switch:hover {
  background-color: #a14b58;
  color: white;
}

.background-span-switch {
            display: inline-block;
            padding: 10px 20px;
            text-align: center;
            text-decoration: none;
            color: #ffffff;
            background-color: #871554;
            border-radius: 6px;
            outline: none;
            font-size: 15px;
}

.background-span-switch:hover{
  background-color: #a14b58;
  color: white;
}

.hover-rotate { margin-left: 30px; }

.hover-rotate:hover {
  -ms-transform: rotate(-10deg);
  -webkit-transform: rotate(-10deg);
  -moz-transform: rotate(-10deg);
  -o-transform: rotate(-10deg);
  transform: rotate(-10deg);

}

.hover-outline {
  margin-left: 30px;
  margin-top: 10px;
}

.hover-outline:hover {
  outline: 5px solid gray;
  outline-offset: 10px;
}