﻿/* Full-Screen Map Layout */
:root {
    --sidebar-width: 280px;
    --panel-width: 320px;
    --primary-color: #2563eb;
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --special-color: #fdf2f2;
    --special-glow: #fef3c7;
    --special-text: #92400e;
    --star-yellow: #fbbf24;
    --absent-color: #fee2e2;
    --absent-text: #991b1b;
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

/* Panel State Classes for Body */
body.labs-panel-open #labs-toggle-tab,
body.labs-panel-open #weeks-toggle-tab,
body.weeks-panel-open #labs-toggle-tab,
body.weeks-panel-open #weeks-toggle-tab {
    left: calc(var(--sidebar-width) + var(--panel-width));
}

/* Toggle Tab Positioning is handled in specific rules below */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Left Sidebar - Presented Today */
#left-sidebar {
    width: var(--sidebar-width);
    min-width: 200px;
    max-width: 500px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    z-index: 300;
    /* Highest priority so panels slide 'under' */
    flex-shrink: 0;
    position: relative;
}

#left-sidebar header,
#labs-panel header,
#weeks-panel header,
#hands-panel header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    background: var(--sidebar-bg);
    flex-shrink: 0;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    /* Fixed height for title row to align search bars */
}

#left-sidebar header h2,
#labs-panel header h1,
#weeks-panel header h1,
#hands-panel header h1 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin: 0;
    line-height: normal;
}

#attendance-counter,
.panel-stat-counter {
    font-size: 0.8rem;
    font-weight: 700;
    /* Bolder for better visibility */
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-divider {
    color: #cbd5e1;
    margin: 0 1px;
}

.stat-absent {
    color: #ef4444;
}

.stat-present {
    color: #10b981;
}

.stat-total {
    color: #3b82f6;
}

#labs-panel-close,
#weeks-panel-close,
#hands-panel-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

#presented-list-container {
    flex: 1;
    overflow-y: auto;
}

#presented-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Search Box Styling */
.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
}

.search-box input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    padding-bottom: 2px;
    border-radius: 50%;
    line-height: normal;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* Show when input has text (placeholder is NOT shown) */
.search-box input:not(:placeholder-shown)+.clear-search-btn {
    display: flex;
}

#presented-list li,
.lab-student-item {
    padding: 8px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 48px;
}

.lab-student-item {
    padding-left: 40px;
}

#presented-list li:hover,
.lab-student-item:hover {
    background-color: #f1f5f9;
}

/* Absent State - Unified */
#presented-list li.absent,
.lab-student-item.absent {
    background-color: var(--absent-color);
}

#presented-list li.absent:hover,
.lab-student-item.absent:hover {
    background-color: #fecaca;
}

#presented-list li.absent .name,
.lab-student-item.absent .name {
    color: var(--absent-text);
}

/* Present State - Unified */
.lab-student-item.present {
    background-color: #dcfce7;
}

#presented-list li.present {
    background-color: transparent;
    /* No green background in Today tab as requested */
}

.lab-student-item.present:hover {
    background-color: #bbf7d0;
}

.lab-student-item.present .name {
    color: #166534;
}

#presented-list li.present .name {
    color: #166534;
    /* Keep the green text color for distinction */
}

/* Special State - Good Work ÃƒÆ’Ã‚Â¢Ãƒâ€šÃ‚Â­Ãƒâ€šÃ‚Â */
#presented-list li.special,
.lab-student-item.special {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border-bottom: 1px solid #fde68a;
}

#presented-list li.special:hover,
.lab-student-item.special:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

#presented-list li.special .name,
.lab-student-item.special .name {
    color: #92400e;
}

#presented-list li.special .time,
.lab-student-item.special .time {
    background: #fde68a;
    color: #92400e;
}

.star-history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin: 2px;
    border: 1px solid #fde68a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


.star-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 0 0 0 4px;
    margin: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.star-remove-btn:hover {
    opacity: 1;
    color: #ef4444;
}

/* Simplified Star for row icons */
.row-star {
    color: #fbbf24;
    margin-right: 4px;
    font-size: 0.9rem;
}

/* Active State - Unified (Selected Student) */
#presented-list li.active,
.lab-student-item.active {
    border-left: 4px solid #3b82f6 !important;
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
    /* Selection outline */
    z-index: 1;
}

/* Backgrounds for Active Students */
#presented-list li.active:not(.absent):not(.present),
.lab-student-item.active:not(.absent):not(.present) {
    background-color: #dbeafe;
    /* Blue for reset/neutral */
}

/* Preserve status backgrounds when active */
.lab-student-item.active.present {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.lab-student-item.active.absent {
    background-color: var(--absent-color) !important;
    color: #991b1b !important;
}

#presented-list li.active:hover,
.lab-student-item.active:hover {
    filter: brightness(0.98);
}

#presented-list li.active:not(.absent):hover,
.lab-student-item.active:not(.absent):hover {
    background-color: #bfdbfe;
}

#presented-list li.active .name,
.lab-student-item.active .name {
    color: #1d4ed8;
}

#presented-list li .student-info,
.lab-student-item .student-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-width: 0;
}

#presented-list li .name,
.lab-student-item .name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#presented-list li .time,
.lab-student-item .time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
    min-width: 54px;
}

#presented-list li.active .time,
.lab-student-item.active .time {
    background: #bfdbfe;
    color: #1d4ed8;
}

#presented-list li.absent .time,
.lab-student-item.absent .time {
    background: #fecaca;
    color: var(--absent-text);
}

.lab-student-item.present .name {
    color: #059669;
}

.lab-student-item.present .time {
    background: #dcfce7;
    color: #166534;
}

#presented-list li .remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
}

#presented-list li .remove-btn:hover {
    background: var(--danger-color);
    color: white;
}

#left-sidebar footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

/* Main Map Container */
#map-main {
    flex: 1;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-btn:hover {
    transform: scale(1.1);
    background: #f8fafc;
}

.map-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Random Spin Button - Sleek Black Pill Design */
.random-spin-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 999px;
    /* Pill shape */
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.random-spin-btn:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.random-spin-btn:active:not(:disabled) {
    transform: translateX(-50%) translateY(0);
}

.random-spin-btn:disabled {
    background: #555;
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Demo Mode Spin Button overrides */
.random-spin-btn.demo-mode-spin {
    background: #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.random-spin-btn.demo-mode-spin:hover:not(:disabled) {
    background: #d97706;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.random-spin-btn.demo-mode-spin:active:not(:disabled) {
    background: #b45309;
}

.spin-icon {
    font-size: 1.4rem;
    transition: transform 0.5s ease;
}

.random-spin-btn:hover .spin-icon {
    transform: rotate(15deg);
}

/* Status Indicator */
#status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    font-size: 0.75rem;
    padding: 6px 16px;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status.connected {
    background-color: #dcfce7;
    color: #166534;
    box-shadow: 0 2px 5px rgba(22, 101, 52, 0.1);
}

.status.warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.status.error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Student Modal Popup */
.modal-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    pointer-events: none;
}

.modal-overlay.show {
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 32px;
    min-width: 400px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

#modal-student-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

#modal-lab-info {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

#modal-location-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

/* Right Sidebar - Lab Images */
#right-sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.02);
    z-index: 10;
    flex-shrink: 0;
}

#right-sidebar header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

#right-sidebar h2 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0;
}

.images-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
}

.image-frame {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.view-more-link {
    display: block;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.view-more-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Toggle Switch Animations */
#popup-toggle:checked+span {
    background-color: #ef4444;
}

#popup-toggle:checked+span+span {
    transform: translateX(28px);
}

#popup-toggle:focus+span {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Smooth transitions for status changes */
#popup-status {
    transition: color 0.3s ease;
}

#popup-mark-btn {
    transition: all 0.2s ease;
}

#popup-mark-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Outlined Button Hover Effects */
#popup-lab-page:hover,
#popup-view-lab:hover {
    background: var(--primary-color);
    color: white;
}

#popup-open-page:hover {
    background: #1d4ed8;
}

/* Sidebar Resize Handle */
#sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 20;
    transition: background 0.2s;
}

#sidebar-resize-handle:hover,
#sidebar-resize-handle.dragging {
    background: var(--primary-color);
}

body.resizing {
    cursor: col-resize !important;
    user-select: none;
}

/* Panels (Labs, Weeks & Hands) */
#labs-panel,
#weeks-panel,
#hands-panel {
    position: fixed;
    left: calc(var(--sidebar-width) - 320px);
    /* Hidden behind sidebar, but edge aligned */
    top: 0;
    width: 320px;
    height: 100vh;
    background: white;
    border-right: 1px solid var(--border-color);
    z-index: 200;
    /* Above map controls (100) */
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease-in-out;
    /* Synchronized with tabs */
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

/* Instant swapping when switching between already open panels */
body.is-switching #labs-panel,
body.is-switching #weeks-panel,
body.is-switching #hands-panel,
body.is-switching #panel-tabs-container {
    transition: none !important;
}

/* Panels move ONLY when open */
#labs-panel.open,
#weeks-panel.open,
#hands-panel.open {
    left: var(--sidebar-width);
    z-index: 205;
    /* Above base panels (200), below tabs (210) */
}

#labs-list-container,
#weeks-list-container {
    flex: 1;
    overflow-y: auto;
}

.week-group {
    transition: background 0.2s, outline 0.2s;
}

.week-group.drag-over {
    background-color: #eff6ff !important;
    outline: 2px dashed var(--primary-color) !important;
    outline-offset: -4px;
}

.lab-student-item.dragging {
    opacity: 0.5;
    background: #f1f5f9;
}

/* Panel Titles (Restored) */
.lab-title,
.week-title {
    padding: 10px 20px;
    background: #f1f5f9;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    /* Let drag events pass through to group */
}

/* Student Lists */
.lab-student-list,
.week-student-list,
.hand-student-list {
    list-style: none;
    padding: 0;
}

.lab-group,
.week-group,
.hand-group {
    margin-bottom: 32px;
}

/* Shared Tab Container for Rigid Movement */
#panel-tabs-container {
    position: fixed;
    left: var(--sidebar-width);
    /* Perfectly flush with sidebar edge */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 210;
    /* Above panels (200) */
    transition: left 0.3s ease-in-out;
}

/* Rigid Movement: Container moves with panels */
body.any-panel-open #panel-tabs-container {
    left: calc(var(--sidebar-width) + 320px);
    /* Perfectly flush with panel edge */
}

/* Toggle Chips (Unified) */
.panel-toggle-chip {
    background: #334155;
    color: #94a3b8;
    border: none;
    cursor: pointer;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 22px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.3;
    transition: all 0.3s ease-in-out;
}

#labs-toggle-tab {
    border-radius: 12px 12px 0 0;
}

/* Red notification badge on SPECIAL tab */
.tab-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    line-height: 1;
}

#weeks-toggle-tab {
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#hands-toggle-tab {
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Active State: Blend into Panel Body with Organic Curves */
body.labs-panel-open #labs-toggle-tab,
body.weeks-panel-open #weeks-toggle-tab,
body.hands-panel-open #hands-toggle-tab {
    background: white;
    color: var(--primary-color);
    box-shadow: none;
    /* No shadow to blend */
    width: 24px;
    /* Slight overlap */
    font-weight: 950;
    z-index: 211;
}

/* Organic Concave Fillets (Shoulders) */
/* These create a small concave curve on the RIGHT side of the tabs,
   bridging the rounded tab corner to the straight sidebar/panel edge. */

/* Labs: concave curve just above the top-right rounded corner */
#labs-toggle-tab::before {
    content: "";
    position: absolute;
    top: -27px;
    left: 0;
    width: 12px;
    height: 27px;
    background: transparent;
    border-bottom-left-radius: 10px;
    box-shadow: 0 17px 0 0 #334155;
    pointer-events: none;
    z-index: -1;
    transition: box-shadow 0.3s ease-in-out;
}

/* Hands (was Weeks/bottom-most): concave curve just below the bottom-right rounded corner */
#hands-toggle-tab::after {
    content: "";
    position: absolute;
    bottom: -27px;
    left: 0;
    width: 12px;
    height: 27px;
    background: transparent;
    border-top-left-radius: 10px;
    box-shadow: 0 -17px 0 0 #334155;
    pointer-events: none;
    z-index: -1;
    transition: box-shadow 0.3s ease-in-out;
}

/* Active State: switch fillet color to white to match open panel */
body.labs-panel-open #labs-toggle-tab::before {
    box-shadow: 0 17px 0 0 white;
}

body.hands-panel-open #hands-toggle-tab::after {
    box-shadow: 0 -17px 0 0 white;
}

/* Middle Junction: Maintain a solid flat vertical line */
#labs-toggle-tab::after,
#weeks-toggle-tab::before,
#weeks-toggle-tab::after,
#hands-toggle-tab::before {
    display: none;
}

/* Hover Effect */
.panel-toggle-chip:hover {
    background: #475569;
}

/* Startup Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.overlay.show {
    display: flex;
}

.startup-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    width: min(480px, calc(100vw - 32px));
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 480px) {
    .startup-card {
        padding: 32px 24px;
    }
}

#startup-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.mode-opt-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-opt-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.mode-opt-btn strong {
    display: block;
    color: #1e293b;
    font-size: 1rem;
}

.mode-opt-btn p {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

/* Mode Indicators (DEMO / INSTRUCTOR) */
.mode-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    border-radius: 20px;
    z-index: 9999;
    letter-spacing: 0.1em;
}

#demo-indicator {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

#instructor-indicator {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

@media (max-width: 768px) {
    .mode-indicator {
        display: none !important;
    }
}

/* ======== DARK THEME ======== */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --absent-color: #451a03;
    --absent-text: #fca5a5;
}

[data-theme="dark"] #left-sidebar footer {
    background: #0f172a;
}

[data-theme="dark"] .panel-toggle-chip {
    background: #1e293b;
}

[data-theme="dark"] .panel-toggle-chip:hover {
    background: #334155;
}

[data-theme="dark"] body.labs-panel-open #labs-toggle-tab,
[data-theme="dark"] body.weeks-panel-open #weeks-toggle-tab {
    background: var(--sidebar-bg);
    color: #60a5fa;
}

[data-theme="dark"] body.labs-panel-open #labs-toggle-tab::before {
    box-shadow: 0 17px 0 0 var(--sidebar-bg);
}

[data-theme="dark"] body.weeks-panel-open #weeks-toggle-tab::after {
    box-shadow: 0 -17px 0 0 var(--sidebar-bg);
}

[data-theme="dark"] #labs-panel,
[data-theme="dark"] #weeks-panel {
    background: var(--sidebar-bg);
}

[data-theme="dark"] .lab-title,
[data-theme="dark"] .week-title {
    background: #0f172a;
    color: #94a3b8;
}

[data-theme="dark"] .search-box input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .search-box input:focus {
    background: #1e293b;
    border-color: #3b82f6;
}

[data-theme="dark"] #presented-list li:hover,
[data-theme="dark"] .lab-student-item:hover {
    background-color: #334155;
}

[data-theme="dark"] #presented-list li .time,
[data-theme="dark"] .lab-student-item .time {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .map-btn {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .map-btn:hover {
    background: #334155;
}

[data-theme="dark"] .random-spin-btn {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .random-spin-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

[data-theme="dark"] .random-spin-btn.demo-mode-spin {
    background: #f59e0b;
    color: white;
}

[data-theme="dark"] .random-spin-btn.demo-mode-spin:hover:not(:disabled) {
    background: #d97706;
}

[data-theme="dark"] .overlay {
    background: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .startup-modal {
    background: #1e293b;
    color: #f1f5f9;
}

[data-theme="dark"] .mode-opt-btn {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .mode-opt-btn:hover {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .mode-opt-btn strong {
    color: #f1f5f9;
}

[data-theme="dark"] .mode-opt-btn p {
    color: #94a3b8;
}

[data-theme="dark"] #presented-list li .remove-btn {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] #presented-list li .remove-btn:hover {
    background: #ef4444;
    color: white;
}

/* Present/Absent in dark */
[data-theme="dark"] .lab-student-item.present {
    background-color: #064e3b;
}

[data-theme="dark"] .lab-student-item.present .name {
    color: #6ee7b7;
}

[data-theme="dark"] .lab-student-item.present .time {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] #presented-list li.present .name {
    color: #6ee7b7;
}

[data-theme="dark"] #presented-list li.absent {
    background-color: #451a03;
}

[data-theme="dark"] .lab-student-item.absent {
    background-color: #451a03;
}

[data-theme="dark"] #presented-list li.active:not(.absent):not(.present),
[data-theme="dark"] .lab-student-item.active:not(.absent):not(.present) {
    background-color: #1e3a5f;
}

[data-theme="dark"] #presented-list li.active .time,
[data-theme="dark"] .lab-student-item.active .time {
    background: #1e3a5f;
    color: #60a5fa;
}

/* ======== SETTINGS MODAL ======== */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.settings-overlay.show {
    display: flex;
}

.settings-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: settingsSlideIn 0.25s ease-out;
}

@keyframes settingsSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

[data-theme="dark"] .settings-modal {
    background: #1e293b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.settings-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="dark"] .settings-close-btn {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .settings-close-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

.settings-body {
    padding: 16px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 55%;
}

.settings-slider-group input[type="range"] {
    flex: 1;
    accent-color: #2563eb;
    cursor: pointer;
}

.settings-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Toggle switch */
.settings-toggle {
    appearance: none;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.settings-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.settings-toggle:checked {
    background: #2563eb;
}

.settings-toggle:checked::after {
    transform: translateX(20px);
}

[data-theme="dark"] .settings-toggle {
    background: #475569;
}

.settings-danger-btn,
.settings-secondary-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.settings-danger-btn {
    background: #fee2e2;
    color: #991b1b;
}

.settings-danger-btn:hover {
    background: #fecaca;
}

[data-theme="dark"] .settings-danger-btn {
    background: #451a03;
    color: #fca5a5;
}

.settings-secondary-btn {
    background: #f1f5f9;
    color: #475569;
}

.settings-secondary-btn:hover {
    background: #e2e8f0;
}

[data-theme="dark"] .settings-secondary-btn {
    background: #334155;
    color: #94a3b8;
}

.settings-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.settings-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Lab Markers */
.lab-marker-pin {
    position: relative;
    width: 28px;
    height: 28px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lab-marker-inner {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    border: 3px solid #000;
    /* Overridden by state below */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

/* Color States */
.lab-marker-inner.status-none {
    border-color: #f97316;
}

.lab-marker-inner.status-some {
    border-color: #3b82f6;
}

.lab-marker-inner.status-all {
    border-color: #10b981;
}

.lab-marker-inner .presented {
    color: #10b981;
}

.lab-marker-inner .total {
    color: #3b82f6;
}

.lab-marker-inner .divider {
    color: #000;
    margin: 0 1px;
}

/* Hand Selection Styles */
.hand-student-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    background: white;
}

.hand-student-item:hover {
    background: #f1f5f9;
}

.hand-student-item.selected {
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
}

.hand-student-item .name {
    font-weight: 600;
}

.hand-student-item .lab {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Raised Hand Indicator */
.hand-icon {
    font-size: 1.1rem;
    margin-right: 8px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

#presented-list li .hand-icon {
    margin-right: 4px;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .lab-marker-inner {
    background: #1e293b;
}

[data-theme="dark"] .lab-marker-inner .divider {
    color: #fff;
}

[data-theme="dark"] .hand-student-item {
    background: #1e293b;
    border-bottom-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .hand-student-item:hover {
    background: #334155;
}

[data-theme="dark"] .hand-student-item.selected {
    background: #0f172a;
    border-left-color: var(--primary-color);
}

/* =========================================
   Export Modal (Refined IDE & Glassmorphism)
   ========================================= */

.export-overlay-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.4);
}

.export-modal {
    display: flex;
    flex-direction: column;
    width: 650px;
    max-width: 95vw;
    min-width: 320px;
    height: 85vh;
    min-height: 550px;
    max-height: 90vh;
    padding: 0;
    resize: both;
    overflow: hidden;
    /* Light Mode Defaults */
    background: #F9FAFB;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.export-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: transparent;
}

.export-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.export-count-badge {
    background: #E5E7EB;
    color: #374151;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.export-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #6B7280;
    transition: all 0.2s;
}

.export-close:hover {
    background: #E5E7EB;
    color: #111827;
}

.export-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow: hidden;
    max-height: none;
}

.ide-container {
    flex: 1;
    display: flex;
    border-radius: 8px;
    overflow: auto;
    margin-bottom: 24px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Inter', monospace;
    font-size: 13px;
    line-height: 1.6;
    /* Light Mode */
    background: #F3F4F6;
    border: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.export-line-numbers {
    padding: 16px 0;
    text-align: right;
    user-select: none;
    position: sticky;
    left: 0;
    z-index: 2;
    /* Light Mode */
    color: #9CA3AF;
    background: #F3F4F6;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 48px;
}

.export-pre {
    margin: 0;
    padding: 16px 0;
    overflow: visible;
    /* Light Mode */
    color: #374151;
}

.json-line-number {
    padding: 0 12px;
}

.line-number {
    padding: 0 12px;
    min-height: 1.6em;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.json-line-code {
    padding: 0 16px;
    min-height: 1.6em;
}

/* Date Grouping Highlight Colors (Light Mode) */
.json-date-0 {
    color: #3B82F6 !important;
}

/* Blue */
.json-date-1 {
    color: #10B981 !important;
}

/* Green */
.json-date-2 {
    color: #F59E0B !important;
}

/* Orange */
.json-date-3 {
    color: #8B5CF6 !important;
}

/* Purple */
.json-date-4 {
    color: #EC4899 !important;
}

/* Pink */

/* Syntax Highlighting Base (Light Mode) */
.json-key {
    color: #3B82F6;
}

/* Soft Blue */
.json-string {
    color: #059669;
}

/* Green */
.json-number {
    color: #D97706;
}

/* Muted Orange */
.json-boolean,
.json-null {
    color: #DC2626;
}

/* Red */

/* Buttons */
.export-actions {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.export-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-export-primary {
    background: #2563EB;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-export-primary:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
}

.btn-export-secondary {
    background: transparent;
    color: #4B5563;
    border: 1px solid #D1D5DB;
}

.btn-export-secondary:hover {
    background: #F3F4F6;
    color: #111827;
}

/* =========================================
   Dark Mode Overrides for Export Modal
   ========================================= */
[data-theme="dark"] .export-overlay-blur {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .export-modal {
    background: #121212;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .export-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .export-title {
    color: #F9FAFB;
}

[data-theme="dark"] .export-count-badge {
    background: #374151;
    color: #D1D5DB;
}

[data-theme="dark"] .export-close {
    color: #9CA3AF;
}

[data-theme="dark"] .export-close:hover {
    background: #1F2937;
    color: #F9FAFB;
}

[data-theme="dark"] .ide-container,
[data-theme="dark"] .export-line-numbers {
    background: #1E1E1E;
}

[data-theme="dark"] .ide-container {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .export-line-numbers {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #6B7280;
}

[data-theme="dark"] .export-pre {
    color: #E5E7EB;
}

/* Date Grouping Highlight Colors (Dark Mode) */
[data-theme="dark"] .json-date-0 {
    color: #818CF8 !important;
}

/* Indigo */
[data-theme="dark"] .json-date-1 {
    color: #2DD4BF !important;
}

/* Teal */
[data-theme="dark"] .json-date-2 {
    color: #FBBF24 !important;
}

/* Amber */
[data-theme="dark"] .json-date-3 {
    color: #C084FC !important;
}

/* Purple */
[data-theme="dark"] .json-date-4 {
    color: #F472B6 !important;
}

/* Pink */

/* Syntax Highlighting (Dark Mode) */
[data-theme="dark"] .json-key {
    color: #6366F1;
}

/* Indigo */
[data-theme="dark"] .json-string {
    color: #14B8A6;
}

/* Deep Teal */
[data-theme="dark"] .json-number {
    color: #F59E0B;
}

/* Yellow-Orange */
[data-theme="dark"] .json-boolean,
[data-theme="dark"] .json-null {
    color: #EF4444;
}

/* Red */

[data-theme="dark"] .btn-export-secondary {
    color: #9CA3AF;
    border-color: #4B5563;
}

/* ------------------------------------- */
/* Help Modal & Onboarding Tabs          */
/* ------------------------------------- */

.help-tabs-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.help-tabs-sidebar {
    width: 200px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

[data-theme="dark"] .help-tabs-sidebar {
    background: #0f172a;
    border-right-color: #334155;
}

.help-tab-btn {
    background: transparent;
    border: none;
    text-align: left;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

[data-theme="dark"] .help-tab-btn {
    color: #94a3b8;
}

.help-tab-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="dark"] .help-tab-btn:hover {
    background: #1e293b;
    color: #f8fafc;
}

.help-tab-btn.active {
    background: #e0e7ff;
    color: #4f46e5;
    border-left-color: #4f46e5;
    font-weight: 600;
}

[data-theme="dark"] .help-tab-btn.active {
    background: #312e81;
    color: #c7d2fe;
    border-left-color: #818cf8;
}

.help-content-area {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    background: #ffffff;
}

[data-theme="dark"] .help-content-area {
    background: #1e293b;
}

.help-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.help-tab-content.active {
    display: block;
}

.help-tab-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #0f172a;
    font-size: 0.95rem;
}

[data-theme="dark"] .help-tab-content h3 {
    color: #f8fafc;
}

.help-tab-content h4 {
    font-size: 0.85rem;
    margin-bottom: 6px;
    margin-top: 18px;
    color: #334155;
}

[data-theme="dark"] .help-tab-content h4 {
    color: #e2e8f0;
}


.help-tab-content p {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 12px;
}

[data-theme="dark"] .help-tab-content p {
    font-size: 0.82rem;
    color: #cbd5e1;
}

.help-media-container {
    width: 100%;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
}

[data-theme="dark"] .help-media-container {
    border-color: #334155;
    background: #0f172a;
}

.help-media-container img,
.help-media-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* Custom List Styling for Help Modals */
.help-list-container ul,
.help-tab-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
    margin-top: 8px;
}

.help-list-container li,
.help-tab-content li {
    position: relative;
    font-size: 0.82rem;
    padding-left: 20px;
    margin-bottom: 6px;
    color: #475569;
    line-height: 1.5;
}

[data-theme="dark"] .help-list-container li,
[data-theme="dark"] .help-tab-content li {
    color: #cbd5e1;
}

.help-list-container li::before,
.help-tab-content li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
}

[data-theme="dark"] .help-list-container li::before,
[data-theme="dark"] .help-tab-content li::before {
    background: #60a5fa;
}

/* --- PREMIUM BUTTON STYLES --- */
.btn-export-primary,
#import-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-export-primary:hover,
#import-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.btn-export-primary:active,
#import-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-export-secondary,
#settings-open-help-btn {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(4px);
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 500;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-export-secondary,
[data-theme="dark"] #settings-open-help-btn {
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    border-color: #334155;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-export-secondary:hover,
#settings-open-help-btn:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .btn-export-secondary:hover,
[data-theme="dark"] #settings-open-help-btn:hover {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.settings-danger-btn {
    background: rgba(254, 242, 242, 0.8);
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-weight: 600;
    padding: 12px;
    font-size: 13px;
    transition: all 0.25s ease;
    cursor: pointer;
    text-align: center;
}

[data-theme="dark"] .settings-danger-btn {
    background: rgba(127, 29, 29, 0.2);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

.settings-danger-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .settings-danger-btn:hover {
    background: rgba(127, 29, 29, 0.4);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

#reset-remote-btn {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

#reset-remote-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Disable text selection on interactive elements */
button,
.btn-export-primary,
.btn-export-secondary,
.help-tab-btn,
.spin-btn,
.mode-btn {
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    font-family: inherit;
}