/* ============================================================================
   MODERN DESIGN SYSTEM - Door Detection Pro
   ============================================================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================================
   CSS VARIABLES - Professional Color System
   ============================================================================ */
:root {
    /* Primary Colors - Vibrant Blue-Violet */
    --primary-50: hsl(250, 70%, 95%);
    --primary-100: hsl(250, 70%, 85%);
    --primary-200: hsl(250, 70%, 75%);
    --primary-300: hsl(250, 70%, 65%);
    --primary-400: hsl(250, 70%, 60%);
    --primary-500: hsl(250, 70%, 55%);
    --primary-600: hsl(250, 70%, 50%);
    --primary-700: hsl(250, 70%, 45%);
    --primary-800: hsl(250, 70%, 35%);

    /* Accent Colors */
    --accent-cyan: hsl(180, 80%, 50%);
    --accent-purple: hsl(280, 65%, 55%);
    --accent-pink: hsl(330, 75%, 60%);

    /* Semantic Colors */
    --success: hsl(150, 70%, 50%);
    --success-dark: hsl(150, 70%, 40%);
    --warning: hsl(40, 90%, 55%);
    --warning-dark: hsl(40, 90%, 45%);
    --danger: hsl(0, 75%, 60%);
    --danger-dark: hsl(0, 75%, 50%);
    --info: hsl(210, 80%, 55%);

    /* Neutral Colors - Dark Mode */
    --bg-primary: hsl(220, 25%, 10%);
    --bg-secondary: hsl(220, 20%, 15%);
    --bg-tertiary: hsl(220, 18%, 20%);
    --surface: hsl(220, 20%, 18%);
    --surface-elevated: hsl(220, 20%, 22%);

    /* Text Colors */
    --text-primary: hsl(0, 0%, 98%);
    --text-secondary: hsl(220, 10%, 70%);
    --text-tertiary: hsl(220, 10%, 50%);
    --text-disabled: hsl(220, 10%, 35%);

    /* Border Colors */
    --border-subtle: hsla(220, 20%, 35%, 0.3);
    --border-default: hsla(220, 20%, 45%, 0.4);
    --border-strong: hsla(220, 20%, 55%, 0.5);

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow-primary: 0 0 20px hsla(250, 70%, 60%, 0.3);
    --shadow-glow-accent: 0 0 20px hsla(180, 80%, 50%, 0.3);

    /* Glassmorphism */
    --glass-bg: hsla(220, 20%, 18%, 0.7);
    --glass-border: hsla(255, 255%, 255%, 0.1);
    --glass-blur: 20px;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-out;
    --transition-base: 250ms ease-out;
    --transition-slow: 350ms ease-out;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(at 0% 0%, hsla(250, 70%, 30%, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(280, 65%, 30%, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(180, 80%, 30%, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(330, 75%, 30%, 0.2) 0px, transparent 50%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated background mesh */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, transparent 0%, hsla(250, 70%, 20%, 0.1) 50%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {

    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    50% {
        opacity: 0.5;
        transform: translateY(-20px);
    }
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-3) var(--space-4);
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-600);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}


/* ============================================================================
   HEADER
   ============================================================================ */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-6);
    padding: var(--space-6) 0;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            var(--primary-500),
            var(--accent-cyan),
            var(--accent-purple),
            var(--primary-500));
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.header .container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header h1 {
    background: linear-gradient(135deg, var(--primary-400), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header h1 i {
    color: var(--primary-400);
    filter: drop-shadow(0 0 10px var(--primary-400));
}

.header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* ============================================================================
   CARDS - Glassmorphism Design
   ============================================================================ */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-5);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            var(--glass-border),
            transparent);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    border-color: var(--primary-600);
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-5);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card h2 i {
    color: var(--primary-400);
    font-size: 1.75rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.card-header h2 {
    margin: 0;
}

/* ============================================================================
   UPLOAD AREA
   ============================================================================ */
.upload-area {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    background: var(--surface);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            hsla(250, 70%, 50%, 0.05),
            hsla(180, 80%, 50%, 0.05));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-500);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-glow-primary);
    transform: scale(1.01);
}

.upload-area:hover::before,
.upload-area.drag-over::before {
    opacity: 1;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--space-5);
    color: var(--primary-400);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-area p {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: var(--space-3) 0;
    font-weight: 500;
}

.upload-hint {
    color: var(--text-tertiary) !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
}

/* ============================================================================
   FILE INFO
   ============================================================================ */
.file-info {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: linear-gradient(135deg,
            hsla(150, 70%, 50%, 0.1),
            hsla(150, 70%, 40%, 0.05));
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success);
    border: 1px solid hsla(150, 70%, 50%, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info h3 {
    color: var(--success);
    margin-bottom: var(--space-4);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.file-info p {
    margin: var(--space-2) 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.file-info strong {
    display: inline-block;
    width: 80px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================================
   BUTTONS - Modern Design with Ripple Effect
   ============================================================================ */
.btn {
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    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.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    font-size: 1.125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    margin-top: var(--space-4);
    width: 100%;
    padding: var(--space-4);
    font-size: 1.125rem;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark), var(--success));
    box-shadow: var(--shadow-lg), 0 0 20px hsla(150, 70%, 50%, 0.3);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-7);
    font-size: 1.25rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.highlight-group-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.highlight-group-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.highlight-group-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.highlight-group-btn.active:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}



/* ============================================================================
   FORM CONTROLS
   ============================================================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: var(--surface);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px hsla(250, 70%, 60%, 0.1);
    background: var(--surface-elevated);
}

.form-control:hover {
    border-color: var(--border-strong);
}

.form-group small {
    display: block;
    margin-top: var(--space-2);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */
.progress-section {
    animation: fadeIn 0.5s ease;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: var(--surface);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-subtle);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent,
            hsla(255, 255%, 255%, 0.05),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
            var(--primary-600),
            var(--accent-cyan),
            var(--primary-500));
    background-size: 200% 100%;
    animation: progressGradient 2s ease-in-out infinite;
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

@keyframes progressGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.2),
            transparent);
}

.progress-text {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.progress-text i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   SUMMARY CARDS
   ============================================================================ */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.summary-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--space-5);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-500), var(--accent-cyan));
}

.summary-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    border-color: var(--primary-500);
}

.summary-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
            hsla(250, 70%, 50%, 0.2),
            hsla(180, 80%, 50%, 0.2));
    border-radius: var(--radius-lg);
    color: var(--primary-400);
    flex-shrink: 0;
}

.summary-icon i {
    filter: drop-shadow(0 0 10px var(--primary-400));
}

.summary-content h3 {
    font-size: 2.25rem;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-1);
    font-weight: 800;
}

.summary-content p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ============================================================================
   RESULTS GRID
   ============================================================================ */
.results-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   DXF VIEWER
   ============================================================================ */
.viewer-card {
    padding: var(--space-5);
}

.viewer-controls {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.dxf-viewer {
    width: 100%;
    height: 600px;
    background: var(--bg-primary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.viewer-info {
    margin-top: var(--space-3);
    text-align: center;
    padding: var(--space-3);
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.viewer-info small {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================================
   DATA TABLE
   ============================================================================ */
.table-card {
    padding: var(--space-5);
}

.table-controls {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Table Filters - Custom Dropdowns */
.table-filters {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.filter-dropdown-wrapper {
    flex: 1;
    min-width: 180px;
    position: relative;
}

/* Dropdown Button (looks like normal dropdown) */
.filter-dropdown-button {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
    text-align: left;
}

.filter-dropdown-button:hover {
    border-color: var(--primary-500);
    background: var(--surface-elevated);
}

.filter-dropdown-button:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px hsla(250, 70%, 55%, 0.1);
}

.filter-dropdown-button.active {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px hsla(250, 70%, 55%, 0.1);
}

.filter-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-icon {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.filter-dropdown-button.active .filter-icon {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    animation: dropdownSlideIn 0.2s ease-out;
}

.filter-dropdown-panel.open {
    display: block;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Options */
.filter-options {
    padding: var(--space-2);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.filter-option:hover {
    background: var(--bg-tertiary);
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-500);
}

.filter-option label {
    flex: 1;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
}

.filter-option.all {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
}

.filter-option.all label {
    font-weight: 600;
}

/* Selected Chips */
.filter-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
    margin-top: var(--space-2);
    min-height: 0;
    /* Remove fixed min-height to avoid gap when empty */
}

/* Clear Filters Button */
.clear-filters-btn {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    margin-left: auto;
    /* Push to right */
}

.clear-filters-btn:hover {
    color: var(--danger);
    background: hsla(0, 75%, 60%, 0.1);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg,
            hsla(250, 70%, 55%, 0.15),
            hsla(250, 70%, 45%, 0.1));
    border: 1px solid hsla(250, 70%, 55%, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-400);
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    background: linear-gradient(135deg,
            hsla(250, 70%, 55%, 0.25),
            hsla(250, 70%, 45%, 0.15));
    border-color: var(--primary-500);
}

.filter-chip-remove {
    width: 14px;
    height: 14px;
    cursor: pointer;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    /* IMPEDIR que el icono se encoja */
}

.filter-chip-remove:hover {
    transform: scale(1.2);
}

/* Scrollbar styling for dropdown panel */
.filter-dropdown-panel::-webkit-scrollbar {
    width: 8px;
}

.filter-dropdown-panel::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.filter-dropdown-panel::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-md);
}

.filter-dropdown-panel::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-filters {
        flex-direction: column;
    }

    .filter-dropdown-wrapper {
        width: 100%;
    }
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
}

/* Ajustar anchos de columnas específicas con porcentajes (7 columnas) */
.data-table th:nth-child(1),
/* # (Número) */
.data-table td:nth-child(1) {
    width: 4%;
    text-align: center;
    font-weight: 600;
}

.data-table th:nth-child(2),
/* Ancho */
.data-table td:nth-child(2) {
    width: 8%;
    text-align: center;
    font-weight: 600;
}

.data-table th:nth-child(3),
/* Abatimiento */
.data-table td:nth-child(3) {
    width: 16%;
    text-align: center;
}

.data-table th:nth-child(4),
/* Confianza */
.data-table td:nth-child(4) {
    width: 12%;
    text-align: center;
}

.data-table th:nth-child(5),
/* Capa */
.data-table td:nth-child(5) {
    width: 33%;
    line-height: 1.3;
    font-size: 0.85rem;
}

.data-table th:nth-child(6),
/* Etiqueta */
.data-table td:nth-child(6) {
    width: 16%;
    text-align: center;
}

.data-table th:nth-child(7),
/* Ver */
.data-table td:nth-child(7) {
    width: 11%;
    text-align: center;
}

.data-table thead {
    background: var(--surface-elevated);
    border-bottom: 2px solid var(--border-default);
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th,
.data-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    word-wrap: break-word;
    vertical-align: middle;
}

.data-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--surface-elevated);
    cursor: pointer;
}

.data-table tbody tr.active-row {
    background: linear-gradient(135deg,
            hsla(250, 70%, 50%, 0.3),
            hsla(180, 80%, 50%, 0.2)) !important;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: inset 0 0 0 2px var(--primary-500);
}

.data-table tbody tr.active-row .confidence-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.highlight-group-btn {
    transition: all 0.2s ease;
}

.highlight-group-btn.active {
    background-color: var(--primary-100);
    border-color: var(--primary-500);
    color: var(--primary-600);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.highlight-group-btn:hover {
    transform: scale(1.1);
}

/* Botón Exportar Etiquetadas */
#exportLabeledBtn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    font-weight: 600;
    gap: 6px;
    transition: all 0.2s ease;
    position: relative;
}

#exportLabeledBtn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#exportLabeledBtn:disabled {
    opacity: 0.8;
    cursor: wait;
}

#exportLabeledBtn .export-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

.export-format-btn {
    transition: all 0.15s ease;
    border-radius: 6px !important;
}

.export-format-btn:hover {
    background: rgba(99, 102, 241, 0.15) !important;
}

#shareLabeledBtn {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    border: none;
    font-weight: 600;
    gap: 6px;
    transition: all 0.2s ease;
}

#shareLabeledBtn:hover {
    background: linear-gradient(135deg, #0284c7, #0891b2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

#shareLabeledBtn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Confidence badges */
.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.confidence-high {
    background: linear-gradient(135deg,
            hsla(150, 70%, 50%, 0.2),
            hsla(150, 70%, 40%, 0.1));
    color: var(--success);
    border-color: hsla(150, 70%, 50%, 0.3);
}

.confidence-medium {
    background: linear-gradient(135deg,
            hsla(40, 90%, 55%, 0.2),
            hsla(40, 90%, 45%, 0.1));
    color: var(--warning);
    border-color: hsla(40, 90%, 55%, 0.3);
}

.confidence-low {
    background: linear-gradient(135deg,
            hsla(0, 75%, 60%, 0.2),
            hsla(0, 75%, 50%, 0.1));
    color: var(--danger);
    border-color: hsla(0, 75%, 60%, 0.3);
}

/* ============================================================================
   SWING REVERSE TOGGLE BUTTON
   ============================================================================ */
.swing-reverse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1.5px solid hsla(220, 10%, 50%, 0.4);
    border-radius: var(--radius-sm, 4px);
    background: transparent;
    color: var(--text-tertiary, hsl(220, 10%, 50%));
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.swing-reverse-toggle:hover {
    border-color: hsl(30, 90%, 55%);
    color: hsl(30, 90%, 55%);
    background: hsla(30, 90%, 55%, 0.1);
}

.swing-reverse-toggle.active {
    background: linear-gradient(135deg, hsl(30, 90%, 55%), hsl(25, 85%, 50%));
    color: white;
    border-color: hsl(30, 90%, 55%);
    box-shadow: 0 0 6px hsla(30, 90%, 55%, 0.4);
}

.swing-reverse-toggle.active:hover {
    background: linear-gradient(135deg, hsl(30, 90%, 60%), hsl(25, 85%, 55%));
    box-shadow: 0 0 8px hsla(30, 90%, 55%, 0.6);
}

.swing-reverse-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   SWING SELECT (edición directa de abatimiento)
   ============================================================================ */
.swing-select {
    /* Wrapper que simula badge pero con flecha desplegable visible */
    background: linear-gradient(135deg, #2980B9, #3498DB);
    color: white;
    border: 1.5px solid hsla(210, 60%, 70%, 0.35);
    border-radius: 4px;
    /* padding-right deja espacio para la flecha nativa */
    padding: 2px 20px 2px 8px;
    font-size: 0.72rem;
    font-weight: bold;
    cursor: pointer;
    height: 24px;
    min-width: 54px;
    max-width: 72px;
    /* Mantener flecha nativa pero usando SVG propio para que sea blanca */
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(135deg, #2980B9, #3498DB),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white' fill-opacity='0.85'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 5px center;
    background-size: auto, 8px 5px;
    text-align: left;
    outline: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.swing-select:hover {
    background-image:
        linear-gradient(135deg, #2471A3, #2980B9),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 5px center;
    background-size: auto, 8px 5px;
    box-shadow: 0 0 5px hsla(210, 60%, 55%, 0.55);
    border-color: hsla(210, 60%, 70%, 0.6);
}

.swing-select:focus {
    box-shadow: 0 0 0 2px hsla(210, 60%, 60%, 0.5);
    border-color: hsla(210, 70%, 75%, 0.8);
}

.swing-select option {
    background: hsl(220, 15%, 18%);
    color: white;
    font-weight: bold;
}

.swing-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */
.action-buttons {
    text-align: center;
    padding: var(--space-6) 0;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
    text-align: center;
    padding: var(--space-7);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-8);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.results-section {
    animation: fadeIn 0.6s ease;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: var(--space-5);
}

.mb-20 {
    margin-bottom: var(--space-5);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-filters {
        flex-direction: column;
    }

    .table-filters .form-control {
        width: 100%;
    }

    .viewer-controls {
        justify-content: center;
    }
}

/* ============================================================================
   HISTORY LIST - MODERN REDESIGN
   ============================================================================ */

/* Header with actions */
.card-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
}

.history-header-actions {
    display: flex;
    gap: var(--space-2);
}

/* Search and Filters */
.history-controls {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px hsla(250, 70%, 55%, 0.15);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.clear-search-btn:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.history-filters {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.filter-btn {
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--primary-500);
}

.filter-btn.active {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-base);
}

.filter-btn.active .chevron-icon {
    transform: rotate(180deg);
}

.filter-panel {
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-md);
}

.filter-panel-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-panel-content label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.filter-panel-content label:hover {
    background: var(--surface);
}

.filter-panel-content input[type="radio"] {
    cursor: pointer;
    accent-color: var(--primary-500);
}

/* Results info */
.history-results-info {
    padding: var(--space-2) var(--space-3);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    font-size: 14px;
    color: var(--text-secondary);
}

/* History List/Table */
.history-list {
    display: block;
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.history-table thead th {
    padding: var(--space-3);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-default);
    white-space: nowrap;
}

.history-table tbody tr {
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.history-table tbody tr:hover {
    background: var(--surface-elevated);
}

.history-table tbody tr.selected {
    background: hsla(250, 70%, 55%, 0.1);
    border-left: 3px solid var(--primary-500);
}

.history-table tbody td {
    padding: var(--space-3);
    font-size: 14px;
    color: var(--text-primary);
}

.history-table-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-500);
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.file-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-600);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.file-name-text {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: hsla(150, 70%, 50%, 0.15);
    color: var(--success);
}

.badge-warning {
    background: hsla(40, 90%, 55%, 0.15);
    color: var(--warning);
}

.badge-error {
    background: hsla(0, 75%, 60%, 0.15);
    color: var(--danger);
}

.history-actions {
    display: flex;
    gap: var(--space-1);
}

.history-action-btn {
    padding: 6px 10px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    transition: all var(--transition-fast);
}

.history-action-btn:hover {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
}

.history-action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.history-action-btn i {
    width: 14px;
    height: 14px;
}

/* Dropdown menu for actions */
.action-dropdown {
    position: relative;
}

.action-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}

.action-dropdown.active .action-dropdown-menu {
    display: block;
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.action-dropdown-item:hover {
    background: var(--surface);
}

.action-dropdown-item.danger {
    color: var(--danger);
}

.action-dropdown-item i {
    width: 16px;
    height: 16px;
}

/* Date group headers */
.date-group {
    margin-top: var(--space-5);
    margin-bottom: var(--space-3);
}

.date-group:first-child {
    margin-top: 0;
}

.date-group-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    position: fixed;
    bottom: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    min-width: 400px;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.bulk-actions-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 500;
}

.bulk-actions-buttons {
    display: flex;
    gap: var(--space-2);
}

/* Loading Skeleton */
.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(
        90deg,
        var(--surface) 0%,
        var(--surface-elevated) 50%,
        var(--surface) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-tertiary);
}

.empty-state i {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-3);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 400px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 20px;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

.file-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.detail-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}



.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-8);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-default);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for history */
@media (max-width: 768px) {
    .card-header-with-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .history-controls {
        flex-direction: column;
    }

    .search-wrapper {
        width: 100%;
    }

    .history-filters {
        flex-wrap: wrap;
    }

    .history-table {
        display: block;
        overflow-x: auto;
    }

    .bulk-actions-bar {
        min-width: auto;
        width: 90%;
        flex-direction: column;
        gap: var(--space-3);
    }

    .file-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Legacy history item styles (for backward compatibility if needed) */
.history-item {
    background: var(--surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background: var(--surface-elevated);
    border-color: var(--primary-500);
    transform: translateX(4px);
}

.history-item-info {
    flex: 1;
}

.history-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.history-item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: var(--space-4);
}

.history-item-actions {
    display: flex;
    gap: var(--space-2);
}

.history-item-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.history-item-btn:hover {
    background: var(--primary-500);
    transform: scale(1.05);
}

/* ============================================================================
   ICON STYLING (Lucide Icons)
   ============================================================================ */
i[data-lucide] {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke-width: 2;
    vertical-align: middle;
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Active Row Style for Door Table */
/* Active Row Style for Door Table */
.active-row {
    background: linear-gradient(90deg,
            hsla(250, 70%, 60%, 0.15),
            hsla(180, 80%, 50%, 0.1));
    border-left: 3px solid var(--primary-500) !important;
}

/* No Results Row */
.no-results-row {
    text-align: center;
    padding: var(--space-6);
    color: var(--text-secondary);
    font-style: italic;
    background: var(--surface);
}

.no-results-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
}

/* Animations Removed as per request */
/* .door-highlight circle { animation: none; } */

/* Door label hover effect in SVG viewer */
.door-label-group {
    cursor: pointer;
}
.door-label-group:hover circle {
    stroke: #7c6ef0 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 3px rgba(124, 110, 240, 0.5));
}
.door-label-group:hover text {
    fill: #7c6ef0 !important;
}

/* ============================================================================
   CUSTOM CHECKBOX (Compensating for missing styles)
   ============================================================================ */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    color: var(--text-primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: var(--surface);
    border: 2px solid var(--border-default);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-500);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

.label-text {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

/* ============================================================================
   ANIMATIONS FOR HISTORY AND NOTIFICATIONS
   ============================================================================ */

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
