/*
 * RagaFlow Design System - Enhanced Minimalist Theme
 * File: static/css/themes/minimalist.css
 *
 * Complete minimalist theme with enhanced table system
 * Version: 2.0 - Enhanced Tables & Responsive Design
 */

:root {
    /* ============================
       MINIMALIST COLOR PALETTE
       ============================ */
    
    /* Primary Brand Colors - Muted and Clean */
    --brand-primary: #2c3e50;           /* Dark Blue Gray */
    --brand-primary-dark: #1a252f;     /* Darker Blue Gray */
    --brand-primary-light: #34495e;    /* Light Blue Gray */
    --brand-secondary: #3498db;        /* Clean Blue */
    --brand-secondary-dark: #2980b9;   /* Dark Blue */
    --brand-accent: #e74c3c;           /* Subtle Red */
    --brand-accent-muted: #c0392b;     /* Muted Red */
    
    /* Neutral Colors */
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;
    
    /* ============================
       BACKGROUND COLORS - Clean & Minimal
       ============================ */
    --bg-primary: #ffffff;             /* Pure White */
    --bg-secondary: #f8f9fa;           /* Very Light Gray */
    --bg-tertiary: #e9ecef;            /* Light Gray */
    --bg-accent: #f1f3f4;              /* Subtle Gray */
    --bg-surface: var(--bg-primary);
    --bg-overlay: rgba(248, 249, 250, 0.95);
    
    /* ============================
       TEXT COLORS - High Contrast
       ============================ */
    --text-primary: #2c3e50;           /* Dark Blue Gray */
    --text-secondary: #5a6c7d;         /* Medium Gray */
    --text-muted: #7f8c8d;             /* Light Gray */
    --text-light: #95a5a6;             /* Very Light Gray */
    --text-on-dark: #ffffff;           /* White */
    --text-on-color: #ffffff;          /* White */
    --text-brand: var(--brand-primary);
    
    /* ============================
       BORDER COLORS - Subtle
       ============================ */
    --border-primary: #dee2e6;         /* Light Border */
    --border-secondary: #e9ecef;       /* Very Light Border */
    --border-accent: var(--brand-secondary);
    --border-focus: var(--brand-secondary);
    
    /* ============================
       TYPOGRAPHY SYSTEM - Consistent Font
       ============================ */
    
    /* Use Inter font everywhere for consistency */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-devanagari: 'Inter', 'Noto Sans Devanagari', sans-serif;
    --font-monospace: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Font Sizes - Refined Scale */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 0.9375rem; /* 15px */
    --font-size-lg: 1rem;       /* 16px */
    --font-size-xl: 1.125rem;   /* 18px */
    --font-size-2xl: 1.25rem;   /* 20px */
    --font-size-3xl: 1.5rem;    /* 24px */
    --font-size-4xl: 2rem;      /* 32px */
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    
    /* Letter Spacing - Minimal */
    --letter-spacing-tight: -0.01em;
    --letter-spacing-normal: 0em;
    --letter-spacing-wide: 0.01em;
    
    /* ============================
       LAYOUT & SPACING - Clean Grid
       ============================ */
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    
    /* Component Dimensions */
    --header-height: 64px;
    --container-max-width: 1200px;
    --content-max-width: 1000px;
    
    /* Border Radius - Minimal */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-base: 0.375rem; /* 6px */
    --radius-lg: 0.5rem;    /* 8px */
    --radius-xl: 0.75rem;   /* 12px */
    --radius-full: 9999px;
    
    /* ============================
       SHADOWS - Subtle & Clean
       ============================ */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* ============================
       TRANSITIONS - Smooth & Fast
       ============================ */
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    
    --duration-fast: 150ms;
    --duration-base: 200ms;
    --duration-slow: 300ms;
    
    --transition-fast: all var(--duration-fast) var(--ease-out);
    --transition-base: all var(--duration-base) var(--ease-in-out);
    --transition-colors: color var(--duration-base) var(--ease-in-out), 
                        background-color var(--duration-base) var(--ease-in-out), 
                        border-color var(--duration-base) var(--ease-in-out);
}

/* ============================
   BASE STYLES - Clean & Minimal
   ============================ */

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    margin: 0;
    padding-top: var(--header-height);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content area should grow to fill available space */
main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Footer should stick to bottom */
.site-footer {
    flex-shrink: 0;
}

/* Typography - Consistent Font Usage */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

p, span, div, a, button, input, textarea, select, label,
.form-control, .btn, .badge, .card, .table {
    font-family: var(--font-primary) !important;
}

/* ============================
   HEADER - Clean & Minimal
   ============================ */

.fixed-header {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    transition: var(--transition-base);
}

.fixed-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: var(--brand-secondary);
    box-shadow: var(--shadow-md);
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    max-width: var(--container-max-width);
    margin: 0 auto;
    gap: var(--space-6);
}

.header-brand {
    flex-shrink: 0;
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-bold);
    font-size: 22px;
    color: var(--text-brand);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: var(--transition-colors);
}

.header-brand:hover {
    color: var(--brand-secondary);
    text-decoration: none;
}

.flute-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-base);
    object-fit: cover;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* ============================
   SEARCH - Clean Input Design
   ============================ */

.header-search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

/* Search Mode Toggle - Now positioned where raga chips were */
.search-mode-toggle {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: var(--space-1);
    border: 1px solid var(--border-primary);
    height: fit-content;
    align-self: center;
}

.search-mode-btn {
    padding: var(--space-2) var(--space-4);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-colors);
    white-space: nowrap;
    min-height: 36px;
}

.search-mode-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.search-mode-btn.active {
    background: var(--brand-secondary);
    color: var(--text-on-color);
    box-shadow: var(--shadow-xs);
}

.search-mode-btn:focus {
    outline: 2px solid var(--brand-secondary);
    outline-offset: 2px;
}

.header-search-input {
    width: 100%;
    height: 44px;
    padding: 0 48px 0 var(--space-4);
    border: 1px solid var(--border-primary);
    border-radius: 24px;
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-colors);
    outline: none;
}

.header-search-input:focus {
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.header-search-input::placeholder {
    color: var(--text-muted);
    font-weight: var(--font-weight-regular);
}

.header-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--brand-secondary);
    cursor: pointer;
    transition: var(--transition-colors);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.header-search-btn:hover:not(:disabled) {
    color: var(--brand-secondary-dark);
    background: transparent;
}

.header-search-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================
   SUGGESTIONS - Clean Dropdown
   ============================ */

.raga-suggestions {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 10000;
}

.raga-suggestions .list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-secondary);
    padding: var(--space-4) var(--space-5);
    background: transparent;
    color: var(--text-primary);
    transition: var(--transition-colors);
    cursor: pointer;
    font-family: var(--font-primary) !important;
}

.raga-suggestions .list-group-item:hover,
.raga-suggestions .list-group-item.active {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.raga-suggestions .list-group-item:last-child {
    border-bottom: none;
}

/* ============================
   QUICK ACCESS CHIPS - Minimal
   ============================ */

.header-quick-ragas {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.raga-chip-small {
    display: inline-flex;
    align-items: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    transition: var(--transition-colors);
    border: 1px solid var(--border-primary);
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    box-shadow: var(--shadow-xs);
}

.raga-chip-small:hover {
    background: var(--brand-secondary);
    color: var(--text-on-color);
    border-color: var(--brand-secondary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================
   MAIN CONTAINER - Clean Layout
   ============================ */

.main-container {
    background: var(--bg-primary);
    margin: var(--space-4) auto;
    padding: var(--space-6) var(--space-8);
    max-width: var(--container-max-width);
    min-height: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Welcome message vertical centering */
#welcomeMessage {
    display: flex;
    align-items: center;
    flex: 1;
    padding: var(--space-8) 0;
}

/* ============================
   FOOTER - Clean & Minimal
   ============================ */

.site-footer {
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-4) 0;
    margin-top: var(--space-4);
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.footer-link {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-colors);
}

.footer-link:hover {
    color: var(--brand-secondary);
    text-decoration: none;
}

.footer-copyright {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ============================
   ENHANCED TABLE SYSTEM - CORE
   ============================ */

.elegant-table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-6);
    width: 100%;
}

.elegant-table {
    margin: 0;
    font-family: var(--font-primary) !important;
    table-layout: auto !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
}

/* Prevent horizontal scroll on .table-responsive globally */
.table-responsive {
    overflow-x: hidden;
    max-width: 100%;
}

/* ============================
   SMART COLUMN SIZING SYSTEM
   ============================ */

/* HOMEPAGE TABLE (Songs List) - 6 columns */
.elegant-table.songs-table col:nth-child(1) { width: 30%; min-width: 200px; } /* Title */
.elegant-table.songs-table col:nth-child(2) { width: 20%; min-width: 120px; } /* Composer */
.elegant-table.songs-table col:nth-child(3) { width: 12%; min-width: 80px; }  /* Type */
.elegant-table.songs-table col:nth-child(4) { width: 15%; min-width: 90px; }  /* Views */
.elegant-table.songs-table col:nth-child(5) { width: 13%; min-width: 80px; }  /* Performances */
.elegant-table.songs-table col:nth-child(6) { width: 10%; min-width: 80px; }  /* Actions */

/* SONG DETAILS TABLE (Performances) - 5 columns */
.elegant-table.performances-table col:nth-child(1) { width: 12%; min-width: 100px; } /* Thumbnail */
.elegant-table.performances-table col:nth-child(2) { width: 35%; min-width: 150px; } /* Artist */
.elegant-table.performances-table col:nth-child(3) { width: 18%; min-width: 100px; } /* Type */
.elegant-table.performances-table col:nth-child(4) { width: 20%; min-width: 100px; } /* Views */
.elegant-table.performances-table col:nth-child(5) { width: 15%; min-width: 100px; } /* Duration */

/* NO SCROLL */
.elegant-table.no-scroll {
    table-layout: fixed !important;
    width: 100% !important;
}

.elegant-table.no-scroll col:nth-child(1) { width: 22%; min-width: unset; } /* Title - reduced slightly */
.elegant-table.no-scroll col:nth-child(2) { width: 18%; min-width: unset; } /* Composer */
.elegant-table.no-scroll col:nth-child(3) { width: 12%; min-width: unset; } /* Type */
.elegant-table.no-scroll col:nth-child(4) { width: 18%; min-width: unset; } /* Views */
.elegant-table.no-scroll col:nth-child(5) { width: 18%; min-width: unset; } /* Performances - increased from 14% */
.elegant-table.no-scroll col:nth-child(6) { width: 12%; min-width: unset; } /* Exemplar */

.elegant-table.no-scroll td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* INDEX TABLE (ragas/composers index) — 3 columns: Name (+ songs subtext), Performances, Views */
.index-table-container {
    max-width: 800px;
}

.elegant-table.index-table {
    table-layout: fixed !important;
    width: 100% !important;
}

.elegant-table.index-table col:nth-child(1) { width: 50%; } /* Name */
.elegant-table.index-table col:nth-child(2) { width: 22%; } /* Performances */
.elegant-table.index-table col:nth-child(3) { width: 28%; } /* Views */

.elegant-table.index-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.index-subtext {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: normal;
}

/* ============================
   ENHANCED HEADER STYLING
   ============================ */

.elegant-table-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--border-primary);
}

.elegant-table-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.elegant-table-title h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.elegant-table-badge {
    background: var(--brand-secondary);
    color: var(--text-on-color);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-wide);
}

.elegant-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-bottom: 2px solid var(--border-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    padding: var(--space-4) var(--space-3);
    position: sticky;
    top: 0;
    z-index: 20;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column-specific header alignment */
.elegant-table thead th:nth-child(1),
.elegant-table thead th:nth-child(2) {
    text-align: left;
    padding-left: var(--space-4);
}

.elegant-table thead th:nth-child(3),
.elegant-table thead th:nth-child(4),
.elegant-table thead th:nth-child(5),
.elegant-table thead th:last-child {
    text-align: center;
}

/* Sortable column indicators */
.elegant-table thead th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: var(--transition-colors);
}

.elegant-table thead th[data-sort]:hover {
    background: var(--bg-accent);
    color: var(--brand-secondary);
}

.elegant-table thead th[data-sort] i {
    margin-left: var(--space-1);
    opacity: 0.6;
    transition: var(--transition-colors);
}

.elegant-table thead th[data-sort]:hover i {
    opacity: 1;
    color: var(--brand-secondary);
}

/* ============================
   ENHANCED BODY STYLING
   ============================ */

.elegant-table tbody td {
    padding: var(--space-4) var(--space-3);
    border-color: var(--border-secondary);
    vertical-align: middle;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Column-specific body alignment */
.elegant-table tbody td:nth-child(1),
.elegant-table tbody td:nth-child(2) {
    text-align: left;
    padding-left: var(--space-4);
}

.elegant-table tbody td:nth-child(3),
.elegant-table tbody td:nth-child(4),
.elegant-table tbody td:nth-child(5),
.elegant-table tbody td:last-child {
    text-align: center;
}

/* Row hover — lift + blue left border */
.elegant-table tbody tr {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.elegant-table tbody tr:hover {
    background: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

/* Desktop: border on td:first-child (border on tr doesn't render in table layout) */
.elegant-table tbody td:first-child {
    border-left: 3px solid transparent;
    transition: border-color 0.15s ease;
}

.elegant-table tbody tr:hover td:first-child {
    border-left-color: var(--brand-secondary);
}

/* ============================
   TEXT TRUNCATION & CONTENT HANDLING
   ============================ */

.elegant-table .text-truncate-smart {
    max-width: min(250px, 40vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.elegant-table .text-truncate-smart:hover {
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 2px;
}

.elegant-table .badge {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.elegant-table .number-large {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ============================
   ENHANCED FILTER INTEGRATION
   ============================ */

.compact-filters {
    background: var(--bg-secondary);
    padding: var(--space-5) var(--space-8);
    border-bottom: 1px solid var(--border-primary);
}

.compact-filters .row {
    align-items: end;
    gap: var(--space-4);
    max-width: none;
    margin: 0;
}

.compact-filters .col-md-3,
.compact-filters .col-md-2,
.compact-filters [class*="col-"] {
    padding: 0 var(--space-2);
    min-width: 0;
}

.compact-filters .form-control {
    height: 40px;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-base);
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    transition: var(--transition-colors);
    font-family: var(--font-primary) !important;
}

.compact-filters .form-control:focus {
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.compact-filters .form-control::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.compact-filters .form-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    display: block;
}

.clear-filters-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-muted);
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: var(--transition-colors);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
}

.clear-filters-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
}

.clear-filters-btn:active {
    background: var(--bg-accent);
}

/* ============================
   THUMBNAIL ENHANCEMENTS
   ============================ */

.performance-thumbnail-large {
    width: 80px !important;
    height: 60px !important;
    object-fit: cover;
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: var(--transition-fast);
    display: block;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-xs);
    margin: 0 auto;
}

.performance-thumbnail-large:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-secondary);
    z-index: 5;
    position: relative;
}

.elegant-table .thumbnail-cell {
    padding: var(--space-2) !important;
    text-align: center;
    vertical-align: middle;
}

/* ============================
   BUTTONS - Minimal Design
   ============================ */

.btn {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-medium);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-base);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-colors);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.btn-primary {
    background: var(--brand-secondary);
    color: var(--text-on-color);
    border-color: var(--brand-secondary);
}

.btn-primary:hover {
    background: var(--brand-secondary-dark);
    border-color: var(--brand-secondary-dark);
    color: var(--text-on-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
    background: transparent;
    color: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

.btn-outline-primary:hover {
    background: var(--brand-secondary);
    color: var(--text-on-color);
    transform: translateY(-1px);
}

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

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

/* ============================
   FORMS - Clean Inputs
   ============================ */

.form-control {
    font-family: var(--font-primary) !important;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-base);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: var(--transition-colors);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05);
    background: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

/* ============================
   BADGES - Minimal Style
   ============================ */

.badge {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-medium);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    display: inline-block;
}

.badge.bg-primary {
    background: var(--brand-primary) !important;
    color: var(--text-on-color) !important;
}

.badge.bg-secondary {
    background: var(--text-muted) !important;
    color: var(--text-on-color) !important;
}

.badge.bg-warning {
    background: var(--color-warning) !important;
    color: var(--text-primary) !important;
}

.badge.bg-success {
    background: var(--color-success) !important;
    color: var(--text-on-color) !important;
}

/* ============================
   YOUTUBE BUTTON - Clean
   ============================ */

.youtube-btn {
    background: #ff0000;
    color: white;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-base);
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: var(--transition-colors);
    box-shadow: var(--shadow-xs);
    white-space: nowrap;
}

.youtube-btn:hover {
    background: #cc0000;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================
   CARDS - Minimal Design
   ============================ */

.card {
    font-family: var(--font-primary) !important;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--bg-primary);
    transition: var(--transition-colors);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-secondary);
}

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-5);
    color: var(--text-primary);
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-semibold);
}

.card-body {
    padding: var(--space-6);
    font-family: var(--font-primary) !important;
}

/* ============================
   ELEGANT LYRICS SECTION
   ============================ */

.lyrics-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.lyrics-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--border-primary);
}

.lyrics-header h4 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.lyrics-content {
    padding: var(--space-8);
}

.lyrics-content .nav-pills {
    margin-bottom: var(--space-6);
    gap: var(--space-2);
    border: none;
}

.lyrics-content .nav-pills .nav-link {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-colors);
    margin-right: var(--space-2);
}

.lyrics-content .nav-pills .nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--brand-secondary);
    text-decoration: none;
}

.lyrics-content .nav-pills .nav-link.active {
    background: var(--brand-secondary);
    color: var(--text-on-color);
    border-color: var(--brand-secondary);
}

.lyrics-section {
    margin-bottom: var(--space-6);
}

.lyrics-section:last-child {
    margin-bottom: 0;
}

.lyrics-section h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--brand-secondary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--bg-tertiary);
    text-transform: capitalize;
}

.lyrics-text {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-accent) 100%);
    padding: var(--space-6);
    border-radius: var(--radius-base);
    border-left: 4px solid var(--brand-secondary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--text-primary);
    white-space: pre-line;
    word-wrap: break-word;
}

/* ============================
   COMPACT SUMMARY STATISTICS
   ============================ */

.summary-stats-container {
    margin-bottom: var(--space-6);
    margin-top: var(--space-4);
}

.summary-stats-container .row {
    gap: var(--space-3);
    justify-content: center;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-base);
    padding: var(--space-4);
    text-align: center;
    transition: var(--transition-colors);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    max-width: 200px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-secondary);
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--brand-secondary);
}

.stat-card .stat-icon {
    width: 20px;
    height: 20px;
    color: var(--brand-secondary);
    margin-bottom: var(--space-2);
    opacity: 0.7;
}

.stat-card .stat-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: var(--space-1) 0;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    margin: 0;
}

/* ============================
   LOADING STATE IMPROVEMENTS
   ============================ */

.loading-spinner {
    display: none;
    text-align: center;
    padding: var(--space-16);
    contain: layout style paint;
    min-height: 200px;
}

.table-loading {
    padding: var(--space-12) var(--space-8);
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-base);
    margin: var(--space-4);
}

.table-loading .spinner-border {
    color: var(--brand-secondary);
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

.spinner-border {
    color: var(--brand-secondary);
}

/* ============================
   ERROR STATES
   ============================ */

.error-message {
    border-radius: var(--radius-base);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.1);
    color: var(--color-danger);
    font-weight: var(--font-weight-medium);
}

.success-message {
    border-radius: var(--radius-base);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(39, 174, 96, 0.3);
    background: rgba(39, 174, 96, 0.1);
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}

/* ============================
   RESPONSIVE DESIGN IMPROVEMENTS
   ============================ */

/* Tablet breakpoint */
@media (max-width: 992px) {
    .header-content {
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
    }

    .header-brand {
        font-size: var(--font-size-lg);
    }

    .header-search-container {
        max-width: none;
    }

    .main-container {
        margin: var(--space-4);
        padding: var(--space-6);
    }

    .elegant-table.songs-table col:nth-child(1) { width: 35%; min-width: 150px; }
    .elegant-table.songs-table col:nth-child(2) { width: 25%; min-width: 100px; }
    .elegant-table.songs-table col:nth-child(3) { width: 15%; min-width: 70px; }
    .elegant-table.songs-table col:nth-child(4) { width: 15%; min-width: 80px; }
    .elegant-table.songs-table col:nth-child(5) { width: 10%; min-width: 60px; }

    .elegant-table thead th,
    .elegant-table tbody td {
        padding: var(--space-3) var(--space-2);
        font-size: var(--font-size-sm);  /* Improved readability on tablets */
    }

    .compact-filters {
        padding: var(--space-4) var(--space-5);
    }

    .compact-filters .row {
        gap: var(--space-3);
    }
}

/* Mobile breakpoint - Two-line layout */
@media (max-width: 768px) {
    :root {
        --header-height: 130px;
    }

    .fixed-header {
        height: var(--header-height);
        overflow: visible;
    }

    .header-content {
        flex-wrap: wrap !important;
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
        align-items: center !important;
        height: 100% !important;
    }

    /* First line: Logo + Toggle - vertically aligned */
    .header-brand {
        order: 1 !important;
        font-size: 20px !important;
        flex: 1 1 auto !important;
        min-width: 0;
        display: flex !important;
        align-items: center !important;
        gap: var(--space-2);
    }

    .flute-icon {
        width: 32px;
        height: 32px;
    }

    .search-mode-toggle {
        order: 2 !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .search-mode-btn {
        min-height: 36px;
        height: 36px;
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-sm);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Second line: Search box (full width) */
    .header-search-container {
        order: 3 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
        flex: 0 0 100% !important;
        min-width: 0;
    }

    .header-search-input {
        height: 44px;
        font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
        padding-right: 52px;
        box-sizing: border-box;
        border-radius: 24px;
    }

    /* Search button - properly contained */
    .header-search-btn {
        width: 32px;
        height: 32px;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
    }

    .raga-suggestions {
        max-height: calc(100vh - var(--header-height) - 20px);
        overflow-y: auto;
    }

    .container-fluid {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }

    .main-container {
        margin: 0;
        padding: 0;
    }

    /* Balance vertical spacing on mobile */
    #welcomeMessage {
        padding: var(--space-3) 0;
    }

    .elegant-table-header {
        padding: var(--space-4);
    }

    .elegant-table {
        min-width: auto;
        max-width: 100%;
    }

    /* ==========================================
       SONGS TABLE — card layout on mobile
       Card: Title on line 1, Composer/Raga (subtext) + Renderings badge on line 2
       Header: only SONG TITLE + RENDERINGS (Composer is subtext, no header)
       ========================================== */
    .songs-table { table-layout: auto !important; }
    .songs-table colgroup { display: none; }

    /* Compact header — just Song Title + Renderings */
    .songs-table thead tr {
        display: flex;
        justify-content: space-between;
        border-left: none;
        padding: 0 var(--space-3);
    }
    .songs-table thead th {
        background: none;
        border: none;
        padding: var(--space-2) 0;
        font-size: var(--font-size-xs);
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        position: static;
    }
    .songs-table thead th i,
    .songs-table thead th .sr-only { display: none; }
    .songs-table thead th:nth-child(1) { flex: 0 0 auto; }
    /* Hide Composer/Raga header — it's subtext in the card */
    .songs-table thead th:nth-child(2) { display: none !important; }
    .songs-table thead th:nth-child(5) { flex: 0 0 auto; }

    .songs-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        padding: var(--space-3);
        border-bottom: 1px solid var(--border-secondary);
        border-left: 3px solid transparent;
        align-items: baseline;
    }

    .songs-table tbody td {
        display: block;
        border: none;
        padding: 0;
    }
    /* Override desktop td:first-child border — mobile uses tr border instead */
    .elegant-table tbody td:first-child {
        border-left: none;
    }

    /* Title — row 1, left */
    .songs-table tbody td:nth-child(1) {
        grid-row: 1;
        grid-column: 1;
        font-size: var(--font-size-base);
    }
    .songs-table tbody td:nth-child(1) .text-truncate-smart {
        white-space: normal;
        max-width: none;
        overflow: visible;
    }

    /* Renderings badge — row 1, right (inline with title) */
    .songs-table tbody td:nth-child(5) {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
        align-self: center;
    }

    /* Composer/Raga — row 2, subtext */
    .songs-table tbody td:nth-child(2) {
        grid-row: 2;
        grid-column: 1 / -1;
        font-size: var(--font-size-sm);
        color: var(--text-secondary);
    }
    .songs-table tbody td:nth-child(2) .text-truncate-smart {
        white-space: normal;
        max-width: none;
        overflow: visible;
    }

    /* Hidden columns (already d-none, reinforce for card layout) */
    .songs-table tbody td:nth-child(3),
    .songs-table tbody td:nth-child(4),
    .songs-table tbody td:nth-child(6) {
        display: none !important;
    }

    /* Override no-scroll truncation for card layout */
    .elegant-table.no-scroll td {
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }

    /* ==========================================
       PERFORMANCES TABLE — card layout on mobile
       Card: [thumb] Artist + duration subtext, Views right-aligned
       Header: only ARTIST + VIEWS (duration is subtext under artist)
       ========================================== */
    .performances-table { table-layout: auto !important; }
    .performances-table colgroup { display: none; }

    /* Compact header — grid matches body so columns align */
    .performances-table thead tr {
        display: grid;
        grid-template-columns: calc(50px + var(--space-2) * 2) 1fr auto;
        column-gap: var(--space-2);
        padding: 0 var(--space-3);
        border-left: none;
    }
    .performances-table thead th {
        background: none;
        border: none;
        padding: var(--space-2) 0;
        font-size: var(--font-size-xs);
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        position: static;
    }
    .performances-table thead th i,
    .performances-table thead th .sr-only { display: none; }
    /* Thumbnail spacer — invisible but holds grid column width */
    .performances-table thead th:nth-child(1) {
        visibility: hidden;
        padding: 0;
        line-height: 0;
    }
    /* Artist header — padding matches body td for text alignment */
    .performances-table thead th:nth-child(2) {
        padding-left: var(--space-4);
    }
    /* Views header */
    .performances-table thead th:nth-child(3) {
        text-align: right;
    }
    /* Hide Duration header — it's subtext under artist */
    .performances-table thead th:nth-child(4) { display: none !important; }

    .performances-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        column-gap: var(--space-2);
        padding: var(--space-3) var(--space-3);
        border-bottom: 1px solid var(--border-secondary);
        border-left: 3px solid transparent;
    }

    .performances-table tbody td {
        display: block;
        border: none;
        padding: 0;
        font-size: var(--font-size-sm);
    }

    /* Thumbnail — spans both rows */
    .performances-table tbody td:nth-child(1) {
        grid-row: 1 / 3;
        grid-column: 1;
        align-self: center;
    }

    /* Artist name — row 1 */
    .performances-table tbody td:nth-child(2) {
        grid-row: 1;
        grid-column: 2;
        min-width: 0;
        align-self: baseline;
    }
    .performances-table tbody td:nth-child(2) .text-truncate-smart {
        white-space: normal;
        max-width: none;
        overflow: visible;
    }

    /* Views — row 1, right, inline with artist */
    .performances-table tbody td:nth-child(3) {
        grid-row: 1;
        grid-column: 3;
        align-self: baseline;
        white-space: nowrap;
    }

    /* Duration — row 2, subtext under artist name */
    .performances-table tbody td:nth-child(4) {
        grid-row: 2;
        grid-column: 2;
        justify-self: stretch;
        text-align: left;
        padding: 0;
        padding-left: var(--space-4);
        font-size: var(--font-size-sm);
        color: var(--text-secondary);
    }
    .performances-table tbody td:nth-child(4) .number-large {
        font-weight: normal;
    }
    .performances-table tbody td:nth-child(4) .number-large::after {
        content: " min";
    }

    .performance-thumbnail-large {
        width: 50px !important;
        height: 38px !important;
    }

    /* Mobile performance filters — single compact row */
    .perf-filters-mobile .form-control {
        height: 36px;
        font-size: var(--font-size-sm);
        padding: var(--space-1) var(--space-2);
    }
    .perf-filters-mobile .perf-artist-filter {
        flex: 1 1 0;
        min-width: 0;
    }
    .perf-filters-mobile .perf-duration-input {
        flex: 0 0 60px;
        width: 60px;
    }

    .compact-filters {
        padding: var(--space-3) var(--space-2);
    }

    .compact-filters .row {
        flex-wrap: wrap;
        gap: 0;
        row-gap: var(--space-2);
    }

    .compact-filters .form-control {
        height: 40px;
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-size-sm);
    }

    .compact-filters .form-label {
        font-size: var(--font-size-xs);
        margin-bottom: 2px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--text-muted);
    }

    .clear-filters-btn {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-sm);
    }

    .stat-card {
        padding: var(--space-3);
    }

    .stat-card .stat-value {
        font-size: var(--font-size-lg);  /* Increased from base for emphasis */
    }

    .stat-card .stat-label {
        font-size: var(--font-size-sm);  /* Ensure readability */
    }

    /* ==========================================
       INDEX TABLE (ragas/composers) — card layout on mobile
       3 columns: Name (+ songs subtext), Performances, Views (hidden)
       ========================================== */
    .index-table { table-layout: auto !important; }
    .index-table colgroup { display: none; }

    /* Compact header — just Name + Performances */
    .index-table thead tr {
        display: flex;
        justify-content: space-between;
        border-left: none;
        padding: 0 var(--space-3);
    }
    .index-table thead th {
        background: none;
        border: none;
        padding: var(--space-2) 0;
        font-size: var(--font-size-xs);
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        position: static;
    }
    .index-table thead th i { display: none; }

    .index-table tbody tr {
        display: flex;
        align-items: center;
        padding: var(--space-3);
        border-bottom: 1px solid var(--border-secondary);
        border-left: 3px solid transparent;
    }

    .index-table tbody td {
        display: block;
        border: none;
        padding: 0;
    }

    /* Name + subtext — left, fills space */
    .index-table tbody td:nth-child(1) {
        flex: 1;
        min-width: 0;
    }

    /* Performances — right */
    .index-table tbody td:nth-child(2) {
        flex-shrink: 0;
        font-weight: 600;
    }

    /* Override index-table truncation for card layout */
    .elegant-table.index-table td {
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }

    /* Mobile hover: blue border on tr (grid mode supports tr borders) */
    .elegant-table tbody tr:hover {
        border-left-color: var(--brand-secondary);
    }

    /* Song detail page: prevent long titles from overflowing */
    .display-5 {
        font-size: 1.5rem;
        word-break: break-word;
    }

    .lyrics-header {
        padding: var(--space-4) var(--space-5);
    }
    
    .lyrics-content {
        padding: var(--space-5);
    }
    
    .lyrics-content .nav-pills {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .lyrics-content .nav-pills .nav-link {
        margin-right: 0;
        margin-bottom: var(--space-2);
        font-size: var(--font-size-sm);  /* Increased from xs for readability */
        padding: var(--space-2) var(--space-4);  /* Larger touch targets */
        min-height: 40px;  /* Ensure minimum touch target size */
        display: flex;
        align-items: center;
    }

    .lyrics-text {
        padding: var(--space-4);
        font-size: var(--font-size-sm);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }

    .footer-links {
        gap: var(--space-4);
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .header-brand {
        font-size: var(--font-size-sm);
    }

    .flute-icon {
        width: 24px;
        height: 24px;
    }

    .search-mode-btn {
        font-size: var(--font-size-xs);
        padding: var(--space-1) var(--space-3);
    }
}

/* Ultra-wide screens optimization */
@media (min-width: 1400px) {
    .elegant-table.songs-table col:nth-child(1) { width: 25%; min-width: 250px; }
    .elegant-table.songs-table col:nth-child(2) { width: 20%; min-width: 150px; }
    .elegant-table.songs-table col:nth-child(3) { width: 15%; min-width: 100px; }
    .elegant-table.songs-table col:nth-child(4) { width: 20%; min-width: 120px; }
    .elegant-table.songs-table col:nth-child(5) { width: 12%; min-width: 90px; }
    .elegant-table.songs-table col:nth-child(6) { width: 8%; min-width: 80px; }
}

/* ============================
   ACCESSIBILITY & PERFORMANCE
   ============================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .elegant-table thead th {
        background: var(--text-primary);
        color: var(--bg-primary);
        border-bottom-width: 3px;
    }
    
    .elegant-table tbody tr:hover {
        background: var(--text-primary);
        color: var(--bg-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .elegant-table tbody tr,
    .performance-thumbnail-large,
    .clear-filters-btn,
    .card,
    .btn {
        transition: none !important;
    }

    .elegant-table tbody tr:hover,
    .performance-thumbnail-large:hover,
    .card:hover,
    .btn:hover {
        transform: none !important;
    }
}

/* Focus management for keyboard navigation */
.elegant-table tbody tr:focus-within {
    outline: none;
    background: transparent;
}

/* Scroll-to-top floating button */
.scroll-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--brand-secondary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 9000;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s ease;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-top:hover {
    background: var(--brand-secondary-dark);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:active {
    transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        transition: none !important;
    }
}

/* Screen reader only — positioned far off-screen left so content
   cannot extend the viewport on iOS Safari. */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ============================
   UTILITIES - Clean & Simple
   ============================ */

.text-brand-primary { color: var(--brand-primary) !important; }
.text-brand-secondary { color: var(--brand-secondary) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

.font-primary { font-family: var(--font-primary); }
.font-serif { font-family: var(--font-serif); }
.font-devanagari { font-family: var(--font-devanagari); }
.font-monospace { font-family: var(--font-monospace); }

.font-light { font-weight: var(--font-weight-light); }
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-base { box-shadow: var(--shadow-base); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.transition-fast { transition: var(--transition-fast); }
.transition-base { transition: var(--transition-base); }
.transition-colors { transition: var(--transition-colors); }

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.will-change-transform {
    will-change: transform;
}

.will-change-transform:not(:hover):not(:focus) {
    will-change: auto;
}

/* ============================
   BREADCRUMB NAVIGATION
   ============================ */
.breadcrumb-nav {
    margin-bottom: var(--space-4);
    padding: var(--space-2) 0;
}

.breadcrumb-nav .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: var(--font-size-sm);
}

.breadcrumb-nav .breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-nav .breadcrumb-item a:hover {
    color: var(--brand-secondary);
    text-decoration: underline;
}

.breadcrumb-nav .breadcrumb-item.active {
    color: var(--text-muted);
}

.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
}

/* ============================
   SSR TABLE LINKS
   Internal links for SEO crawlability that match existing visual style
   ============================ */
.elegant-table a.ssr-link {
    color: inherit;
    text-decoration: none;
}

.elegant-table a.ssr-link:hover {
    color: inherit;
    text-decoration: none;
}

/* Index pages: row-level links */
.elegant-table tr[data-href] {
    cursor: pointer;
}

.elegant-table.index-table a.ssr-link strong {
    color: var(--text-primary);
}
