.gap-x-1 { column-gap: 0.25rem !important; }
.gap-x-2 { column-gap: 0.5rem !important; }
.gap-x-3 { column-gap: 1rem !important; }
.gap-x-4 { column-gap: 1.5rem !important; }
.gap-x-5 { column-gap: 3rem !important; }
.gap-y-1 { row-gap: 0.25rem !important; }
.gap-y-2 { row-gap: 0.5rem !important; }
.gap-y-3 { row-gap: 1rem !important; }
.gap-y-4 { row-gap: 1.5rem !important; }
.gap-y-5 { row-gap: 3rem !important; }

/* Theme Variables */
:root {
    text-decoration-skip-ink: all;
}

/* Global Reset for Icon Links */
.btn-link, .btn-xs, .edit-btn, .ai-btn, .refresh-btn, .stanza-wrapper .btn-link {
    text-decoration: none !important;
    box-shadow: none !important;
}

/* Unified Search Focus */
.input-group {
    transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.input-group:focus-within {
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(74, 137, 220, 0.2), 0 0 0 0.5rem rgba(74, 137, 220, 0.1) !important;
    transform: scale(1.015);
}
.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: #4a89dc !important;
}
.input-group .form-control:focus {
    box-shadow: none !important;
}

/* Search Bar on Home */
.hero-section .input-group-lg > .form-control,
.hero-section .input-group-lg > .input-group-text {
    padding: 0.8rem 1.2rem;
    font-size: 1.2rem;
}
.hero-section .input-group-lg > .input-group-text {
    padding-right: 0.5rem;
}

/* Password Toggle Styling - Mobile Friendly */
.password-wrapper {
    position: relative;
}
.password-wrapper input.form-control {
    padding-right: 40px; /* Space for the eye icon */
}
.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    z-index: 5;
    color: #6c757d;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.password-toggle-icon:hover, .password-toggle-icon:active {
    color: #4a89dc;
}

:root {
    --bg-body: #f0f0f0; 
    --bg-page: #e6e6e6; 
    --light-bg: #f8f8f8; 
    --light-text: #000000; 
    --dark-text: #333333; 
    --darker-text: #000000; 
    --dark-bg: #d9d9d9; 
    --button-primary: #bfbfbf; 
    --button-primary-hover: #a6a6a6; 
    --const-light: #dcdcdc; 
    --const-lighter: #f8f8f8; 
    --const-dark: #5f5f5f; 
    --const-darker: #313131; 
}

[data-theme="dark"] {
    --bg-body: #121212; 
    --bg-page: #1e1e1e; 
    --light-bg: #2d2d2d; 
    --light-text: #ffffff; 
    --dark-text: #cccccc; 
    --darker-text: #ffffff; 
    --dark-bg: #333333; 
    --button-primary: #444444; 
    --button-primary-hover: #555555; 
}

/* General Styling */
body {
    background-color: var(--bg-body);
    color: var(--light-text);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

h1 { margin: 0.5rem 0; font-size: 1.5rem; }
p { margin: 0.5rem 0; }

/* Compact Lyrics & Song View */
.lyrics-section.compact .stanza-header {
    font-size: 0.6rem;
    color: var(--const-dark);
    margin-bottom: 0.1rem;
    opacity: 0.5;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.lyrics-section.compact .stanza-lyrics {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
}

.song-meta-badge {
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
}

/* Fixed container behavior */
.container-custom {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    max-width: 1300px;
}

/* Header */
.navbar {
    background-color: var(--const-lighter);
}
.header .user-info a {
    text-decoration: none;
    display: flex;
    align-items: center;
}
.header .user-info img.profile-image {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid var(--const-light);
}

/* Hero Section */
.hero-section {
    background: var(--bg-page);
    padding: 1.5rem 1rem; /* Reduced from 3rem */
    border-radius: 10px;
    margin-bottom: 1rem; /* Reduced from 2rem */
    text-align: center;
    width: 100%;
    color: var(--dark-text);
}

/* Tables (Universal Support) */
.table {
    color: var(--light-text) !important;
    margin-bottom: 1rem; /* Reduced from 2rem */
}
/* ... */
/* Card & Component Overrides for Dark Mode */
[data-theme="dark"] .card, 
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-page);
    color: var(--light-text);
    border: 1px solid var(--const-dark);
}
[data-theme="dark"] .list-group-item {
    background-color: var(--bg-page);
    color: var(--light-text);
    border-color: var(--const-dark);
}

/* Card Body Spacing */
.card-body {
    flex: 1 1 auto;
    padding: 1rem 1.25rem; /* Reduced from 2rem */
}

/* Force Light Theme Components (High Priority) */
.force-light, 
[data-theme="dark"] .force-light,
[data-theme="dark"] .dropdown-menu.force-light,
[data-theme="dark"] .navbar.force-light,
[data-theme="dark"] .footer.force-light {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #dee2e6 !important;
}

.force-light h1, .force-light h2, .force-light h3, .force-light h4, .force-light h5, .force-light p, .force-light li, .force-light a, .force-light label,
[data-theme="dark"] .force-light h5, [data-theme="dark"] .force-light p, [data-theme="dark"] .force-light li, [data-theme="dark"] .force-light a, [data-theme="dark"] .force-light label {
    color: #000000 !important;
}

.force-light .text-muted, [data-theme="dark"] .force-light .text-muted {
    color: #6c757d !important;
}

/* Specific Dropdown Item Fixes */
.force-light .dropdown-item, [data-theme="dark"] .force-light .dropdown-item {
    color: #000000 !important;
    background: transparent !important;
}
.force-light .dropdown-item:hover, [data-theme="dark"] .force-light .dropdown-item:hover {
    background-color: #f8f9fa !important;
}

/* Header Fixes */
.navbar.force-light .nav-link, .navbar.force-light .navbar-brand,
[data-theme="dark"] .navbar.force-light .nav-link, [data-theme="dark"] .navbar.force-light .navbar-brand {
    color: #000000 !important;
}

/* Admin Table Inputs */
.table td input {
    margin: -4px -7px;
    padding: 5px 4px;
    width : calc(100% + 14px);
    font-size: 0.95rem;
    background-color: inherit;
    color: inherit;
    border: 1px solid transparent;
}
.table td input:focus {
    background-color: #fff;
    color: #000;
}
[data-theme="dark"] .table td input:focus {
    background-color: #333;
    color: #fff;
}

/* Navbar Dropdown Hover Styling */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu {
        display: block;
        margin-top: 0; 
    }
}
/* Custom Audio Player */
.custom-audio-player {
    display: flex;
    align-items: center;
    background: #f1f3f4;
    border-radius: 24px;
    padding: 4px 12px;
    gap: 10px;
    user-select: none;
}

.audio-player-wrapper.compact {
    padding: 0;
    border-radius: 16px;
    background: transparent;
    border: none;
    width: 100%;
}

.audio-player-wrapper.compact .custom-audio-player {
    padding: 2px 6px;
    gap: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 16px;
    width: 100%;
}

[data-theme="dark"] .audio-player-wrapper.compact .custom-audio-player {
    background: rgba(255,255,255,0.12);
}

.audio-player-wrapper.compact .play-pause-btn {
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-player-wrapper.compact .time-display {
    font-size: 0.6rem;
    min-width: 25px;
}

.audio-player-wrapper.compact .progress-container {
    height: 3px;
}

.audio-player-wrapper.compact .audio-label-container {
    font-size: 0.6rem;
    margin-top: 1px;
    padding: 0 4px;
}

[data-theme="dark"] .audio-player-wrapper {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.audio-label-container {
    overflow: hidden;
    white-space: nowrap;
    margin-top: 2px;
    padding: 0 12px;
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
    display: flex;
    justify-content: center;
}

[data-theme="dark"] .audio-label-container {
    color: #aaa;
}

.audio-label-scroller {
    display: inline-block;
    padding-left: 0;
    transition: transform 0.1s;
}

.audio-label-container.is-overflowing {
    justify-content: flex-start;
}

.audio-label-container.is-overflowing .audio-label-scroller {
    padding-left: 100%;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

[data-theme="dark"] .custom-audio-player {
    background: #3c4043;
}

.custom-audio-player .play-pause-btn {
    background: #4a89dc;
    color: white;
    border: none;
    width: 30px; /* Reduced from 36px */
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}

.custom-audio-player .play-pause-btn:hover {
    transform: scale(1.05);
    background: #3b78c8;
}

.custom-audio-player .progress-container {
    flex-grow: 1;
    height: 4px; /* Thinner progress bar */
    background: #ccc;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

[data-theme="dark"] .custom-audio-player .progress-container {
    background: #555;
}

.custom-audio-player .progress-bar-fill {
    height: 100%;
    background: #4a89dc;
    border-radius: 2px;
    width: 0%;
}

.custom-audio-player .time-display {
    font-size: 0.7rem; /* Smaller font */
    font-family: monospace;
    color: #666;
    min-width: 30px;
}

[data-theme="dark"] .custom-audio-player .time-display {
    color: #aaa;
}

.custom-audio-player .volume-icon {
    font-size: 0.9rem;
    cursor: pointer;
}

/* Fix für Listen-Elemente in hellen Karten */
.force-light .list-group-item {
    background-color: #ffffff !important;
    color: #000000 !important;
    padding: 0.5rem 1rem; /* Compact padding */
}

/* Song Card Preview Styling */
.preview-wrapper {
    position: relative;
    background: #fff;
}

.preview-img {
    filter: saturate(1.1);
    transition: transform 0.5s ease;
}

.card:hover .preview-img {
    transform: scale(1.05);
}

.preview-gradient-top {
    /* Set via JS, but provide a white base */
    background: linear-gradient(to bottom, #fff, transparent);
}

/* Fullscreen Media Viewer */

#fs-overlay {

    position: fixed;

    top: 0;

    left: 0;

    width: 100vw;

    height: 100vh; /* Fallback */

    height: 100dvh;

    background: #000;

    z-index: 99999; /* Very high */

    display: flex;

    flex-direction: row;

    overflow: hidden;

}



#fs-main {

    flex: 1; /* Takes remaining space */

    height: 100%;

    position: relative;

    overflow-y: auto; 

    overflow-x: hidden;

    display: flex;

    flex-direction: column;

    align-items: center;

    padding: 20px;

    -webkit-overflow-scrolling: touch;

}



#fs-sidebar {

    width: 20%;

    min-width: 120px;

    max-width: 200px;

    height: 100%;

    background: #1a1a1a;

    border-left: 1px solid #333;

    overflow-y: auto;

    flex-shrink: 0;

    z-index: 100000;

    padding: 10px;

    display: flex;

    flex-direction: column;

    gap: 10px;

}



#fs-controls {

    position: fixed;

    top: 10px;

    left: 10px;

    z-index: 100001; /* Above everything */

    display: flex;

    gap: 10px;

    background: rgba(0, 0, 0, 0.5);

    padding: 8px;

    border-radius: 8px;

    backdrop-filter: blur(4px);

}



.fs-thumb {

    width: 100%;

    background: #000;

    border: 2px solid #444;

    cursor: pointer;

    border-radius: 4px;

    opacity: 0.8;

    transition: all 0.2s;

    overflow: hidden;

}



.fs-thumb:hover {

    opacity: 1;

    border-color: #666;

}



.fs-thumb.active {

    border-color: #4a89dc;

    opacity: 1;

    box-shadow: 0 0 8px rgba(74, 137, 220, 0.5);

}



.fs-thumb img {

    width: 100%;

    height: auto;

    display: block;

}



.fs-thumb-text {

    color: #eee;

    font-size: 0.7rem;

    text-align: center;

    padding: 4px;

    background: #222;

}



/* Inverted Mode */

.inverted-mode #fs-main {

    filter: invert(1) hue-rotate(180deg);

    background: #fff;

}

/* Controls and Sidebar stay dark/standard in inverted mode for usability */
