/* CSS Reset & Global Styles */

:root {
    --primary-color: #4a6fff;
    --sidebar-bg: #1a2233;
    --sidebar-active: #2a3446;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --hover-bg: #f8f9fa;
    --orange: #ff6b00;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --pastel-lavender: #d4c4fb;
    --pastel-lavender-light: #e6deff;
    --pastel-lavender-dark: #b19ddf;
    --pastel-teal: #a7e8e3;
    --pastel-teal-light: #c4f5f1;
    --pastel-teal-dark: #81cfc6;
    --pastel-pink: #ffcadb;
    --pastel-pink-light: #ffe2eb;
    --pastel-pink-dark: #f5a3c0;
    --queue-shadow: 0 8px 16px rgba(212, 196, 251, 0.2);
    --color-bg-primary: white;
    --color-bg-secondary: #f5f7fa;
    --color-text-primary: var(--text-dark);
    --color-border: var(--border-color);
    --color-primary: var(--primary-color);
    --color-secondary: #6c757d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    background-color: #f5f7fa;
    color: var(--text-dark);
}


/* Sidebar Styling */

.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    height: 100vh;
    position: fixed;
    width: 240px;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.logo {
    margin-bottom: 2rem;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    overflow: hidden;
}

.logo a {
    display: flex;
    text-decoration: none;
    cursor: pointer;
    height: 100%;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.logo-image {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 110px;
    object-fit: cover;
    object-position: center 25%;
    border-radius: 1px;
    transition: transform 0.3s ease, filter 0.3s ease;
    transform: scale(1.35);
}

.logo:hover .logo-image {
    transform: scale(1.25);
    filter: brightness(1.1);
}

.logo-model {
    color: white;
}

.logo-hub {
    color: var(--orange);
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.nav-links li.active {
    background-color: var(--sidebar-active);
    border-left: 4px solid var(--orange);
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

.nav-links a i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.nav-links li:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
}


/* Main Content Styling */

.content {
    grid-column: 2;
    padding: 2rem;
}

header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}


/* Toolbar Styling */

.toolbar {
    background: linear-gradient(135deg, #20243f, #2d3250);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: visible;
    height: 60px;
}


/* Laser and Molecules */

.laser-container {
    display: flex;
    align-items: center;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding-left: 1rem;
    pointer-events: none;
}

.laser-source {
    width: 18px;
    height: 18px;
    background: radial-gradient(circle, #00ffaa 0%, #00d48a 70%, transparent 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px #00ffaa, 0 0 20px rgba(0, 255, 170, 0.5);
    z-index: 2;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease;
}

.laser-source:hover {
    transform: scale(1.2);
}

.laser-source.green {
    background: radial-gradient(circle, #00ffaa 0%, #00d48a 70%, transparent 100%);
    box-shadow: 0 0 10px #00ffaa, 0 0 20px rgba(0, 255, 170, 0.5);
}

.laser-source.violet {
    background: radial-gradient(circle, #bd00ff 0%, #9d00d4 70%, transparent 100%);
    box-shadow: 0 0 10px #bd00ff, 0 0 20px rgba(189, 0, 255, 0.5);
}

.laser-source.red {
    background: radial-gradient(circle, #ff0055 0%, #d4004a 70%, transparent 100%);
    box-shadow: 0 0 10px #ff0055, 0 0 20px rgba(255, 0, 85, 0.5);
}

.laser-beam {
    height: 2px;
    background: linear-gradient(to right, #00ffaa, rgba(0, 255, 170, 0.1));
    position: absolute;
    top: 50%;
    left: 27px;
    right: 0;
    transform: translateY(-50%);
    box-shadow: 0 0 5px #00ffaa;
    animation: pulse 2s infinite;
    z-index: 1;
    overflow: hidden;
}

.laser-beam.green {
    background: linear-gradient(to right, #00ffaa, rgba(0, 255, 170, 0.1));
    box-shadow: 0 0 5px #00ffaa;
}

.laser-beam.violet {
    background: linear-gradient(to right, #bd00ff, rgba(189, 0, 255, 0.1));
    box-shadow: 0 0 5px #bd00ff;
}

.laser-beam.red {
    background: linear-gradient(to right, #ff0055, rgba(255, 0, 85, 0.1));
    box-shadow: 0 0 5px #ff0055;
}

.laser-beam::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 6px;
    background-image: radial-gradient(circle at center, rgba(0, 255, 170, 0.8) 0%, rgba(0, 255, 170, 0) 70%), radial-gradient(circle at center, rgba(0, 255, 170, 0.5) 0%, rgba(0, 255, 170, 0) 70%);
    background-size: 12px 12px, 24px 24px;
    background-position: 0 0, 6px 6px;
    animation: particleMove 3s linear infinite;
}

.laser-beam.green::before {
    background-image: radial-gradient(circle at center, rgba(0, 255, 170, 0.8) 0%, rgba(0, 255, 170, 0) 70%), radial-gradient(circle at center, rgba(0, 255, 170, 0.5) 0%, rgba(0, 255, 170, 0) 70%);
}

.laser-beam.violet::before {
    background-image: radial-gradient(circle at center, rgba(189, 0, 255, 0.8) 0%, rgba(189, 0, 255, 0) 70%), radial-gradient(circle at center, rgba(189, 0, 255, 0.5) 0%, rgba(189, 0, 255, 0) 70%);
}

.laser-beam.red::before {
    background-image: radial-gradient(circle at center, rgba(255, 0, 85, 0.8) 0%, rgba(255, 0, 85, 0) 70%), radial-gradient(circle at center, rgba(255, 0, 85, 0.5) 0%, rgba(255, 0, 85, 0) 70%);
}


/* Molecules */

.molecules-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.molecule {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.6;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.molecule.type-1 {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.molecule.type-2 {
    background: rgba(255, 217, 102, 0.7);
    box-shadow: 0 0 4px rgba(255, 217, 102, 0.5);
}

.molecule.type-3 {
    background: rgba(130, 204, 221, 0.7);
    box-shadow: 0 0 4px rgba(130, 204, 221, 0.5);
}

.molecule.excited {
    opacity: 0.9;
    transform: scale(1.3);
    z-index: 3;
}

.molecule.green.excited {
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.8);
}

.molecule.violet.excited {
    box-shadow: 0 0 8px rgba(189, 0, 255, 0.8);
}

.molecule.red.excited {
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.8);
}


/* Molecule pairs (to create compound-like molecules) */

.molecule.compound::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: inherit;
    box-shadow: inherit;
    top: -5px;
    left: 2px;
}

.molecule.compound::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: inherit;
    box-shadow: inherit;
    top: 8px;
    left: -4px;
}

.info-value.active-dataset.green {
    color: #00ffaa;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.5);
}

.info-value.active-dataset.violet {
    color: #bd00ff;
    text-shadow: 0 0 5px rgba(189, 0, 255, 0.5);
}

.info-value.active-dataset.red {
    color: #ff0055;
    text-shadow: 0 0 5px rgba(255, 0, 85, 0.5);
}


/* Apply same styles to current aipack/train displays */

#current-aipack-display.active-dataset.green,
#current-train-display.active-dataset.green {
    color: #00ffaa;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.5);
}

#current-aipack-display.active-dataset.violet,
#current-train-display.active-dataset.violet {
    color: #bd00ff;
    text-shadow: 0 0 5px rgba(189, 0, 255, 0.5);
}

#current-aipack-display.active-dataset.red,
#current-train-display.active-dataset.red {
    color: #ff0055;
    text-shadow: 0 0 5px rgba(255, 0, 85, 0.5);
}

.info-badge.green {
    background: linear-gradient(135deg, #00d48a, #00a876);
    box-shadow: 0 2px 4px rgba(0, 212, 138, 0.3);
}

.info-badge.violet {
    background: linear-gradient(135deg, #9d00d4, #7600a8);
    box-shadow: 0 2px 4px rgba(157, 0, 212, 0.3);
}

.info-badge.red {
    background: linear-gradient(135deg, #d4004a, #a80039);
    box-shadow: 0 2px 4px rgba(212, 0, 74, 0.3);
}

@keyframes particleMove {
    0% {
        background-position: 0 0, 6px 6px;
    }
    100% {
        background-position: 100px 0, 106px 6px;
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
        height: 2px;
    }
    50% {
        opacity: 1;
        height: 3px;
    }
    100% {
        opacity: 0.6;
        height: 2px;
    }
}

.info-items {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
    margin-left: auto;
}

.info-item {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    justify-content: center;
    height: 60px;
    box-sizing: border-box;
}

.info-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.aipack-dropdown-container {
    height: auto;
    min-height: 60px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.info-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
    display: block;
    height: 1rem;
    line-height: 1rem;
}

.info-value {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 500;
    height: 1.2rem;
    line-height: 1.2rem;
}

#current-aipack-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    min-height: 1.2rem;
    line-height: 1.1rem;
}

#current-aipack-display .selected-version-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1rem;
    text-shadow: none;
}

.info-value.active-dataset {
    color: #00ffaa;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.5);
}


/* Device ID input styling */

.device-id-input {
    background-color: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 0;
    margin: 0;
    width: 60px;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 500;
    height: 1.2rem;
    line-height: 1.2rem;
    box-sizing: border-box;
}

.device-id-input:focus {
    outline: none;
    background-color: transparent;
    box-shadow: none;
}

.device-id-input.invalid {
    color: #ff0055;
    text-shadow: 0 0 5px rgba(255, 0, 85, 0.5);
}

.device-id-input.green {
    color: #00ffaa;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.5);
}

.device-id-input.violet {
    color: #bd00ff;
    text-shadow: 0 0 5px rgba(189, 0, 255, 0.5);
}

.device-id-input.red {
    color: #ff0055;
    text-shadow: 0 0 5px rgba(255, 0, 85, 0.5);
}


/* Prevent hover highlighting for device ID container */

.info-item[title="Device ID for API requests"]:hover {
    background-color: transparent;
}


/* Ensure device ID info-item maintains same layout as others */

.info-item[title="Device ID for API requests"] {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-badge {
    background: linear-gradient(135deg, #00d48a, #00a876);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 4px rgba(0, 212, 138, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.info-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 212, 138, 0.4);
}

.info-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 212, 138, 0.3);
}

.info-badge i {
    margin-right: 0;
    font-size: 0.75rem;
}


/* Card Styling */

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}


/* Header Controls Styling */

.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.forced-refresh-btn {
    min-width: 160px;
    /* Prevent layout shift */
    margin-left: 1rem;
}


/* Lab Mode Toggle Styling */

.lab-mode-toggle {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #2a3446, #384766);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.lab-mode-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.lab-mode-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lab-mode-checkbox:checked {
    background-color: var(--orange);
}

.lab-mode-checkbox:checked::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lab-mode-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.35rem 0.65rem;
    background: #f7f9fc;
    border: 1px solid #dce3ee;
    border-radius: 6px;
    color: #415066;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.language-option {
    min-width: 22px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #7b8798;
    user-select: none;
}

.language-option.active {
    color: #243044;
}

.language-switch {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 22px;
    cursor: pointer;
}

.language-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.language-slider {
    position: absolute;
    inset: 0;
    background: #c8d2df;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.language-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.language-checkbox:checked + .language-slider {
    background: #3a7bd5;
}

.language-checkbox:checked + .language-slider::before {
    transform: translateX(20px);
}

.language-checkbox:focus-visible + .language-slider {
    outline: 2px solid #3a7bd5;
    outline-offset: 2px;
}


/* Lab Mode Features */

.lab-mode-feature {
    position: relative;
}

.lab-mode-feature::before {
    content: "🧪";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.lab-mode-feature:hover::before {
    opacity: 1;
}


/* Notification styles */

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    max-width: 80%;
    text-align: center;
    font-weight: 500;
    pointer-events: none;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}


/* Button Styling */

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

button:hover {
    background-color: #3a5be0;
}

button i {
    margin-right: 0.5rem;
}

.refresh-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.refresh-btn:hover {
    background-color: rgba(74, 111, 255, 0.1);
}

.forced-refresh-btn {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
    margin-left: 8px;
    padding: 0.6rem 1rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.forced-refresh-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.forced-refresh-btn i {
    color: white;
}


/* Table Styling */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table th,
table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 600;
    color: var(--text-dark);
    background-color: #f9fafb;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background-color: var(--hover-bg);
}


/* Current tag indicator and Set button */

.current-tag-indicator {
    font-size: 1.1rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.set-tag-btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.set-tag-btn:hover:not([disabled]) {
    background-color: #3a5be0;
}

.set-tag-btn[disabled] {
    background-color: #e0e0e0;
    color: #888888;
    cursor: not-allowed;
}


/* Loading and Error States */

#loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    display: none;
}

.error-message {
    color: #dc3545;
    text-align: center;
    padding: 1rem;
    display: none;
}

.success-message {
    color: #28a745;
    background-color: #f8fff9;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    text-align: center;
    padding: 0.75rem;
    margin: 1rem 0;
    display: none;
}


/* Page Switching */

.page {
    display: none;
}

.page.active {
    display: block;
}


/* Fix for AIPack Config page */

#aipack-config-page {
    display: none;
}

#aipack-config-page.active {
    display: block;
}

.placeholder-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.placeholder-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}


/* Responsive Adjustments */

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .content {
        grid-column: 1;
    }
    .logo {
        height: 45px;
    }
    .logo-image {
        max-height: 110px;
        transform: scale(1.15);
    }
    header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .toolbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    .info-items {
        margin-top: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .laser-container {
        justify-content: center;
    }
    .laser-source {
        left: 0;
    }
    .laser-beam {
        left: 20px;
        width: calc(100% - 40px);
        right: 20px;
    }
}

@media (max-width: 576px) {
    .info-items {
        flex-direction: column;
        gap: 0.75rem;
    }
    .info-item {
        width: 100%;
        min-width: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .info-label {
        margin-bottom: 0;
    }
}


/* Dataset Upload Form Styling */

.mt-4 {
    margin-top: 1.5rem;
}

.upload-form {
    width: 100%;
}

.upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.upload-group {
    flex: 1;
    min-width: 300px;
}

.file-upload-wrapper {
    width: 100%;
    position: relative;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 255, 0.05);
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    padding: 1rem;
    transition: var(--transition);
}

.file-upload-label i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.version-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1;
    min-width: 300px;
}

.version-group {
    flex: 1;
    min-width: 80px;
}

.version-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.version-group input,
.version-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.version-group input:focus,
.version-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 255, 0.2);
}

.tag-preview {
    background-color: #f5f7fa;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.tag-preview code {
    background-color: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    color: var(--primary-color);
    font-family: monospace;
    font-weight: 600;
}

.upload-actions {
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.primary-btn i {
    margin-right: 0.5rem;
}

.primary-btn:hover {
    background-color: #3a5be0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.upload-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    display: none;
}

.upload-status.success {
    display: block;
    background-color: #e6f7e6;
    color: #28a745;
    border: 1px solid #c3e6cb;
}

.upload-status.error {
    display: block;
    background-color: #f8eaea;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

.upload-status.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: var(--text-muted);
}

.upload-status.loading::before {
    content: "";
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

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


/* Add animation for excited molecules */

@keyframes vibrate {
    0% {
        transform: scale(1.3) rotate(0deg);
    }
    25% {
        transform: scale(1.3) rotate(5deg);
    }
    50% {
        transform: scale(1.4) rotate(0deg);
    }
    75% {
        transform: scale(1.3) rotate(-5deg);
    }
    100% {
        transform: scale(1.3) rotate(0deg);
    }
}

.molecule.excited {
    animation: vibrate 0.3s infinite;
}


/* System Monitoring Styles */

.system-monitor-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 15px;
    position: relative;
}

.system-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: default;
    transition: transform 0.2s ease;
    user-select: none;
    position: relative;
    z-index: 10;
}

.system-indicator:hover {
    transform: translateY(-1px);
}

.system-indicator i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.system-value {
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.system-value.normal {
    opacity: 0.85;
}

.system-value.warning {
    opacity: 0.95;
}

.system-value.critical {
    opacity: 1;
    animation: pulse 1.5s infinite;
}

.system-value.green {
    color: #00ffaa;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.5);
}

.system-value.violet {
    color: #bd00ff;
    text-shadow: 0 0 5px rgba(189, 0, 255, 0.5);
}

.system-value.red {
    color: #ff0033;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}


/* Draggable elements styling */

.draggable {
    cursor: grab;
}

.dragging {
    cursor: grabbing !important;
    opacity: 0.8;
    z-index: 100 !important;
}


/* Double-click hint on hover */

.draggable::after {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
    bottom: -5px;
    left: -5px;
    border: 1px dashed rgba(255, 255, 255, 0);
    border-radius: 4px;
    transition: border-color 0.2s ease;
    pointer-events: none;
}

.draggable:hover::after {
    border-color: rgba(255, 255, 255, 0.3);
}


/* Make system indicators responsive */

@media (max-width: 768px) {
    .system-monitor-container {
        gap: 10px;
        margin-right: 10px;
    }
    .system-indicator {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .system-monitor-container {
        display: none;
        /* Hide on very small screens */
    }
}


/* Dropdown styles */

.dropdown-container {
    position: relative;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 8px 0;
    margin-top: 8px;
    transform-origin: top left;
}

.dropdown-container.open .dropdown-content {
    display: block;
}

.dropdown-loading {
    padding: 12px 16px;
    color: var(--text-muted);
    font-style: italic;
}

.dropdown-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

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

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

.dropdown-item.active.green {
    background-color: rgba(0, 255, 170, 0.1);
    font-weight: 600;
}

.dropdown-item.active.violet {
    background-color: rgba(189, 0, 255, 0.1);
    font-weight: 600;
}

.dropdown-item.active.red {
    background-color: rgba(255, 0, 85, 0.1);
    font-weight: 600;
}

.dropdown-item .version-tag {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-left: 8px;
}

.dropdown-item .version-date {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-left: 8px;
}

.dropdown-item .version-name {
    font-weight: 500;
}

.dropdown-item.active.green .version-name,
.dropdown-item.active.green .version-tag,
.dropdown-item.active.green .version-date {
    color: #00a876;
}

.dropdown-item.active.violet .version-name,
.dropdown-item.active.violet .version-tag,
.dropdown-item.active.violet .version-date {
    color: #9d00d4;
}

.dropdown-item.active.red .version-name,
.dropdown-item.active.red .version-tag,
.dropdown-item.active.red .version-date {
    color: #d4004a;
}


/* Override toolbar overflow to allow dropdown to expand */

.toolbar {
    overflow: visible;
}

.info-items {
    position: relative;
    z-index: 10;
}


/* Highlight the clickable info items */

.dropdown-container .info-value {
    position: relative;
    padding-right: 16px;
}

.dropdown-container .info-value::after {
    content: "\f0d7";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    opacity: 0.7;
}

.dropdown-container:hover .info-value {
    color: var(--primary-color);
}


/* Sync progress indicator */

.sync-progress {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    transition: opacity 0.5s ease;
    max-width: 80%;
    text-align: center;
}

.sync-progress span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sync-progress span::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

.sync-progress span.success::before {
    animation: none;
    border: none;
    content: "✅";
    width: auto;
    height: auto;
}

.sync-progress span.error::before {
    animation: none;
    border: none;
    content: "❌";
    width: auto;
    height: auto;
}


/* Train Queue Page Styling */

.queue-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--queue-shadow);
    background: #ffffff;
    margin-bottom: 2rem;
    border: 1px solid var(--pastel-lavender-light);
}

.train-queue-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.queue-control-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* Queue Button Styling */

.queue-btn {
    background: linear-gradient(135deg, var(--pastel-lavender-light), var(--pastel-lavender));
    color: #5a4b8c;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(212, 196, 251, 0.3);
}

.queue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(212, 196, 251, 0.4);
    background: linear-gradient(135deg, var(--pastel-lavender), var(--pastel-lavender-dark));
}

.queue-btn.add-all-train-btn {
    background: linear-gradient(135deg, var(--pastel-teal-light), var(--pastel-teal));
    color: #2a7a75;
    box-shadow: 0 4px 8px rgba(167, 232, 227, 0.3);
}

.queue-btn.add-all-train-btn:hover {
    background: linear-gradient(135deg, var(--pastel-teal), var(--pastel-teal-dark));
    box-shadow: 0 6px 12px rgba(167, 232, 227, 0.4);
}

.queue-btn.add-all-evaluate-btn {
    background: linear-gradient(135deg, var(--pastel-pink-light), var(--pastel-pink));
    color: #bb5a76;
    box-shadow: 0 4px 8px rgba(255, 202, 219, 0.3);
}

.queue-btn.add-all-evaluate-btn:hover {
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-pink-dark));
    box-shadow: 0 6px 12px rgba(255, 202, 219, 0.4);
}

.queue-btn.clear-queue-btn {
    background: #f0f0f0;
    color: #666;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.queue-btn.clear-queue-btn:hover {
    background: #e6e6e6;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.queue-btn.run-queue-btn {
    background: linear-gradient(135deg, #a9efff, #61d0ff);
    color: #0a5e82;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 10px 24px;
    box-shadow: 0 4px 12px rgba(97, 208, 255, 0.4);
}

.queue-btn.run-queue-btn:hover {
    background: linear-gradient(135deg, #61d0ff, #3abbff);
    box-shadow: 0 6px 16px rgba(97, 208, 255, 0.5);
}

.queue-btn.stop-queue-btn {
    background: linear-gradient(135deg, var(--pastel-pink-light), var(--pastel-pink));
    color: #bb5a76;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 10px 24px;
    box-shadow: 0 4px 8px rgba(255, 202, 219, 0.3);
}

.queue-btn.stop-queue-btn:hover {
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-pink-dark));
    box-shadow: 0 6px 12px rgba(255, 202, 219, 0.4);
}


/* Kill All Button Styling */

.queue-btn.kill-all-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff4949);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 10px 24px;
    box-shadow: 0 4px 12px rgba(255, 75, 75, 0.4);
}

.queue-btn.kill-all-btn:hover {
    background: linear-gradient(135deg, #ff4949, #ff2d2d);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.5);
    transform: translateY(-2px);
}


/* Queue Table Styling */

.queue-table-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(212, 196, 251, 0.15);
    border: 1px solid var(--pastel-lavender-light);
}

.queue-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.queue-table th {
    background: linear-gradient(135deg, var(--pastel-lavender-light), var(--pastel-lavender));
    color: #5a4b8c;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.queue-table th:first-child {
    border-top-left-radius: 12px;
}

.queue-table th:last-child {
    border-top-right-radius: 12px;
}

.queue-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.queue-table tr:last-child td {
    border-bottom: none;
}

.queue-table tr:nth-child(even) {
    background-color: rgba(212, 196, 251, 0.05);
}

.queue-table tr:hover td {
    background-color: rgba(212, 196, 251, 0.1);
}


/* Status Indicators */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.85rem;
}

.queue-status-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.queue-status-cell .train-log-btn,
.queue-status-cell .train-ai-btn {
    white-space: nowrap;
}

.status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-queued {
    background-color: var(--pastel-lavender-light);
    color: #5a4b8c;
}

.status-queued .dot {
    background-color: var(--pastel-lavender-dark);
}

.status-running {
    background-color: var(--pastel-teal-light);
    color: #2a7a75;
}

.status-running .dot {
    background-color: var(--pastel-teal-dark);
}

.status-completed {
    background-color: rgba(167, 232, 167, 0.2);
    color: #2a7a2a;
}

.status-completed .dot {
    background-color: #6fc86f;
}

.status-failed {
    background-color: rgba(255, 202, 202, 0.2);
    color: #bb5a5a;
}

.status-failed .dot {
    background-color: #f5a3a3;
}


/* Run Controls */

.run-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.worker-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.worker-selection label {
    color: #5a4b8c;
    font-weight: 600;
    font-size: 0.9rem;
}

.worker-count-select {
    border: none;
    background: transparent;
    color: #5a4b8c;
    font-weight: 600;
    padding: 4px;
    outline: none;
}


/* Modal Styling */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(212, 196, 251, 0.4);
    animation: modalFadeIn 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--pastel-lavender-light), var(--pastel-lavender));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--pastel-lavender);
}

.modal-header h3 {
    color: #5a4b8c;
    margin: 0;
    font-weight: 600;
}

.close-modal {
    font-size: 1.5rem;
    color: #5a4b8c;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #3a305c;
}

.modal-body {
    padding: 20px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Form Elements */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #5a4b8c;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pastel-lavender-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--pastel-lavender);
    box-shadow: 0 0 0 3px rgba(212, 196, 251, 0.3);
}

.task-advanced-options {
    background-color: rgba(212, 196, 251, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--pastel-lavender-light);
}

.task-advanced-options h4 {
    color: #5a4b8c;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}


/* Status Update Animation */

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

.queue-row-new {
    animation: fadeIn 0.5s ease;
}

.loading-indicator {
    text-align: center;
    color: var(--pastel-lavender-dark);
    font-weight: 500;
    padding: 20px;
    display: none;
}


/* AI Decorative Elements */

.queue-card::before {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d4c4fb" opacity="0.15"><path d="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8Z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.5;
    pointer-events: none;
}


/* Responsive Adjustments */

@media (max-width: 768px) {
    .train-queue-controls {
        flex-direction: column;
        gap: 12px;
    }
    .queue-control-group {
        justify-content: center;
    }
    .run-controls {
        margin-top: 10px;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .queue-table th,
    .queue-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    .status-indicator {
        padding: 3px 8px;
        font-size: 0.8rem;
    }
}


/* Add Task Modal Status Indicators */

.loading-text {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
    animation: blink 1s infinite;
}

.error-text {
    color: #e74c3c;
    font-size: 0.9em;
    font-style: italic;
}

.success-text {
    color: #2ecc71;
    font-size: 0.9em;
    font-style: italic;
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}


/* Styles for Mode Labels in Queue Table - Revised for Status Style */

.mode-label {
    display: inline-flex;
    /* Match status indicator */
    align-items: center;
    gap: 6px;
    /* Match status indicator */
    padding: 4px 10px;
    /* Match status indicator */
    border-radius: 20px;
    /* Match status indicator */
    font-size: 0.85rem;
    /* Match status indicator */
    font-weight: 500;
    /* Match status indicator */
    text-transform: capitalize;
    /* Removed text-shadow and box-shadow to match status style */
}


/* Use colors similar to status, but distinct */

.mode-train {
    background-color: rgba(255, 202, 219, 0.3);
    /* Lighter pastel pink background */
    color: #bb5a76;
    /* Darker pink text (similar to failed status) */
}

.mode-evaluate {
    background-color: rgba(212, 196, 251, 0.3);
    /* Lighter pastel lavender background */
    color: #5a4b8c;
    /* Darker lavender text (similar to queued status) */
}


/* Styles for Pressure Labels in Queue Table */

.pressure-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
    color: #333;
    /* Darker text for light backgrounds */
    text-align: center;
    min-width: 50px;
    /* Ensure consistent width */
}

.pressure-50 {
    background-color: #e0f7fa;
    /* Light Cyan */
    color: #00796b;
    border: 1px solid #b2ebf2;
}

.pressure-100 {
    background-color: #c8e6c9;
    /* Light Green */
    color: #388e3c;
    border: 1px solid #a5d6a7;
}

.pressure-200 {
    background-color: #bbdefb;
    /* Light Blue */
    color: #1976d2;
    border: 1px solid #90caf9;
}


/* Styles for Species Labels (Grouped by Laser) */

.species-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    /* Slightly bolder for species name */
    text-align: center;
    min-width: 55px;
    /* Ensure consistent width */
    border: 1px solid transparent;
    /* Base border */
}


/* 1532nm Laser Group (C2H2) */

.species-laser-1532 {
    background-color: #e0f2f7;
    /* Light Sky Blue */
    color: #0277bd;
    /* Darker Blue */
    border-color: #b3e5fc;
}


/* 1580nm Laser Group (CO, CO2) */

.species-laser-1580 {
    background-color: #fff9c4;
    /* Light Yellow */
    color: #f57f17;
    /* Dark Yellow/Orange */
    border-color: #fff59d;
}


/* 1680nm Laser Group (CH4, C2H4, C2H6) */

.species-laser-1680 {
    background-color: #dcedc8;
    /* Light Green */
    color: #558b2f;
    /* Dark Green */
    border-color: #c5e1a5;
}


/* Add style for species icon */

.species-icon {
    width: 1em;
    /* Size relative to font size */
    height: 1em;
    vertical-align: middle;
    margin-right: 4px;
    /* Space between icon and text */
}


/* Styles for Score/RMSE Value Ranges */

.value-range-cell {
    /* Base class for potential common styles */
    text-align: right;
    /* Align numbers to the right */
    padding-right: 15px !important;
    /* Ensure padding for alignment */
    font-weight: 500;
}

.metric-very-green {
    background-color: rgba(102, 204, 102, 0.2);
    /* Light green background */
    color: #006400;
    /* Dark green text */
}

.metric-light-green {
    background-color: rgba(144, 238, 144, 0.2);
    color: #228B22;
}

.metric-light-blue {
    background-color: rgba(173, 216, 230, 0.2);
    color: #00008B;
}

.metric-blue {
    background-color: rgba(135, 206, 250, 0.3);
    color: #1976d2;
}

.metric-orange {
    background-color: rgba(255, 165, 0, 0.2);
    color: #E65100;
}

.metric-red {
    background-color: rgba(255, 99, 71, 0.2);
    /* Light red background */
    color: #B71C1C;
    /* Dark red text */
}


/* AIPack Configuration Styles */

.version-display {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--pastel-lavender-light), var(--pastel-lavender));
    border-radius: 12px;
    font-weight: 600;
    color: #5a4b8c;
    box-shadow: 0 4px 8px rgba(212, 196, 251, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-display::before {
    content: "💾";
    font-size: 1.2rem;
}

.config-version-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(167, 232, 227, 0.2), rgba(167, 232, 227, 0.4));
    border-radius: 12px;
    border: 1px solid var(--pastel-teal-light);
    box-shadow: 0 4px 8px rgba(167, 232, 227, 0.2);
}

.version-select-container {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    background-color: var(--pastel-lavender-light);
    padding: 0.75rem;
    border-radius: 8px;
}

.version-select-container label {
    background-color: var(--pastel-pink-light);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.version-select-container label:hover {
    background-color: var(--pastel-pink);
}

.version-select-container input[type="radio"] {
    accent-color: var(--pastel-teal);
}

.version-label {
    font-weight: 600;
    color: var(--text-dark);
}

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

.version-select {
    min-width: 300px;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--pastel-teal);
    background-color: white;
    color: #2a7a75;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(167, 232, 227, 0.3);
    transition: all 0.2s ease;
}

.version-select:focus {
    outline: none;
    border-color: var(--pastel-teal-dark);
    box-shadow: 0 0 0 3px rgba(167, 232, 227, 0.5);
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-section {
    background-color: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 6px 12px rgba(212, 196, 251, 0.15);
    border: 1px solid var(--pastel-lavender-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.config-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(212, 196, 251, 0.25);
}

.config-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #5a4b8c;
    border-bottom: 2px solid var(--pastel-lavender-light);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Add emojis to section headers */

.config-section h3:nth-of-type(1)::before {
    content: "📊";
}

.config-section h3:nth-of-type(2)::before {
    content: "🔍";
}

.config-section h3:nth-of-type(3)::before {
    content: "🔢";
}

.config-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.config-group:hover {
    background-color: rgba(212, 196, 251, 0.05);
}

.config-group label {
    flex: 0 0 220px;
    margin-right: 15px;
    color: #5a4b8c;
    font-weight: 500;
}

.config-group input[type="number"] {
    flex: 1;
    max-width: 150px;
    padding: 10px 15px;
    border: 1px solid var(--pastel-lavender-light);
    border-radius: 10px;
    font-size: 1rem;
    color: #5a4b8c;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(212, 196, 251, 0.1);
}

.config-group input[type="number"]:focus {
    outline: none;
    border-color: var(--pastel-lavender);
    box-shadow: 0 0 0 3px rgba(212, 196, 251, 0.3);
}

.device-id-group {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 202, 219, 0.1), rgba(255, 202, 219, 0.3));
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--pastel-pink-light);
}

.info-tooltip {
    margin-left: 8px;
    color: #bb5a76;
    cursor: help;
    transition: transform 0.2s ease;
}

.info-tooltip:hover {
    transform: scale(1.2);
}

.config-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.primary-btn,
.secondary-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.primary-btn {
    background: linear-gradient(135deg, var(--pastel-teal-light), var(--pastel-teal));
    color: #2a7a75;
    box-shadow: 0 4px 8px rgba(167, 232, 227, 0.4);
}

.secondary-btn {
    background: linear-gradient(135deg, var(--pastel-pink-light), var(--pastel-pink));
    color: #bb5a76;
    box-shadow: 0 4px 8px rgba(255, 202, 219, 0.4);
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.primary-btn:hover {
    background: linear-gradient(135deg, var(--pastel-teal), var(--pastel-teal-dark));
    box-shadow: 0 6px 12px rgba(167, 232, 227, 0.5);
}

.secondary-btn:hover {
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-pink-dark));
    box-shadow: 0 6px 12px rgba(255, 202, 219, 0.5);
}

.status-message {
    margin-top: 20px;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.status-info {
    background-color: rgba(173, 216, 230, 0.2);
    color: #0d47a1;
    border: 1px solid rgba(173, 216, 230, 0.5);
}

.status-info::before {
    content: "ℹ️";
}

.status-success {
    background-color: rgba(167, 232, 167, 0.2);
    color: #2a7a2a;
    border: 1px solid rgba(167, 232, 167, 0.5);
}

.status-success::before {
    content: "✅";
}

.status-error {
    background-color: rgba(255, 202, 202, 0.2);
    color: #bb5a5a;
    border: 1px solid rgba(255, 202, 202, 0.5);
}

.status-error::before {
    content: "❌";
}

input[readonly] {
    background-color: #f8f8f8;
    cursor: not-allowed;
}


/* Parent rows styling */

.model-row {
    background-color: var(--pastel-teal-light);
    cursor: pointer;
    transition: var(--transition);
}

.model-row:hover {
    background-color: var(--pastel-teal);
}


/* Versions detail row background */

.model-versions-row td {
    background-color: var(--pastel-lavender-light);
}


/* Disabled state for primary buttons */

.primary-btn:disabled,
.primary-btn[disabled] {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.primary-btn:disabled:hover,
.primary-btn[disabled]:hover {
    background-color: #cccccc;
    box-shadow: none;
    transform: none;
}


/* Add some spacing for the new upload form */

.card.mt-4 {
    margin-top: 1.5rem;
}


/* Dataset table grouping styles */

tr.group-item>td {
    background-color: rgba(212, 196, 251, 0.12);
    border-left: 3px solid var(--pastel-lavender);
}

.toggle-icon {
    cursor: pointer;
    display: inline-block;
    width: 1em;
    text-align: center;
    margin-right: 8px;
    font-weight: bold;
    transition: transform 0.1s ease-in-out;
    color: #6d5aa6;
}

tr[data-group].expanded .toggle-icon {
    transform: rotate(90deg);
}

.toggle-spacer {
    display: inline-block;
    width: 1em;
    margin-right: 8px;
}

td .current-tag-indicator {
    margin-right: 5px;
}

tr.group-item td:first-child {
    padding-left: 25px;
}


/* Indicator for active run near refresh button */

#run-active-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: transparent;
    border-radius: 50%;
    margin-left: 8px;
    transition: background-color 0.3s ease;
}

#run-active-indicator.active {
    background-color: var(--primary-color);
}


/* Dataset table pastel styling */

.dataset-table thead th {
    background: linear-gradient(135deg, var(--pastel-lavender-light), var(--pastel-lavender));
    color: #5a4b8c;
}

.dataset-table tbody tr:hover td {
    background-color: rgba(212, 196, 251, 0.08);
}

.dataset-tag {
    font-weight: 600;
    color: #5a4b8c;
}

.dataset-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}


/* Cute pill buttons */

.btn-pill {
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(212, 196, 251, 0.3);
}

.btn-pill:active {
    transform: translateY(0);
}

.btn-violet {
    background: linear-gradient(135deg, var(--pastel-lavender-light), var(--pastel-lavender));
    color: #5a4b8c;
}

.btn-violet:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(212, 196, 251, 0.45);
}

.btn-muted {
    background: #f0eef8;
    color: #6d5aa6;
}

.btn-muted:hover {
    transform: translateY(-2px);
}

.btn-icon {
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f1ff;
    color: #6d5aa6;
    border: 1px solid var(--pastel-lavender-light);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-icon:hover {
    background: #ece6ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(212, 196, 251, 0.3);
}

.set-tag-btn {
    background: linear-gradient(135deg, var(--pastel-lavender), var(--pastel-lavender-dark));
    color: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    border: none;
}

.set-tag-btn[disabled] {
    background: #ddd8f5;
    color: #8f87b6;
}


/* Details chip and popover */

.details-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4f1ff;
    color: #6d5aa6;
    border: 1px solid var(--pastel-lavender-light);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    margin-right: 8px;
}

.details-chip:hover {
    background: #ece6ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(212, 196, 251, 0.3);
}

.details-popover {
    position: absolute;
    z-index: 1000;
    min-width: 260px;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid var(--pastel-lavender-light);
    box-shadow: 0 10px 24px rgba(212, 196, 251, 0.4);
    border-radius: 12px;
    padding: 10px 12px;
    color: #5a4b8c;
}

.details-popover::after {
    content: "";
    position: absolute;
    top: -8px;
    left: 18px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;
}

.details-popover h4 {
    margin: 4px 0 6px 0;
    font-size: 0.9rem;
    color: #5a4b8c;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.details-card {
    background: linear-gradient(135deg, var(--pastel-lavender-light), #fff);
    border: 1px solid var(--pastel-lavender-light);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
}

.details-metric {
    display: block;
    font-size: 0.75rem;
    color: #7c6ba4;
}

.details-value {
    font-weight: 700;
    color: #5a4b8c;
}


/* Model Details Table Styling */

.model-details-container {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 202, 219, 0.1), rgba(212, 196, 251, 0.1));
    border-radius: 12px;
    margin: 0.5rem 0;
    box-shadow: inset 0 2px 8px rgba(212, 196, 251, 0.15);
}

.model-details-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(212, 196, 251, 0.2);
}

.model-details-table thead th {
    background: linear-gradient(135deg, var(--pastel-lavender), var(--pastel-pink));
    color: #5a4b7c;
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(212, 196, 251, 0.3);
}

.model-details-table thead th:first-child {
    border-top-left-radius: 8px;
}

.model-details-table thead th:last-child {
    border-top-right-radius: 8px;
}

.model-detail-row {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.model-detail-row:nth-child(even) {
    background: rgba(248, 245, 255, 0.6);
}

.model-detail-row:hover {
    background: linear-gradient(135deg, rgba(212, 196, 251, 0.15), rgba(255, 202, 219, 0.15));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 196, 251, 0.2);
}

.model-detail-row td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(212, 196, 251, 0.2);
    font-size: 0.9rem;
    vertical-align: middle;
}

.model-detail-row:last-child td {
    border-bottom: none;
}

.model-detail-row:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.model-detail-row:last-child td:last-child {
    border-bottom-right-radius: 8px;
}


/* Column-specific styling */

.model-name {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: #5a4b7c;
    background: rgba(212, 196, 251, 0.1);
    border-radius: 4px;
    padding: 0.4rem 0.6rem !important;
}

.version {
    font-weight: 600;
    color: #7c6ba4;
    text-align: center;
}

.run-name {
    font-style: italic;
    color: #8b5a8c;
    background: rgba(255, 202, 219, 0.1);
    border-radius: 4px;
    padding: 0.4rem 0.6rem !important;
}


/* Metric value styling */

.metric-excellent {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.metric-good {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.metric-fair {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.metric-poor {
    background: linear-gradient(135deg, #fdd3d0, #f8d7da);
    color: #721c24;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.metric-very-poor {
    background: linear-gradient(135deg, #f5c6cb, #f1b0b7);
    color: #721c24;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.metric-na {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    font-style: italic;
    text-align: center;
    border-radius: 4px;
}


/* Loading states */

.loading-dots {
    color: var(--pastel-lavender-dark);
    font-style: italic;
}

.model-detail-row.loading {
    opacity: 0.7;
    background: linear-gradient(90deg, rgba(212, 196, 251, 0.1) 0%, rgba(212, 196, 251, 0.2) 50%, rgba(212, 196, 251, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.model-detail-row.error {
    background: rgba(248, 215, 218, 0.3);
}

.error-text {
    color: #721c24 !important;
    font-style: italic;
}

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


/* Responsive design for model details table */

@media (max-width: 768px) {
    .model-details-table {
        font-size: 0.8rem;
    }
    .model-details-table thead th,
    .model-detail-row td {
        padding: 0.5rem 0.75rem;
    }
    .model-name,
    .run-name {
        padding: 0.3rem 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .model-details-table {
        font-size: 0.75rem;
    }
    .model-details-table thead th,
    .model-detail-row td {
        padding: 0.4rem 0.5rem;
    }
}


/* Apply the same metric styling as train queue to model details table */

.model-details-table .metric-very-green {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    padding: 0.4rem 0.6rem;
}

.model-details-table .metric-light-green {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    padding: 0.4rem 0.6rem;
}

.model-details-table .metric-light-blue {
    background: linear-gradient(135deg, #cce7ff, #b3d9ff);
    color: #004085;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    padding: 0.4rem 0.6rem;
}

.model-details-table .metric-blue {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    padding: 0.4rem 0.6rem;
}

.model-details-table .metric-orange {
    background: linear-gradient(135deg, #fdd3d0, #f8d7da);
    color: #721c24;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    padding: 0.4rem 0.6rem;
}

.model-details-table .metric-red {
    background: linear-gradient(135deg, #f5c6cb, #f1b0b7);
    color: #721c24;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    padding: 0.4rem 0.6rem;
}

.details-icon {
    color: #d6336c;
    /* feminine magenta */
    cursor: help;
    margin-right: 4px;
}

.details-icon:hover {
    opacity: 0.8;
}


/* Added spinner animation */

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

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}
