/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Global Styles */
* {
    font-family: 'Inter', 'Poppins', sans-serif;
    box-sizing: border-box;
}

:root {
    /* Professional/Scientific Color Scheme */
    /* Primary Colors */
    --primary: #186FAF;              /* Deep Blue - Primary/Action */
    --primary-dark: #0F2340;         /* Dark Blue - Navbar background */
    --primary-light: #2986c7;        /* Light Blue */
    
    /* Accent Colors */
    --accent: #1FA58A;               /* Teal Green - Highlights */
    --accent-light: #3bb89f;
    
    /* Background Colors */
    --bg-white: #ffffff;
    --bg-light: #F3F7FB;             /* Off-white - Step Background */
    --bg-gray-light: #f8fafc;
    
    /* Border Colors */
    --border-color: #E1E8F0;         /* Card/Container Border */
    --border-light: #eef2f7;
    
    /* Status Colors */
    --success: #2EA06F;              /* Progress/Positive */
    --warning: #E9A43A;              /* Warning */
    --danger: #D9534F;               /* Error/Stop */
    --info: #186FAF;                 /* Info (same as primary) */
    
    /* Text Colors */
    --text-primary: #0B2540;         /* Primary Text */
    --text-muted: #556B7A;           /* Muted Text */
    --text-light: #FFFFFF;           /* Light Text (for dark backgrounds) */
    
    /* Neutral Grays (for legacy support) */
    --gray-50: #F3F7FB;
    --gray-100: #E1E8F0;
    --gray-200: #E1E8F0;
    --gray-300: #cbd5e0;
    --gray-600: #556B7A;
    --gray-700: #3d5266;
    --gray-800: #0B2540;
    --gray-900: #0B2540;
    
    /* Shadows - Clean & Subtle */
    --shadow-sm: 0 1px 3px rgba(11, 37, 64, 0.08);
    --shadow-md: 0 2px 6px rgba(11, 37, 64, 0.1);
    --shadow-lg: 0 4px 12px rgba(11, 37, 64, 0.12);
    --shadow-xl: 0 8px 20px rgba(11, 37, 64, 0.15);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 70px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.container, .container-fluid {
    flex: 1;
    padding-bottom: 2rem;
}

/* Professional Scientific Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-dark) !important;
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(15, 35, 64, 0.4);
    z-index: 9999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand h1 {
    color: #ffffff !important;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.navbar-brand i {
    font-size: 2rem;
    color: #ffffff;
    margin-right: 1rem;
}


.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    transition: all var(--transition-fast);
}

.navbar-toggler:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navigation Links */
.navbar .navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    border-bottom: 2px solid transparent;
}

.navbar .nav-link:hover {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.navbar .nav-link.active {
    color: #ffffff !important;
    border-bottom-color: #ffffff;
    font-weight: 600;
}

.navbar .nav-link i {
    font-size: 0.9rem;
    transition: transform var(--transition-fast);
}

.navbar .nav-link:hover i {
    transform: scale(1.2);
}

/* Dropdown Menu */
.navbar .dropdown-toggle::after {
    margin-left: 0.5rem;
    transition: transform var(--transition-fast);
}

.navbar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.navbar .nav-tools-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    padding: 0.5rem 0;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease;
}


.navbar .nav-tools-dropdown .dropdown-item {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-fast);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.85);
}

.navbar .nav-tools-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.navbar .nav-tools-dropdown .dropdown-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Section Headers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3, h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Enhanced Cards */
.section-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}


.card {
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
    border-color: var(--accent);
}

.card-header {
    background: var(--bg-light);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

/* Professional Scientific Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 0.65rem 1.5rem;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #145a8f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 111, 175, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #258a5c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 160, 111, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c44643;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 83, 79, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d89230;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 164, 58, 0.3);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Enhanced Form Controls */
.form-control,
.form-select {
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    background: rgba(255, 255, 255, 0.95);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
    outline: none;
}

/* Tom Select styling to match Bootstrap form-select */
.ts-wrapper.form-select {
    width: 100%;
    position: relative;
}

.ts-wrapper.form-select .ts-control {
    min-height: 38px;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 0.95rem;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.95);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.ts-wrapper.form-select .ts-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
    outline: none;
}

.ts-wrapper.form-select .ts-control.single .ts-control-input {
    padding: 0;
    margin: 0;
    min-height: auto;
}

.ts-wrapper.form-select .ts-dropdown {
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-top: 4px;
    z-index: 9999 !important; /* Ensure dropdown appears above other elements */
    position: absolute !important;
    background: white !important;
    max-height: 300px !important;
    overflow-y: auto !important;
}

.ts-wrapper.form-select .ts-dropdown-content {
    max-height: 300px !important;
    overflow-y: auto !important;
}

/* Ensure dropdown is visible when open */
.ts-wrapper.form-select .ts-dropdown.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ts-wrapper.form-select .ts-dropdown .ts-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.ts-wrapper.form-select .ts-dropdown .ts-option.ts-active {
    background-color: var(--primary);
    color: white;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group-text {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    border-left: 1px solid var(--primary);
}

/* File Upload - Scientific Style */
.form-control[type="file"] {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background: var(--bg-light);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.form-control[type="file"]:hover {
    border-color: var(--accent);
    background: var(--bg-white);
}

.form-control[type="file"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 111, 175, 0.1);
}

/* Professional Scientific Alerts */
.alert {
    border-radius: var(--radius-sm);
    border: 1px solid;
    padding: 1rem 1.25rem;
    box-shadow: none;
}

.alert-info {
    background: #e8f4fb;
    border-color: var(--info);
    color: #0d4e7a;
}

.alert-success {
    background: #e6f5ee;
    border-color: var(--success);
    color: #1d6647;
}

.alert-danger {
    background: #fbeae9;
    border-color: var(--danger);
    color: #a53c39;
}

.alert-warning {
    background: #fcf3e6;
    border-color: var(--warning);
    color: #8a6124;
}

/* Progress Bar - Professional */
.progress {
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--border-color);
    overflow: hidden;
}

.progress-bar {
    background: var(--success);
    transition: width 0.6s ease;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Metric Cards - Scientific */
.metric-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    text-align: center;
    transition: all var(--transition-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.status-badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.status-success {
    background: var(--success);
    color: white;
}

.status-running {
    background: var(--warning);
    color: white;
}

.status-failed {
    background: var(--danger);
    color: white;
}

.status-queued {
    background: var(--primary);
    color: white;
}

/* Tabs */
.nav-pills {
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.nav-pills .nav-link {
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    background-color: transparent;
    color: #64748b;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-pills .nav-link:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
}

.nav-pills .nav-link.active {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animated {
    animation: fadeIn 0.6s ease-out;
}

.animated-slide {
    animation: slideInRight 0.6s ease-out;
}

.animated-scale {
    animation: scaleIn 0.5s ease-out;
}

/* Toast Notifications */
.toast {
    min-width: 320px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-weight: 600;
}

.toast-body {
    padding: 1rem 1.25rem;
}

/* Tables - Professional Scientific */
.table {
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

.table thead {
    background: var(--bg-light);
    color: var(--text-primary);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.table tbody tr {
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover {
    background: var(--bg-light);
}

.table tbody td {
    padding: 1rem;
    color: var(--text-muted);
}

/* Download Buttons - Clean */
.btn-download {
    background: var(--info);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: none;
    padding: 0.65rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
    background: #1976d2;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 5px;
}

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

/* Image Preview */
.img-thumbnail {
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-sm);
}

.img-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: #667eea;
}

/* Icon Box */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: var(--radius-md);
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.icon-box:hover {
    box-shadow: var(--shadow-md);
}

/* Divider */
hr {
    margin: 2rem 0;
    border: none;
    height: 1px;
    background: var(--border-color);
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    border-color: var(--primary);
    border-right-color: transparent;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Tool Selector */
#tool-selector {
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-md);
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    cursor: pointer;
}

#tool-selector:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#tool-selector:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Tool Sections */
.tool-section {
    transition: all var(--transition-normal);
    animation: fadeIn 0.5s ease-out;
}

.tool-section[style*="display: none"] {
    display: none !important;
}

/* Checkboxes */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(148, 163, 184, 0.5);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.form-check-label {
    margin-left: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .navbar-brand h1 {
        font-size: 1.5rem;
    }
    
    .section-card {
        padding: 2rem;
    }
}

@media (max-width: 992px) {
    .navbar-brand h1 {
        font-size: 1.3rem;
    }
    
    .navbar .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .navbar-brand {
        gap: 0.5rem;
    }
    
    .navbar-brand h1 {
        font-size: 1.1rem;
    }
    
    .navbar-brand i {
        font-size: 1.5rem;
        margin-right: 0.5rem;
    }
    
    .navbar .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 0.25rem;
    }
    
    .navbar .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
    }
    
    .navbar .nav-tools-dropdown {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .section-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .metric-card {
        padding: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .nav-pills {
        flex-direction: column;
    }
    
    .nav-pills .nav-link {
        width: 100%;
        text-align: center;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    h3, h4 {
        font-size: 1.25rem;
    }
    
    .toast {
        min-width: 90%;
        max-width: 90%;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 60px;
    }
    
    .navbar-brand h1 {
        font-size: 0.95rem;
    }
    
    .section-card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }
    
    .metric-card {
        padding: 1.25rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .icon-box {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.625rem 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .nav-pills {
        display: none;
    }
    
    body {
        padding-top: 0;
        background: white;
    }
    
    .section-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* Accessibility */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* COG Chart Container */
.cog-chart-container {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.cog-chart-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Venn Diagram Container */
.venn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Gene Preview Table */
.gene-preview-table {
    max-height: 400px;
    overflow-y: auto;
    border-radius: var(--radius-lg);
}

/* Footer - Matching Navbar Style */
footer {
    margin-top: auto;
    position: relative;
    z-index: 1;
    background: var(--primary-dark) !important;
    color: rgba(255, 255, 255, 0.85);
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 8px rgba(15, 35, 64, 0.4);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(24, 111, 175, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(24, 111, 175, 0.2);
    color: var(--text-primary);
}

/* Demo Page Styles */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.demo-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.bg-gradient-primary {
    background: var(--primary);
}

.btn-demo-load {
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-demo-load:hover {
    transform: scale(1.02);
}

/* Download Dataset Button - Solid background, no hover color change */
.btn-demo-download {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.btn-demo-download:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    opacity: 0.9;
}

/* Styled Metric Cards */
.metric-card-total {
    background-color: #e0f7fa;
    border-color: #b2ebf2;
}
.metric-card-total .metric-icon, 
.metric-card-total .metric-value {
    color: #00bcd4;
}

.metric-card-core {
    background-color: #e8eaf6;
    border-color: #c5cae9;
}
.metric-card-core .metric-icon, 
.metric-card-core .metric-value {
    color: #3f51b5;
}

.metric-card-accessory {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
}
.metric-card-accessory .metric-icon, 
.metric-card-accessory .metric-value {
    color: #2e7d32; /* Darker green for better contrast */
}

.metric-card-unique {
    background-color: #fffde7;
    border-color: #fff9c4;
}
.metric-card-unique .metric-icon, 
.metric-card-unique .metric-value {
    color: #fbc02d; /* Darker yellow/amber for better contrast */
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Hero Section */
.hero-section {
    margin-top: 0 !important;
}

body.about-page .hero-section {
    padding-top: 1rem !important;
}

/* Home and About Page Background Images */
.home-bg-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    min-height: calc(100vh - 70px);
    padding: 4rem 0;
    margin-top: 0;
}

/* Home page specific - add background image */
body:not(.about-page) .home-bg-section {
    background-image: url('../images/1.png');
    will-change: background-image;
}

/* About page - use body background, no section background */
body.about-page .home-bg-section {
    background-image: none;
    padding-top: 3rem;
    min-height: auto;
}

body.about-page .home-bg-section > .container {
    padding-top: 1rem;
}

.home-bg-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.80) 100%);
    z-index: 0;
}

.home-bg-section > .container {
    position: relative;
    z-index: 1;
}

.home-bg-section h1,
.home-bg-section h2,
.home-bg-section h3,
.home-bg-section h4,
.home-bg-section h5,
.home-bg-section h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9);
}

.home-bg-section p,
.home-bg-section .text-muted,
.home-bg-section .lead {
    color: var(--text-primary) !important;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8);
}

.home-bg-section-2 {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 3rem 0;
}

/* Home page specific - add background image */
body:not(.about-page) .home-bg-section-2 {
    background-image: url('../images/1.png');
    will-change: background-image;
}

/* About page - use body background, no section background */
body.about-page .home-bg-section-2 {
    background-image: none;
}

.home-bg-section-2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(243, 247, 251, 0.88) 0%, rgba(255, 255, 255, 0.85) 100%);
    z-index: 0;
}

.home-bg-section-2 > .container {
    position: relative;
    z-index: 1;
}

.home-bg-section-2 .card {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.home-bg-section-2 .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-bg-section-2 .card .card-body p {
    flex: 1;
}

.home-bg-section-2 h1,
.home-bg-section-2 h2,
.home-bg-section-2 h3,
.home-bg-section-2 h4,
.home-bg-section-2 h5,
.home-bg-section-2 h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
}

.home-bg-section-2 p,
.home-bg-section-2 .text-muted {
    color: var(--text-primary) !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.home-bg-section-3 {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 3rem 0;
}

/* Home page specific - add background image */
body:not(.about-page) .home-bg-section-3 {
    background-image: url('../images/1.png');
    will-change: background-image;
}

/* About page - use body background, no section background */
body.about-page .home-bg-section-3 {
    background-image: none;
}

.home-bg-section-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.87) 0%, rgba(243, 247, 251, 0.85) 100%);
    z-index: 0;
}

.home-bg-section-3 > .container {
    position: relative;
    z-index: 1;
}

.home-bg-section-3 h1,
.home-bg-section-3 h2,
.home-bg-section-3 h3,
.home-bg-section-3 h4,
.home-bg-section-3 h5,
.home-bg-section-3 h6 {
    color: var(--text-primary) !important;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.9);
}

.home-bg-section-3 p,
.home-bg-section-3 .text-muted,
.home-bg-section-3 .lead {
    color: var(--text-primary) !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* About Page - Full Page Background */
body.about-page {
    background-image: url('../images/3.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    background-color: var(--bg-light) !important;
    will-change: background-image;
}

body.about-page > .container {
    position: relative;
}

/* About Page Background - Improved */
.about-bg-section {
    position: relative;
    background: transparent;
    min-height: 40vh;
    padding: 5rem 0;
    margin: 0;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
}

.about-bg-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

.about-bg-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.18) 100%); /* darker overlay */
    border-radius: 0;
    z-index: 1;
}

.about-bg-section > .container,
.about-bg-section > div {
    position: relative;
    z-index: 2;
}

.about-bg-section h1,
.about-bg-section h2,
.about-bg-section h3,
.about-bg-section h4,
.about-bg-section h5,
.about-bg-section h6 {
    color: #000000 !important; /* darker text for visibility */
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.45);
}

.about-bg-section p,
.about-bg-section .text-muted,
.about-bg-section .lead {
    color: #000000 !important; /* darker text for visibility */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}

.about-bg-section-2 {
    position: relative;
    background: var(--bg-light);
    padding: 2.5rem 0;
    border-radius: 1rem;
    margin: 2rem 0;
    overflow: hidden;
}

.about-bg-section-2::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

.about-bg-section-2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.14) 100%); /* darker overlay */
    border-radius: 1rem;
    z-index: 1;
}

.about-bg-section-2 > .container,
.about-bg-section-2 .card {
    position: relative;
    z-index: 2;
}

.about-bg-section-2 .card {
    background: rgba(255, 255, 255, 0.93) !important;
    backdrop-filter: blur(2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    padding: 1rem;
}

.about-bg-section-2 h1,
.about-bg-section-2 h2,
.about-bg-section-2 h3,
.about-bg-section-2 h4,
.about-bg-section-2 h5,
.about-bg-section-2 h6 {
    color: #0b172a !important;
    font-weight: 700;
    text-shadow: none;
}

.about-bg-section-2 p,
.about-bg-section-2 .text-muted,
.about-bg-section-2 li,
.about-bg-section-2 ul,
.about-bg-section-2 ul li,
.about-bg-section-2 .list-unstyled,
.about-bg-section-2 .list-unstyled li {
    color: #0b172a !important;
    text-shadow: none;
    font-weight: 500;
}

/* Force darker text inside the technology stack section */
.about-bg-section-2 .card-body,
.about-bg-section-2 .card-body *,
.about-bg-section-2 i,
.about-bg-section-2 h5,
.about-bg-section-2 h5 i {
    color: #000000 !important;
}

.about-bg-section-2 .text-primary,
.about-bg-section-2 .text-info,
.about-bg-section-2 .text-success,
.about-bg-section-2 .text-warning {
    color: #000000 !important;
}

.about-bg-section-3 {
    position: relative;
    background: var(--bg-light);
    padding: 2.5rem 0;
    border-radius: 1rem;
    margin: 2rem 0;
    overflow: hidden;
}

.about-bg-section-3::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

.about-bg-section-3::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.14) 100%);
    border-radius: 1rem;
    z-index: 1;
}

.about-bg-section-3 > .container,
.about-bg-section-3 .card {
    position: relative;
    z-index: 2;
}

.about-bg-section-3 .card {
    background: rgba(255, 255, 255, 0.93) !important;
    backdrop-filter: blur(2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    padding: 1rem;
}

.about-bg-section-3 h1,
.about-bg-section-3 h2,
.about-bg-section-3 h3,
.about-bg-section-3 h4,
.about-bg-section-3 h5,
.about-bg-section-3 h6 {
    color: #0b172a !important;
    font-weight: 700;
    text-shadow: none;
}

.about-bg-section-3 p,
.about-bg-section-3 .text-muted,
.about-bg-section-3 .text-primary,
.about-bg-section-3 .text-info,
.about-bg-section-3 .text-success,
.about-bg-section-3 .text-warning {
    color: #0b172a !important;
    text-shadow: none;
}
