:root {
    /* Modern Slate/Blue Palette */
    --primary-color: #3b82f6;
    /* Bright Blue */
    --primary-hover: #2563eb;
    /* Darker Blue */
    --background-dark: #0f172a;
    /* Deep Slate */
    --surface-dark: #1e293b;
    /* Lighter Slate */
    --surface-hover: #334155;
    /* Hover Slate */
    --text-primary: #f8fafc;
    /* White-ish */
    --text-secondary: #cbd5e1;
    /* Light Gray */
    --border-color: #334155;
    /* Slate Border */
    --error-color: #ef4444;
    /* Red */
    --success-color: #10b981;
    /* Emerald */
    --warning-color: #ffc107;
    /* Amber/Yellow */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --input-bg: rgba(0, 0, 0, 0.2);

    /* Standardized Z-Index Scale */
    --z-base: 1;
    --z-sticky: 100;
    --z-drawer: 200;
    --z-navbar: 1000;
    --z-dropdown: 1100;

    /* Tiered Modals */
    --z-modal-primary: 2000;
    /* Song Viewer, standard modals */
    --z-modal-stack: 3000;
    /* Editors, Notes, sub-modals */
    --z-modal-top: 4000;
    /* Confirmation alerts, high priority */

    --z-popover: 5000;
    --z-tooltip: 6000;
    --z-max: 99999;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 60px;
    /* Space for fixed navbar */
}

/* Authentication Pages (Centered & Compact) */
.auth-container {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--background-dark);
}

.auth-box {
    background-color: var(--surface-dark);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    /* Centered and smaller as requested */
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.4s ease-out;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;

}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background-color: var(--surface-dark);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Navbar */
.navbar {
    background-color: var(--surface-dark);
    height: 60px;
    padding: 0 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background-color: var(--surface-hover);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.search-tab {
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.search-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Dashboard */
.group-header {
    background-color: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.group-info h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.group-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.group-nav .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dashboard-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.card {
    background-color: var(--surface-dark);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending,
.status-propuesta {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-accepted,
.status-lista {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-aprendiendo {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-descartada {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Forms */
input,
select,
textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}

select option {
    background-color: var(--surface-dark);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 1rem;
}

.modal-content {
    background-color: var(--surface-dark);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 95vh;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn,
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}



@media (max-width: 911px) {

    /* Dashboard Header Mobile Adjustments */
    .profile-summary {
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 1.5rem !important;
    }

    .profile-main-info {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        width: 100%;
    }

    .profile-actions-wrapper {
        width: 100%;
        display: flex !important;
        flex-direction: column;
        gap: 1.5rem !important;
    }

    .actions-primary {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px !important;
    }

    .actions-secondary {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px !important;
        padding-left: 0 !important;
        border-left: none !important;
    }

    .actions-primary .btn,
    .actions-secondary .btn {
        width: 100% !important;
        font-size: 0.85rem !important;
        padding: 0.75rem 0.5rem !important;
    }

    #teacher-panel-btn {
        grid-column: 1 / -1;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--surface-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-user {
        display: none;
    }

    .dashboard-grid,
    .results-grid,
    .filter-grid {
        grid-template-columns: 1fr !important;
    }

    /* Search Tabs Responsive */
    .search-tabs {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        border-bottom: none !important;
    }

    .search-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 0.6rem 1rem !important;
        background: var(--surface-hover);
        border-radius: 8px !important;
        border: 1px solid var(--border-color);
        font-size: 0.9rem;
    }

    .search-tab.active {
        background: var(--primary-color) !important;
        color: white !important;
        border-color: var(--primary-color) !important;
    }

    /* Section Headers Mobile Adjustments */
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .section-header-main {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .section-search-group {
        width: 100% !important;
        display: flex !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .section-search-group .search-wrapper {
        flex: 1 !important;
        max-width: none !important;
    }

    .section-header-actions {
        width: 100%;
        justify-content: space-between;
        display: flex;
        margin-top: 0.5rem;
    }
}

/* --- Song Viewer Modal Internal Styles --- */
.viewer-modal-content {
    width: 95%;
    max-width: 900px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.viewer-toolbar {
    padding: 0.5rem;
    background: #1a1a1a;
    display: flex;
    gap: 0.8rem;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    align-items: center;
    justify-content: flex-start;
    scrollbar-width: none;
}

.viewer-toolbar::-webkit-scrollbar {
    display: none;
}

.viewer-tool-group {
    display: flex;
    gap: 4px;
    border-right: 1px solid #333;
    padding-right: 0.8rem;
    align-items: center;
}

.viewer-tool-group:last-child {
    border-right: none;
}

.viewer-display-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #121212;
    position: relative;
}

.viewer-song-display {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    white-space: pre-wrap;
    color: #e0e0e0;
    margin: 0;
    padding-bottom: 50vh;
}

.viewer-footer {
    padding: 1rem;
    border-top: 1px solid #333;
    background: #1a1a1a;
    border-radius: 0 0 16px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.viewer-report-form {
    z-index: var(--z-modal-stack);
    display: none;
    padding: 1.5rem;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

/* Z-Index Overrides for standardized scale */
.modal {
    z-index: var(--z-modal-primary);
}

.modal-content {
    z-index: calc(var(--z-modal-primary) + 1);
}

/* Interaction and Edit Modals (Stack Tier) */
#interaction-modal,
#song-form-modal {
    z-index: var(--z-modal-stack);
}

#interaction-modal .modal-content,
#song-form-modal .modal-content {
    z-index: calc(var(--z-modal-stack) + 1);
}

#modal-rhythm-selector {
    z-index: var(--z-modal-stack);
}

.premium-modal {
    z-index: var(--z-modal-stack) !important;
}

#confirm-removal-modal,
#global-confirm-modal {
    z-index: var(--z-modal-top) !important;
}

.viewer-toggle-btn {
    z-index: calc(var(--z-modal-primary) + 5);
}

.playback-fabs-left {
    z-index: calc(var(--z-modal-primary) + 5);
}

.add-to-lib-fab,
.report-fab {
    z-index: calc(var(--z-modal-primary) + 5);
}

@media (max-width: 768px) {
    .viewer-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}

/* Card removal button */
.remove-btn {
    position: absolute;
    top: 10px;
    left: 50px;
    /* To the right of the favorite star */
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ef4444;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* Specific overlay for the dashboard confirmation to avoid breaking other modals */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    /* Matches project tone */
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.premium-modal-content {
    background: #1e293b;
    /* Solid slate for better contrast */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    animation: modalPopUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.premium-modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #ef4444;
    font-size: 1.5rem;
}

.premium-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.premium-modal-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.premium-modal-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-solid-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
    font-weight: 700 !important;
    min-width: 140px !important;
    border-radius: 12px !important;
    padding: 0.75rem 2rem !important;
}

.btn-solid-danger:hover {
    background-color: #dc2626 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4) !important;
}

/* Base Dashboard Header Classes (Desktop) */
.profile-summary {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
}

.profile-main-info {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex: 1.5;
}

.profile-actions-wrapper {
    display: flex;
    align-items: stretch;
    gap: 2rem;
    flex: 2;
}

.actions-primary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
    flex: 1;
    min-width: 180px;
}

.actions-primary .btn {
    width: 100%;
}

.actions-secondary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
    padding-left: 2rem;
    border-left: 1px solid var(--border-color);
}

.actions-secondary .btn {
    width: 100%;
    justify-content: flex-start;
    padding-left: 1.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header-main {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-grow: 1;
}

.section-search-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 400px;
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Profile Page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 2rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-img-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
    cursor: pointer;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface-hover);
    transition: border-color 0.2s;
}

.profile-img:hover {
    border-color: var(--primary-color);
}

.profile-img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-img-container:hover .profile-img-overlay {
    opacity: 1;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.instrument-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.instrument-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }


}



/* Event Card Redesign */
.event-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--surface-dark);
    /* Ensure card background */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.event-date-box {
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 65px;
    height: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-date-day {
    font-size: 1.8rem;
    font-weight: 800;
}

.event-date-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.event-details {
    flex: 1;
    min-width: 0;
    /* Prevent flex child overflow */
}

.event-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    min-width: 80px;
}

.creator-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface-hover);
}

.status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* Calendar Controls */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-group .btn {
    border-radius: 20px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    height: 34px;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.calendar-cell {
    background-color: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 100px;
    padding: 0.5rem;
    position: relative;
    transition: all 0.2s;
}

.calendar-cell.today {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.calendar-cell:hover {
    background-color: var(--surface-hover);
}

.day-number {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}

.calendar-event-dot {
    display: block;
    /* or flex */
    font-size: 0.75rem;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    color: white;
    background-color: var(--surface-hover);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event-dot.type-performance.is-public {
    background-color: #10b981;
    /* Green-500 */
    color: white;
}

.calendar-event-dot.type-performance.is-private {
    background-color: #3b82f6;
    /* Blue-500 */
    color: white;
}

/* Fallback for performance without explicit class */
.calendar-event-dot.type-performance {
    background-color: #3b82f6;
    /* Default Blue */
    color: white;
}

.calendar-event-dot.type-rehearsal {
    background-color: #4b5563;
    /* Gray-600 */
    color: #e5e7eb;
    /* Gray-200 */
    border: 1px solid var(--border-color);
}

.calendar-event-dot.type-class {
    background-color: #f59e0b;
    /* Amber-500 (Yellow) */
    color: #000;
    /* Dark text for better contrast on yellow */
    font-weight: bold;
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        /* Keep 7 cols but shrink */
        font-size: 0.8rem;
    }

    .calendar-cell {
        min-height: 60px;
        padding: 2px;
    }

    .calendar-event-dot {
        font-size: 0.6rem;
        height: 6px;
        width: 6px;
        padding: 0;
        border-radius: 50%;
        margin: 2px auto;
        text-indent: -9999px;
        /* Hide text on small screens if dense */
    }

    /* Alternatively, keep text but stack vertically */
    /* Alternatively, keep text but stack vertically */
}

/* Mobile Adjustments for Event Cards */
@media (max-width: 600px) {
    .event-card {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .event-date-box {
        min-width: 55px;
        height: 55px;
        padding: 0.25rem;
    }

    .event-date-day {
        font-size: 1.4rem;
    }

    .event-date-month {
        font-size: 0.65rem;
    }

    .event-title {
        font-size: 1rem;
    }

    .event-meta-row {
        flex-wrap: wrap;
        row-gap: 4px;
        font-size: 0.8rem;
    }

    .event-actions {
        min-width: 60px;
        gap: 0.25rem;
    }

    .creator-avatar {
        width: 24px;
        height: 24px;
    }

    .status-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

@media (max-width: 450px) {
    .event-card {
        flex-wrap: wrap;
    }

    .event-details {
        order: 2;
        width: calc(100% - 62.5px);
        /* 55px box + 0.75rem (12px) gap = 67px, let's use approx */
    }

    .event-actions {
        order: 3;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--border-color);
        padding-top: 0.5rem;
        margin-top: 0.25rem;
        min-width: 0;
    }

    .event-date-box {
        order: 1;
    }
}

/* Mobile Adjustments for Calendar Controls */
@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    /* Control containers (Left: filters, Right: actions) */
    .calendar-controls>div {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    /* Target the button groups (View Switcher and Time Filters) */
    .calendar-controls .btn-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100% !important;
        gap: 10px !important;
    }

    /* Select and Action Button container */
    .calendar-controls>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* Hide the divider div */
    .calendar-controls>div:first-child>div:not(.btn-group) {
        display: none !important;
    }

    .calendar-controls .btn,
    .calendar-controls .form-control {
        width: 100% !important;
        margin: 0 !important;
        justify-content: center !important;
        display: flex !important;
        align-items: center !important;
    }

    #add-event-btn {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
    }
}

.song-row-hover:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- Layout & Grids (Restored) --- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: var(--surface-dark);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.hire-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* --- Premium Band Cards (Unified) --- */
.band-card {
    background: var(--surface-dark);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.band-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.band-cover {
    height: 140px;
    background-color: #1a1a1a;
    background-position: center;
    background-size: cover;
    position: relative;
    border-bottom: 4px solid var(--primary-color);
}

.band-profile-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--surface-dark);
    position: absolute;
    bottom: -35px;
    left: 20px;
    object-fit: cover;
    background: var(--surface-hover);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.band-content {
    padding: 2.5rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.band-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.band-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.band-genre-tag {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.band-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.availability-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag.match {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border-color: #ffd700;
    font-weight: bold;
}

.tag.priority-alta {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

/* Confirmation modals and high-priority overlays */
.premium-modal {
    z-index: var(--z-modal-stack) !important;
}

#confirm-removal-modal {
    z-index: var(--z-modal-top) !important;
}

.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: var(--z-modal-primary);
    /* Sit on top - High Z-Index */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    backdrop-filter: blur(4px);
    /* Blur effect */
    align-items: center;
    /* Center flex */
    justify-content: center;
    /* Center flex */
}

/* Class to Force Show */
.modal.show {
    display: flex !important;
}

/* Unification handled above */

/* Form Styles for Modals */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: var(--surface-hover);
    color: var(--text-primary);
    font-family: inherit;
}

.modal-actions {
    text-align: right;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.share-social-link {
    flex: 1;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 5px;
    border: none !important;
    background: none !important;
    cursor: pointer;
    text-decoration: none;
}

.share-social-link:hover {
    transform: scale(1.2);
}

/* --- Premium Modal & Form Styles --- */
.premium-modal {
    background-color: #121212 !important;
    border: 1px solid #333;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(15px);
    border-radius: 12px !important;
    max-width: 700px !important;
    height: auto !important;
    max-height: 90vh !important;
}

.premium-modal .modal-header {
    background: #202836 !important;
    border-bottom: 1px solid #333;
    padding: 0.6rem 1rem !important;
    border-radius: 12px 12px 0 0 !important;
}



/* Custom Scrollbar for Form & Textarea */
.premium-form::-webkit-scrollbar,
.editor-textarea::-webkit-scrollbar {
    width: 8px;
}

.premium-form::-webkit-scrollbar-track,
.editor-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.premium-form::-webkit-scrollbar-thumb,
.editor-textarea::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 4px;
}

.premium-form::-webkit-scrollbar-thumb:hover,
.editor-textarea::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.premium-form {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem !important;
    background: #202836 !important;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    font-size: 0.75rem;
    color: #4b5563;
    border-bottom: 1px solid #222;
    padding-bottom: 3px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.form-row {
    display: flex;
    gap: 0.5rem !important;
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
    min-width: 150px;
}

.flex-2 {
    flex: 2;
    min-width: 200px;
}

.premium-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px !important;
}

.premium-form label i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.crm-stats-grid {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.premium-modal .modal-header h2 {
    color: #fff !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    letter-spacing: -0.01em;
}

.modal .close-btn {
    color: #999 !important;
    font-size: 1.5rem !important;
    transition: all 0.2s ease;
    outline: none !important;
}

.premium-form .form-control {
    width: 100%;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    color: #f8fafc !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease;
    outline: none !important;
}

.premium-form .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
    background: #1e293b !important;
}

.editor-textarea {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
    min-height: 500px !important;
    line-height: 1.5;
    tab-size: 4;
    resize: vertical;
    background: #202836 !important;
    color: #e0e0e0 !important;
    border: 1px solid #222 !important;
    padding: 0.75rem !important;
    font-size: 0.9rem !important;
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #202836;
    padding: 0.65rem;
    border-radius: 10px;
    border: 1px solid #222;
    max-height: 160px;
    overflow-y: auto;
}

/* --- Professional Category Chips --- */
.category-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e0e0e0;
    user-select: none;
    white-space: nowrap;
}

.category-chip:hover {
    background: #252525;
    border-color: #444;
}

.category-chip input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.category-chip.active {
    background: rgba(59, 130, 245, 0.15);
    border-color: var(--primary-color);
    color: #fff;
}

#song-notes {
    min-height: 120px !important;
}

.form-actions-bar {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.form-actions-bar .left-actions,
.form-actions-bar .right-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-danger {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
}

.delete-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.btn-warning {
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

/* --- Song Viewer Modal Header Redesign --- */
.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #121212 !important;
    border-radius: 16px 16px 0 0;
    padding-right: 45px;
    position: relative;
    box-sizing: border-box;
}

.modal-header .header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-header .header-info .title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header #modal-song-title {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
    font-weight: 700;
}

.modal-header #modal-visibility-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.modal-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Song Viewer Optimization */
#song-modal {
    z-index: var(--z-modal-primary) !important;
}

/* Header Action Button (Hiding as FABs are now unified) */
#modal-header-action-btn {
    display: none !important;
}

#song-modal .modal-header {
    position: relative;
    /* For absolute centering of the action button */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
}

@media (max-width: 768px) {

    #modal-metronome-play-btn,
    #modal-metronome-ctrls {
        display: none !important;
    }
}

#theater-mode-close-btn {
    display: none !important;
    position: absolute;
    top: 0;
    right: 0;
    z-index: calc(var(--z-modal-primary) + 10);
    width: 48px;
    height: 48px;
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: color 0.2s;
}

#theater-mode-close-btn:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .modal-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
        padding: 1rem !important;
        border-radius: 0;
    }

    .modal-header .header-info {
        width: 100%;
    }

    .modal-header #modal-song-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 40px);
        display: block;
        font-size: 1.1rem;
    }

    .modal-header #modal-visibility-badge {
        display: none !important;
    }

    .modal-header .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .modal-header .header-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px !important;
        font-size: 0.85rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
        display: flex !important;
        align-items: center;
        gap: 8px;
        margin: 0 !important;
        border-radius: 8px !important;
    }

    .modal-header .header-actions .btn:active {
        background: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
    }

    .modal-header .header-actions .btn i {
        font-size: 0.9rem;
        color: var(--primary-color);
    }

    .modal-header .close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        margin: 0 !important;
    }

    #song-modal .modal-content,
    #song-form-modal .modal-content {
        width: 100% !important;
        height: 100% !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    #song-form-modal .premium-form {
        padding: 1rem !important;
        gap: 1rem !important;
    }

    #song-form-modal .form-row {
        flex-direction: column !important;
        gap: 0.4rem !important;
    }

    #song-form-modal .flex-1,
    #song-form-modal .flex-2 {
        width: 100% !important;
    }

    #song-form-modal .editor-textarea {
        min-height: 350px !important;
    }

    #song-form-modal .form-actions-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    #song-form-modal .left-actions,
    #song-form-modal .right-actions {
        flex-direction: column !important;
        width: 100% !important;
    }

    #song-form-modal .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    #song-form-modal .section-title {
        font-size: 0.8rem !important;
        margin-top: 0.5rem !important;
    }

    #context-song-fields {
        padding-top: 0.75rem !important;
        margin-top: 0.75rem !important;
    }

    /* Theater Mode (Simplified View) */
    #song-modal.theater-mode .modal-header,
    #song-modal.theater-mode .toolbar,
    #song-modal.theater-mode .modal-footer {
        display: none !important;
    }

    #song-modal.theater-mode #theater-mode-close-btn {
        display: flex !important;
    }

    #song-modal.theater-mode #song-display-container {
        padding: 1rem !important;
    }

    #song-modal.theater-mode #modal-song-display {
        /* User-defined font-size is preserved via JS inline styles */
        -webkit-text-size-adjust: none;
    }
}

/* Floating Action Buttons - Hidden on desktop */
.viewer-toggle-btn,
.autoscroll-fab,
.metronome-fab,
.playback-fabs-left,
.add-to-lib-fab,
.report-fab {
    display: none !important;
}

/* Desktop styles for .viewer-toggle-btn removed (moved to hidden list) */

/* --- Song Viewer Toolbar Redesign --- */
.toolbar {
    scrollbar-width: none;
    /* Firefox */
}

.toolbar::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.tool-group {
    display: flex;
    align-items: center;
}

.tool-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.tool-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Vertical Control Stack (Mobile FABs) */
.vertical-ctrl-stack {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 4px;
    border-radius: 20px;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    align-items: center;
    gap: 4px;
    /* More compact */
    min-width: 44px;
    backdrop-filter: blur(10px);
}

.vertical-ctrl-stack .tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    padding: 0;
    transition: all 0.2s;
}

.vertical-ctrl-stack .tool-btn:active {
    background: var(--primary-color);
    transform: scale(0.9);
}

.vertical-ctrl-stack .ctrl-value {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    min-height: 18px;
    display: flex;
    align-items: center;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .toolbar {
        gap: 0.5rem !important;
    }

    .tool-group {
        padding-right: 0.5rem !important;
        gap: 4px !important;
    }

    .tool-btn {
        padding: 4px 6px;
        font-size: 0.6rem !important;
        min-width: 30px;
        min-height: 30px;
    }

    .speed-ctrls {
        display: none !important;
    }
}

@media (max-width: 768px) {

    .viewer-toggle-btn,
    .add-to-lib-fab,
    .report-fab {
        display: flex !important;
    }

    /* Playback FABs Container (Bottom Left) */
    .playback-fabs-left {
        position: absolute;
        bottom: 20px;
        left: 20px;
        display: none;
        gap: 10px;
        /* More separation */
        z-index: 1000;
        align-items: flex-end;
    }

    #song-modal.theater-mode .playback-fabs-left {
        display: flex !important;
    }

    .fab-with-controls {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .autoscroll-fab,
    .metronome-fab,
    .viewer-toggle-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(26, 26, 26, 0.9);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(8px);
        display: flex !important;
        /* Force visible on mobile */
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .viewer-toggle-btn {
        position: absolute;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }

    .viewer-toggle-btn:active {
        transform: scale(0.9);
    }

    .autoscroll-fab.active,
    .metronome-fab.active {
        background: var(--primary-color);
        box-shadow: 0 0 20px var(--primary-color);
        border-color: transparent;
    }

    /* Show vertical control stacks in mobile theater mode */
    #song-modal.theater-mode .vertical-ctrl-stack {
        display: flex;
    }
}

/* Floating Action Button for Toggle */
.viewer-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
    /* Only show on mobile */
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.viewer-toggle-btn:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {

    /* Floating Action Buttons - General Mobile Styles */
    .viewer-toggle-btn,
    .add-to-lib-fab,
    .report-fab {
        display: flex !important;
        position: absolute;
        bottom: 20px;
        width: 44px;
        /* Slightly larger for touch */
        height: 44px;
        border-radius: 50%;
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        z-index: 1050;
        /* Above playback FABs (1000) */
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        cursor: pointer;
        transition: transform 0.2s, background 0.3s;
        backdrop-filter: blur(10px);
    }

    /* Wrench (Rightmost) */
    .viewer-toggle-btn {
        right: 20px;
        background: rgba(59, 130, 246, 0.2) !important;
    }

    /* Action (+, -, trash) - Centered in the group */
    .add-to-lib-fab {
        right: 74px;
        background: rgba(255, 255, 255, 0.05);
        /* Managed by JS for colors */
    }

    /* Report Flag (Leftmost of the group) */
    .report-fab {
        right: 128px;
        background: rgba(239, 68, 68, 0.2) !important;
    }

    .add-to-lib-fab:active,
    .report-fab:active,
    .viewer-toggle-btn:active {
        transform: scale(0.9);
    }

    /* Hide footer action button on mobile (user prefers the FAB) */
    .modal-footer #modal-action-btn,
    .modal-footer #modal-report-btn {
        display: none !important;
    }
}

/* --- Visibility Toggle Redesign --- */
.visibility-toggle-group {
    display: flex;
    gap: 8px;
    background: #202836;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #222;
}

.visibility-option {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
    border: 1px solid transparent;
}

.visibility-option:hover {
    color: #999;
}

.visibility-option.active {
    background: #1a1a1a;
    color: var(--primary-color);
    border-color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.visibility-option i {
    font-size: 0.9rem;
}

/* --- Notes / Interaction Modal Redesign --- */
.notes-modal-content {
    background-color: #121212;
    padding: 0 !important;
    border-radius: 12px;
    overflow: hidden;
    max-width: 600px;
    height: 80vh;
    border: 1px solid #333;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.notes-header {
    background-color: #1a1a1a;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-header h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary-color);
}

.notes-header p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notes-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #121212 !important;
}

.notes-form-container {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #222;
    background: #0a0a0a !important;
}

#interaction-content {
    width: 100%;
    min-height: 80px;
    margin-bottom: 0.5rem;
    background: #050505 !important;
    border: 1px solid #222 !important;
    border-radius: 8px;
    padding: 10px;
    color: #e0e0e0 !important;
    resize: none;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

.post-card {
    background: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

.notes-wall {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

@media (max-width: 768px) {
    .notes-modal-content {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0;
    }
}

.u-hidden {
    display: none !important;
}

/* Media Player Styles */
.media-player-container {
    margin: 0 auto 2rem auto;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: block;
}

.media-player-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
}

.media-player-container iframe[src*='spotify'] {
    aspect-ratio: auto !important;
    height: 152px !important;
}

@media (min-width: 769px) {
    .media-player-container {
        width: 100%;
        max-width: 1200px;
    }
}

@media (max-width: 768px) {

    /* Ajusta el margen del contenedor de navegación */
    #teacher-nav-container {
        margin-bottom: 0.5rem !important;
    }

    /* Hace que la tarjeta de Solicitudes ocupe todo el ancho */
    .teacher-grid .card:first-child {
        margin-left: 0;
        margin-right: -1rem;
        width: calc(100% + 1.5rem);


    }

    /* Agrupamos todos los IDs que queremos que tengan dos columnas */
    #setlist-actions,
    #groups-actions,
    #classes-actions,
    .group-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    /* Hace que las tarjetas en el dashboard se estiren (como en Solicitudes) */
    /* Target only the sidebar cards (second column in desktop, stacked in mobile) */
    .dashboard-grid>div:last-child .card {
        margin-left: 0;
        margin-right: -1rem;
        width: calc(100% + 1.5rem);
    }

    /* Márgenes en cabeceras de grupo para móviles */
    #group-nav-container,
    .group-header {
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
    }

    /* CRM Stats Grid Mobile */
    .crm-stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* 'Total Cobrado' occupies full width on mobile */
    .crm-stats-grid .card-total-cobrado {
        grid-column: span 2;
    }

    /* Si hay un número impar de botones, el último ocupa todo el ancho */
    .group-nav a:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    /* Y aseguramos que los botones dentro ocupen todo su espacio */
    #setlist-actions .btn,
    #groups-actions .btn,
    #classes-actions .btn,
    .group-nav .btn {
        width: 100%;
        margin: 0 !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
    }
}

.btn-teacher {
    background-color: var(--success-color);
    color: white !important;
}

.btn-teacher:hover {
    background-color: #059669;
}

/* CRM Grid & Cards */
.crm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.crm-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    backdrop-filter: blur(10px);
}

.crm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.crm-card-subject {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.crm-card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.crm-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.crm-card-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.crm-card-info-item i {
    width: 14px;
    color: var(--primary-color);
}

.crm-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.crm-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tablet: 2 columns */
@media (max-width: 1100px) {
    .crm-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .crm-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
/* Notifications / Toasts */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--surface-dark);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 450px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast.active {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--error-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--primary-color); }

.toast-content {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-close {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toastSlideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); }
    to { transform: translateX(120%); }
}
