/* ============================================
   MIND4SCE - Infrared | FTIR Spectrum Analyzer
   Professional Stylesheet
   ============================================ */

/* CSS Variables - Dark Theme (Default) */
:root {
    --primary-color: #34D399;
    --primary-light: #6EE7B7;
    --primary-dark: #10B981;
    --accent-color: #20C997;
    --accent-light: #51CF66;
    --accent-dark: #12B886;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #EF4444;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-light: #6b7280;
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --border-color: #404040;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 8px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 8px 16px -4px rgba(0, 0, 0, 0.5);
    --radius-sm: 0;
    --radius: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --body-bg: #1a1a1a;
    --plot-bg: #000000;
    --plot-paper-bg: #1a1a1a;
    --plot-grid: #333333;
    --plot-text: #e5e7eb;
}

/* CSS Variables - Light Theme */
[data-theme="light"] {
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #F0F9F7;
    --bg-tertiary: #E0F9F5;
    --border-color: #C0F0E7;
    --shadow-sm: 0 1px 2px 0 rgba(52, 211, 153, 0.08);
    --shadow: 0 2px 4px -1px rgba(52, 211, 153, 0.1);
    --shadow-lg: 0 4px 8px -2px rgba(52, 211, 153, 0.15);
    --shadow-xl: 0 8px 16px -4px rgba(52, 211, 153, 0.2);
    --body-bg: #F3F4F6;
    --plot-bg: #ffffff;
    --plot-paper-bg: #ffffff;
    --plot-grid: #e5e7eb;
    --plot-text: #1f2937;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--body-bg);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    display: none;
}

body > * {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 2rem;
    margin-bottom: 0;
    border: none;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 20%, 
        var(--primary-light) 50%, 
        var(--primary-color) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 4s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    text-align: center;
    flex: 1;
}

/* Theme Toggle */
.theme-toggle-container {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle-btn:hover .theme-icon {
    color: #000;
}

.theme-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: var(--transition);
    position: absolute;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="light"] .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="light"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.logo-image {
    height: 220px;
    width: auto;
    margin-bottom: 1.5rem;
    filter: none;
    animation: fadeInDown 0.6s ease-out;
    mix-blend-mode: multiply;
}

/* Dark theme needs different blend mode */
.logo-dark {
    mix-blend-mode: screen;
}

/* Logo for dark theme (white logo) - shown by default */
.logo-dark {
    display: block;
}

.logo-light {
    display: none;
}

/* Logo for light theme (dark logo) */
[data-theme="light"] .logo-dark {
    display: none;
}

[data-theme="light"] .logo-light {
    display: block;
}

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

.logo-text {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: fadeIn 0.8s ease-out 0.2s both;
    font-family: 'Inter', monospace;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Card Styles */
.card {
    background: var(--bg-primary);
    overflow: hidden;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.card::before {
    display: none;
}

.card:hover {
    transform: none;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #000000;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 65%);
    border-radius: 50%;
}

.card-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header p {
    color: #374151;
    margin: 0.5rem 0 0 0;
    width: 100%;
    font-size: 0.95rem;
}

.card-body {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: var(--radius);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width 0.3s;
}

.tab-btn:hover {
    background: rgba(52, 211, 153, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn:hover::before {
    width: 60%;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--primary-color);
    box-shadow: var(--shadow), 0 -3px 0 var(--primary-color) inset;
    font-weight: 700;
}

.tab-btn.active::before {
    width: 100%;
}

/* Upload Mode */
.upload-mode {
    display: none;
}

.upload-mode.active {
    display: block;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    border: 3px dashed var(--primary-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.file-label::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.file-label:hover::before {
    opacity: 1;
}

.file-label:hover {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.file-label.drag-over {
    border-color: var(--accent-color);
    background: rgba(5, 150, 105, 0.05);
    box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 5rem;
    height: 5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.file-text {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.file-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

.file-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
    z-index: 1;
}

.file-name-editable {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
    z-index: 10;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    width: 100%;
    text-align: center;
    transition: var(--transition);
    cursor: text;
}

.file-name-editable:hover {
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

.file-name-editable:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-style: normal;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.file-name-editable.has-file {
    color: var(--accent-color);
    font-weight: 600;
    font-style: normal;
    background: rgba(5, 150, 105, 0.1);
}

.file-name.has-file {
    color: var(--accent-color);
    font-weight: 600;
    font-style: normal;
    padding: 0.5rem 1rem;
    background: rgba(5, 150, 105, 0.1);
    border-radius: var(--radius);
}

/* View Toggle Group */
.view-toggle-group {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem;
    border-radius: var(--radius);
    margin-right: 0.5rem;
}

.view-toggle-group .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

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

/* Spectrum List */
.spectrum-list {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.spectrum-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(185, 28, 28, 0.1);
    transition: all var(--transition);
    position: relative;
}

.spectrum-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.spectrum-item:last-child {
    border-bottom: none;
}

.spectrum-item:hover {
    background: rgba(52, 211, 153, 0.05);
    transform: translateX(3px);
}

.spectrum-item:hover::before {
    transform: scaleY(1);
}

.spectrum-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.spectrum-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.spectrum-color-picker {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.spectrum-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.spectrum-color-picker::-webkit-color-swatch {
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.spectrum-color-picker:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.spectrum-item:hover .spectrum-color {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 2px var(--primary-light);
}

.spectrum-details {
    flex: 1;
}

.spectrum-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.spectrum-name-input {
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    width: 100%;
    font-size: inherit;
    transition: var(--transition);
}

.spectrum-name-input:hover {
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

.spectrum-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.spectrum-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.spectrum-controls {
    display: flex;
    gap: 0.5rem;
}

/* Baseline Manual Controls */
.baseline-manual-controls {
    margin-top: 1rem;
}

.baseline-manual-controls .help-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-style: italic;
    padding: 0.4rem 0.6rem;
    background: rgba(52, 211, 153, 0.04);
    border-left: 2px solid rgba(52, 211, 153, 0.3);
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}

.baseline-points-list {
    max-height: 150px;
    overflow-y: auto;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.baseline-point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.baseline-point-item:last-child {
    border-bottom: none;
}

.baseline-point-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
}

/* Reference Library */
.reference-library-card {
    margin-bottom: 2rem;
}

.reference-library-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 1rem;
}

.library-search {
    grid-column: 1 / -1;
}

.library-filters {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.library-filters label {
    font-weight: 600;
    color: var(--text-primary);
}

.library-list {
    grid-column: 1;
    grid-row: 3;
}

.library-count {
    display: block;
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.library-info {
    grid-column: 2;
    grid-row: 3;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow-y: auto;
    max-height: 300px;
}

.library-info .info-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.compound-info h4 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.compound-info p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.compound-info strong {
    color: var(--text-primary);
}

/* Reference Intensity Bar - shown in visualization when reference is active */
.reference-intensity-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(249, 115, 22, 0.1) 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.ref-intensity-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #F59E0B;
    white-space: nowrap;
}

.reference-intensity-bar input[type="range"] {
    width: 200px;
    accent-color: #F59E0B;
    cursor: pointer;
}

.ref-intensity-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #F59E0B;
    min-width: 2.5rem;
    text-align: right;
}

.library-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.library-list select {
    height: 100%;
    min-height: 250px;
}

.reference-controls {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#referenceSearch {
    margin-bottom: 0.5rem;
}

#referenceSelect {
    height: auto !important;
    min-height: 120px;
    margin-bottom: 0.5rem;
}

#referenceSelect option {
    padding: 0.5rem;
    cursor: pointer;
}

#referenceSelect option:hover {
    background-color: var(--bg-tertiary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #EF4444 100%);
    color: white;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
}

.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 0.4rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn > * {
    position: relative;
    z-index: 1;
}

/* Control Group */
.control-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Header Color Picker */
.header-color-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: auto;
}
.header-color-picker:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}
.header-color-picker:hover label {
    color: white;
}
.header-color-picker .btn-icon {
    color: var(--primary-color);
    transition: color 0.3s ease;
}
.header-color-picker:hover .btn-icon {
    color: white;
}
.header-color-picker label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    user-select: none;
    margin: 0;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}
.header-color-picker input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    z-index: 1;
}
.header-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 1px;
}
.header-color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}
.header-color-picker input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}
.header-color-picker:hover input[type="color"] {
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 8px rgba(255,255,255,0.25);
    transform: scale(1.1);
}

/* Visualization Layout */
.viz-layout {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    min-height: 600px;
    align-items: stretch;
    width: 100%;
}

.viz-layout.no-panel {
    /* When panel is hidden, plot takes full width */
    grid-template-columns: 1fr;
}

/* Preprocessing Panel */
.preprocess-panel {
    flex: 0 0 280px;
    width: 280px;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-right: 2px solid var(--border-color);
    height: 600px;
    max-height: 600px;
    overflow-y: auto;
    display: none;
    position: relative;
}

.preprocess-panel::before {
    display: none;
}

.preprocess-panel.active {
    display: block;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
    letter-spacing: 0.03em;
}

.panel-title::after {
    content: '\2699';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.1rem;
    -webkit-text-fill-color: var(--primary-color);
}

.control-section {
    margin-bottom: 1.25rem;
    padding: 1.1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.control-section:hover {
    box-shadow: var(--shadow);
    border-color: rgba(52, 211, 153, 0.25);
}

.control-section label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.35rem;
}

.control-section:last-child {
    border-bottom: none;
}

.control-section.export-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.control-section.export-section h4 {
    color: #3B82F6;
}

.control-section.export-section .btn {
    margin-bottom: 0.5rem;
}

.control-section.export-section .btn:last-child {
    margin-bottom: 0;
}

/* Export Data Section Below Plot */
.export-data-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.export-data-section:hover {
    box-shadow: var(--shadow);
    border-color: rgba(59, 130, 246, 0.3);
}

.export-data-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3B82F6;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.export-data-section h3::before {
    content: '▸';
    color: #3B82F6;
    font-weight: bold;
}

.export-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
}

.export-buttons-group .btn {
    width: 100%;
    max-width: 280px;
}

.control-section h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.02em;
}

.control-section h4::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--primary-color);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border-color);
    font-size: 0.88rem;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    transition: background 0.2s ease;
    margin-bottom: 0.25rem;
}

.checkbox-control:hover {
    background: rgba(52, 211, 153, 0.06);
}

.checkbox-control input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-control label {
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.3;
}

/* General help text style */
.help-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0.4rem 0;
    font-style: italic;
    padding: 0.4rem 0.6rem;
    background: rgba(52, 211, 153, 0.04);
    border-left: 2px solid rgba(52, 211, 153, 0.3);
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}

.form-range {
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, rgba(52, 211, 153, 0.15) 100%);
    border-radius: 1rem;
    outline: none;
    margin-top: 0.5rem;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: 2.5px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(52, 211, 153, 0.3);
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(52, 211, 153, 0.4);
}

.manual-offset-control {
    margin-top: 0.75rem;
}

.manual-offset-control label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Plot Container */
.plot-container {
    background: var(--plot-bg);
    border-left: 1px solid var(--border-color);
    height: 600px;
    flex: 1 1 0%;
    min-width: 0;
    padding: 0;
    position: relative;
    box-sizing: border-box;
    display: block;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* Force Plotly internal elements to fill container */
.plot-container .plotly,
.plot-container .svg-container,
.plot-container .main-svg {
    width: 100% !important;
    height: 100% !important;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    transition: all var(--transition);
    position: relative;
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 4s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.info-item:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--primary-light);
}

.info-item:hover::before {
    opacity: 1;
}

.info-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.info-label::before {
    content: '▸';
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 2rem;
    margin-top: 0;
    text-align: center;
    border: none;
    border-top: 2px solid var(--border-color);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 20%, 
        var(--primary-light) 50%, 
        var(--primary-color) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 4s ease-in-out infinite;
    opacity: 0.8;
}


.footer p {
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.footer-credits {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(52, 211, 153, 0.2);
}

.footer-credits p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-weight: 500;
}

.footer-credits a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
}

.footer-credits a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
}

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

.spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Import Preview Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.import-preview-modal {
    width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.preview-info {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.preview-table-container {
    max-height: 300px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.preview-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.preview-table tr.skipped {
    background: rgba(239, 68, 68, 0.1);
    text-decoration: line-through;
    color: var(--text-light);
}

.preview-table tr.skipped td {
    color: var(--text-light);
}

.preview-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.preview-table tbody tr:hover:not(.skipped) {
    background: var(--bg-tertiary);
}

.preview-table .row-number {
    color: var(--text-light);
    font-size: 0.75rem;
    width: 40px;
    text-align: center;
}

.preview-table .col-freq {
    background: rgba(52, 211, 153, 0.1);
}

.preview-table .col-intensity {
    background: rgba(245, 158, 11, 0.1);
}

.import-config {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.config-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.config-row:last-child {
    margin-bottom: 0;
}

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

.config-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.config-item select {
    width: 100%;
}

.gradient-picker {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.gradient-picker input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.depth-mask-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.depth-mask-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 0.25rem 0;
}

.skip-rows-input {
    flex: 1.5;
}

.skip-rows-input input {
    width: 100%;
}

.skip-rows {
    flex: 1.5;
}

.skip-rows-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    min-height: 2.2rem;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-footer .modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.apply-to-all-container {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.apply-to-all-container .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.apply-to-all-container .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 420px;
}

.notification {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    backdrop-filter: blur(15px);
    padding: 1.25rem 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid var(--border-color);
}

@keyframes slideInBounce {
    0% {
        transform: translateX(500px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(-20px) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.notification.success {
    border-left-color: var(--success-color);
    border-color: rgba(5, 150, 105, 0.2);
}

.notification.error {
    border-left-color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.2);
}

.notification.warning {
    border-left-color: var(--warning-color);
    border-color: rgba(245, 158, 11, 0.2);
}

.notification-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .viz-layout {
        grid-template-columns: 1fr;
    }
    
    .preprocess-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .control-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .notification-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.75rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .file-label {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        width: 3rem;
        height: 3rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* ============================================
   TOOLTIP SYSTEM
   ============================================ */

/* Info icon (ⓘ) displayed next to section titles */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    font-size: 0.7rem;
    font-style: normal;
    line-height: 1;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.15);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    cursor: help;
    vertical-align: middle;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    -webkit-text-fill-color: var(--primary-color);
}

.info-icon:hover {
    background: var(--primary-color);
    color: #000;
    -webkit-text-fill-color: #000;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

/* Universal tooltip for any element with data-tooltip */
[data-tooltip] {
    position: relative;
}

/* ============================================
   TOOLTIP BUBBLE (JS-powered, appended to body)
   ============================================ */
.tooltip-bubble {
    position: fixed;
    z-index: 99999;
    padding: 0.55rem 0.8rem;
    background: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #e5e7eb);
    -webkit-text-fill-color: var(--text-primary, #e5e7eb);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    word-wrap: break-word;
    max-width: 260px;
    border-radius: 6px;
    border: 1px solid var(--primary-color, #34D399);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(52, 211, 153, 0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.tooltip-bubble.visible {
    opacity: 1;
}

/* ============================================
   SESSION MANAGEMENT STYLES
   ============================================ */
.sessions-panel-content {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.sessions-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.sessions-section:hover {
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: var(--shadow);
}

.sessions-section-header {
    margin-bottom: 1.5rem;
}

.sessions-section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sessions-section-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.sessions-section-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    gap: 1rem;
    transition: var(--transition);
    flex-wrap: wrap;
}

.session-item:hover {
    background: var(--bg-secondary);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

.session-info {
    flex: 1;
    min-width: 200px;
}

.session-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    word-break: break-word;
    font-size: 0.95rem;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.session-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.session-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.session-actions .btn {
    margin: 0;
}

.tooltip-bubble::before {
    content: '';
    position: absolute;
    left: 1rem;
    border: 5px solid transparent;
}

.tooltip-bubble.arrow-top::before {
    top: -10px;
    border-bottom-color: var(--primary-color, #34D399);
}

.tooltip-bubble.arrow-bottom::before {
    bottom: -10px;
    border-top-color: var(--primary-color, #34D399);
}

/* ===== USAGE COUNTER ===== */
.usage-counter-inner {
    max-width: 400px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.6);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}
:root:not([data-theme="light"]) .usage-counter-inner {
    background: rgba(19, 24, 37, 0.5);
    border-color: rgba(255, 255, 255, 0.06);
}
.usage-counter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.usage-counter-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}
:root:not([data-theme="light"]) .usage-counter-label {
    color: var(--text-secondary);
}
.usage-counter-numbers {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
:root:not([data-theme="light"]) .usage-counter-numbers {
    color: var(--text-primary);
}
.usage-counter-sep {
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0 0.125rem;
}
.usage-counter-track {
    width: 100%;
    height: 5px;
    border-radius: 9999px;
    background: rgba(226, 232, 240, 0.5);
    overflow: hidden;
}
:root:not([data-theme="light"]) .usage-counter-track {
    background: rgba(255, 255, 255, 0.06);
}
.usage-counter-fill {
    height: 100%;
    border-radius: 9999px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

/* Color states */
.usage-state-ok .usage-counter-fill {
    background: linear-gradient(90deg, #6366f1, #06b6d4);
}
.usage-state-warn .usage-counter-fill {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}
.usage-state-warn .usage-counter-numbers {
    color: #d97706;
}
.usage-state-danger .usage-counter-fill {
    background: linear-gradient(90deg, #f97316, #ef4444);
}
.usage-state-danger .usage-counter-numbers {
    color: #ef4444;
}
.usage-state-danger .usage-counter-inner,
.usage-state-blocked .usage-counter-inner {
    border-color: rgba(239, 68, 68, 0.2);
}
.usage-state-blocked .usage-counter-fill {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}
.usage-state-blocked .usage-counter-numbers {
    color: #ef4444;
