/* ChemAlize - Unified Main CSS */

:root {
    /* Light Theme (default) */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #f3f4f6;
    --bg-primary: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --hover-color: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Glass effect variables */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Dark Theme */
body.dark-theme {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-white: #1f2937;
    --border-color: #374151;
    --hover-color: #374151;
    --glass-bg: rgba(45, 55, 72, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Base Styles */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-top: 9rem; /* Increased to account for navbar + subtitle */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =================================================================== */
/* ENHANCED NAVBAR STYLES */
/* =================================================================== */

.site-header {
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    padding: 1rem 0;
    transition: var(--transition);
    position: relative;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.navbar-brand:hover {
    color: #60a5fa !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.atom-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 0.5rem;
}

.navbar-brand i {
    font-size: 1.8rem;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.4s ease;
}

.navbar-brand:hover i {
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.6)) drop-shadow(0 0 12px rgba(37, 99, 235, 0.4));
}

/* Orbital particles using pseudo-elements on wrapper */
.atom-wrapper::before,
.atom-wrapper::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #60a5fa, #3b82f6);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
    z-index: 10;
}

.navbar-brand:hover .atom-wrapper::before {
    opacity: 1;
    animation: orbit1 1.5s linear infinite;
}

.navbar-brand:hover .atom-wrapper::after {
    opacity: 1;
    animation: orbit2 1.5s linear infinite;
}

/* Orbital animations - opposite directions */
@keyframes orbit1 {
    0% {
        top: -12px;
        left: 50%;
        transform: translateX(-50%) scale(0.8);
    }
    25% {
        top: 50%;
        left: calc(100% + 8px);
        transform: translateY(-50%) scale(1);
    }
    50% {
        top: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) scale(0.8);
    }
    75% {
        top: 50%;
        left: -12px;
        transform: translateY(-50%) scale(1);
    }
    100% {
        top: -12px;
        left: 50%;
        transform: translateX(-50%) scale(0.8);
    }
}

@keyframes orbit2 {
    0% {
        top: 50%;
        left: calc(100% + 8px);
        transform: translateY(-50%) scale(1);
    }
    25% {
        top: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) scale(0.8);
    }
    50% {
        top: 50%;
        left: -12px;
        transform: translateY(-50%) scale(1);
    }
    75% {
        top: -12px;
        left: 50%;
        transform: translateX(-50%) scale(0.8);
    }
    100% {
        top: 50%;
        left: calc(100% + 8px);
        transform: translateY(-50%) scale(1);
    }
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.75rem 1.25rem !important;
    border-radius: 0.75rem;
    transition: var(--transition);
    margin: 0 0.25rem;
    position: relative;
    text-decoration: none;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
}

.navbar-nav .nav-link:hover::before {
    width: 80%;
}

.navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(240, 147, 251, 0.2));
    font-weight: 600;
    text-decoration: none;
}

.navbar-nav .nav-link.active::before {
    width: 80%;
}

/* Theme Toggle Buttons */
.theme-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.5rem !important;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.theme-btn:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3) !important;
}

/* Clear Session Button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    border-radius: 0.75rem !important;
    transition: var(--transition);
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

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

/* Navbar Toggler */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.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%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navbar Subtitle */
.navbar-subtitle {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(240, 147, 251, 0.1));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    position: relative;
}

.navbar-subtitle .container-fluid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-subtitle-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-subtitle-text i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Dark Theme Navbar */
body.dark-theme .site-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

body.dark-theme .navbar {
    background: linear-gradient(135deg, #0f172a, #020617) !important;
}

body.dark-theme .navbar-brand {
    color: #ffffff !important;
}

body.dark-theme .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .navbar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(240, 147, 251, 0.3));
}

body.dark-theme .theme-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-theme .theme-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body.dark-theme .navbar-subtitle {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(240, 147, 251, 0.05));
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .navbar-subtitle-text {
    color: var(--text-secondary);
}

/* Dropdown menu styles for dark theme */
body.dark-theme .dropdown-menu {
    background: #1f2937 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Ensure dropdown menus are always on top */
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* Make dropdown toggle button create stacking context */
.dropdown-toggle {
    position: relative;
    z-index: 1;
}

/* Ensure btn-group has proper positioning context */
.btn-group {
    position: relative;
    z-index: 100 !important;
}

/* When dropdown is shown, increase z-index even more */
.btn-group.show {
    z-index: 10000 !important;
}

/* Ensure cards don't interfere with dropdowns */
.card, .modern-card {
    position: relative;
    z-index: 1;
}

/* Fix overflow issues that might clip dropdowns */
.modern-card, .card {
    overflow: visible !important;
}

/* Ensure main container doesn't clip dropdowns */
main, .container, .container-fluid {
    overflow: visible !important;
}

/* Ensure form elements with dropdowns are visible */
form {
    overflow: visible !important;
}

/* Ensure row and column elements don't clip */
.row, [class*="col-"] {
    overflow: visible !important;
}

/* Ensure animated elements don't create stacking issues */
.animate-in {
    overflow: visible !important;
}

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

/* Ensure proper stacking for fixed navbar */
.site-header {
    will-change: transform;
}

/* Prevent navbar from jumping on page load */
.navbar-nav,
.navbar-brand,
.navbar-toggler {
    transition: var(--transition);
}

/* =================================================================== */
/* MODERN PREPROCESS STYLES */
/* =================================================================== */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.page-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 2;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

/* Modern Cards */
.modern-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.modern-card:hover {
    /* Removed transform to prevent stacking context issues with dropdowns */
    /* transform: translateY(-2px); */
    box-shadow: var(--shadow-lg);
    /* Use margin instead for lift effect without creating stacking context */
    margin-top: -2px;
    margin-bottom: calc(2rem + 2px);
}

/* Disable hover transform for cards containing interactive visualizations/plots */
.modern-card.no-hover-transform:hover {
    margin-top: 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.modern-card h3, .modern-card h4, .modern-card h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-card h3 i, .modern-card h4 i, .modern-card h5 i {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Upload Section */
.upload-section {
    text-align: center;
    padding: 3rem 2rem;
    border: 2px dashed transparent;
    border-radius: 1.5rem;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--accent-color)) border-box;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(240, 147, 251, 0.03));
    border-radius: 1.5rem;
    transition: var(--transition);
}

.upload-section:hover::before {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(240, 147, 251, 0.08));
}

.upload-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border: 2px dashed transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
}

.upload-section.has-file {
    border: 2px dashed transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--success-color), #10b981) border-box;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-section.has-file::before {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(16, 185, 129, 0.05));
}

/* Enhanced file upload area with drag and drop styling */
.upload-section.dragover {
    border: 2px dashed transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--accent-color), var(--primary-color)) border-box;
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.upload-section.dragover::before {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.12), rgba(37, 99, 235, 0.12));
}

/* Analysis Info Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .analysis-grid {
        grid-template-columns: 2.2fr 1fr;
    }
}

.analysis-stat {
    background: rgba(37, 99, 235, 0.1);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid rgba(37, 99, 235, 0.2);
    overflow: hidden;
    transition: var(--transition);
}

.analysis-stat.filename {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    text-align: left;
}

.analysis-stat.rows {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.analysis-stat.columns {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.analysis-stat.dimension {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.analysis-stat.missing {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
}

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

.analysis-stat .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.analysis-stat .value.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.analysis-stat .value.truncate:hover {
    background: rgba(37, 99, 235, 0.1);
    padding: 0.3rem;
    border-radius: 0.25rem;
}

.analysis-stat .value.truncate::before {
    content: "👆 Click to expand";
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analysis-stat .value.truncate:hover::before {
    opacity: 1;
}

.analysis-stat .value.expanded {
    font-size: 1rem;
    line-height: 1.4;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* =================================================================== */
/* TITLE AND CONTENT LAYOUT STYLES */
/* =================================================================== */

.title-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0;
}

.title-icon {
    font-size: 3rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-info h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.title-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--glass-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.status-item i {
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

.status-label {
    font-weight: 500;
    color: var(--text-primary);
}

/* Action Cards */
.action-card {
    background: var(--glass-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    height: 100%;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

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

.action-card h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-card h6 i {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================================================== */
/* MODERN BUTTONS */
/* =================================================================== */

.modern-btn {
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.modern-btn:hover {
    color: var(--text-light);
    text-decoration: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.modern-btn:hover::before {
    left: 100%;
}

/* Modern Button Variants - Using Ultra Dark Gradients */
.btn-primary-modern {
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, #0d1117, #1a252f);
    color: var(--text-light);
}

.btn-info-modern {
    background: linear-gradient(135deg, #0f4c75, #1b262c);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-info-modern:hover {
    background: linear-gradient(135deg, #0a3858, #0f1419);
    color: var(--text-light);
}

.btn-success-modern {
    background: linear-gradient(135deg, #1e3932, #2c5530);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-success-modern:hover {
    background: linear-gradient(135deg, #132d28, #1e3932);
    color: var(--text-light);
}

.btn-warning-modern {
    background: linear-gradient(135deg, #b7791f, #a0522d);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-warning-modern:hover {
    background: linear-gradient(135deg, #8b5a16, #6b4423);
    color: var(--text-light);
}

.btn-danger-modern {
    background: linear-gradient(135deg, #8b0000, #660000);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-danger-modern:hover {
    background: linear-gradient(135deg, #660000, #4d0000);
    color: var(--text-light);
}

.btn-secondary-modern {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-secondary-modern:hover {
    background: linear-gradient(135deg, #1a252f, #0d1117);
    color: var(--text-light);
}

/* Disabled Button States */
.modern-btn:disabled {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: #e9ecef;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid #6c757d;
}

.modern-btn:disabled:hover {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: #e9ecef;
    transform: none;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.modern-btn:disabled::before {
    display: none;
}

/* Collapsible Sections */
.collapse-section {
    margin-bottom: 1rem;
}

.collapse-trigger {
    width: 100%;
    text-align: left;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.8), rgba(52, 73, 94, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: var(--transition);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: var(--text-light);
    letter-spacing: 0.3px;
}

.collapse-trigger:hover {
    background: linear-gradient(135deg, rgba(26, 37, 47, 0.9), rgba(44, 62, 80, 0.9));
    transform: translateY(-1px);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    color: var(--text-light);
}

.collapse-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
    color: var(--text-light);
}

.collapse-content {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

/* Checkboxes styling */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.checkbox-item:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 0.25rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Scrollable content */
.scrollable-content {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Modern Table Container */
.modern-table-container {
    background: var(--bg-white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.modern-table-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 1rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* =================================================================== */
/* ENHANCED FILE UPLOAD STYLES */
/* =================================================================== */

.file-input {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    border-radius: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
}

.file-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.file-label:hover::before {
    left: 100%;
}

.file-label:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--text-light);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-hover), #6366f1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.file-label:active {
    transform: translateY(-1px);
}

.file-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.upload-btn {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 1.25rem 2.5rem;
    border-radius: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.2px;
    font-size: 1.1rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--text-light);
    background: linear-gradient(135deg, #16a34a, #059669);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.upload-btn:active {
    transform: translateY(-1px);
}

.upload-btn:disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    color: #d1d5db;
    text-shadow: none;
    border: 1px solid #9ca3af;
    opacity: 0.6;
}

.upload-btn:disabled::before {
    display: none;
}

.upload-btn i {
    font-size: 1.2em;
    margin-right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem;
    border-radius: 0.375rem;
    backdrop-filter: blur(10px);
}

.file-info {
    margin-top: 1.5rem;
    color: var(--success-color);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: inline-block;
    border: 1px solid rgba(34, 197, 94, 0.2);
    box-shadow: var(--shadow-sm);
    position: relative;
    backdrop-filter: blur(10px);
}

.file-info::before {
    content: '✓';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--success-color);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.file-info {
    padding-left: 3rem;
}

/* Upload progress indicator */
.upload-progress {
    width: 100%;
    height: 4px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
    display: none;
}

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

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* File type indicator */
.file-type-icon {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.file-type-csv { color: #16a34a; }
.file-type-xlsx { color: #2563eb; }
.file-type-json { color: #f59e0b; }
.file-type-yaml { color: #8b5cf6; }
.file-type-txt { color: #6b7280; }

/* Enhanced upload button loading state */
.upload-btn.loading {
    pointer-events: none;
    position: relative;
}

.upload-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.upload-btn.loading span {
    opacity: 0;
}

/* =================================================================== */
/* FORM INPUT STYLES */
/* =================================================================== */

.range-input-group {
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.form-range {
    margin-bottom: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================================================== */
/* CONTENT SECTION STYLES */
/* =================================================================== */

.content-section {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* =================================================================== */
/* CARD STYLES */
/* =================================================================== */

.card {
    background: var(--bg-white);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    /* overflow: hidden; */ /* Removed to allow dropdowns to be visible */
    overflow: visible;
    position: relative;
    z-index: 1;
}

.card-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 1.25rem 1.5rem;
    border: 0;
    border-radius: 1rem 1rem 0 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.card-body {
    padding: 1.5rem;
    color: var(--text-primary);
}

/* =================================================================== */
/* TABLE STYLES */
/* =================================================================== */

.table-responsive {
    overflow: auto;
    max-height: 600px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 0.75rem 0.75rem;
    margin: 15px -1px -1px -1px;
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    margin-bottom: 0;
    background: var(--bg-white);
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important; /* Ciemniejszy niebieski */
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1rem;
}

.table thead th:first-child {
    border-radius: 0.5rem 0 0 0;
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    font-weight: 700 !important;
    z-index: 10;
}

.table thead th:last-child {
    border-radius: 0 0.5rem 0 0;
    border-right: none;
}

.table tbody td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
}

.thead-light th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-color);
    color: var(--text-light);
    white-space: nowrap;
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.table-bordered td, 
.table-bordered th {
    border-right: 1px solid rgba(0,0,0,0.1);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-primary);
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover {
    background-color: var(--hover-color);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.table th:first-child,
.table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: inherit;
    font-weight: 600;
    box-shadow: 2px 0 3px -2px rgba(0,0,0,0.1);
}

/* Fix for first header cell visibility */
.table thead th:first-child {
    background: var(--primary-color) !important;
    color: var(--text-light) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: 700 !important;
    z-index: 10;
}

/* Enhanced sticky first column for better contrast */
.table tbody td:first-child {
    background: var(--bg-white) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
}

.table-responsive::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.05));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-responsive:not([data-scrolled="end"]):hover::after {
    opacity: 1;
}

.table-responsive::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    background-color: var(--bg-primary);
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 6px;
    border: 3px solid var(--bg-primary);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-hover);
}

/* Force high contrast for all table headers */
.table th,
.table thead th,
th {
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    font-weight: 700 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    font-size: 1rem !important;
    padding: 1rem !important;
}

/* Specific fix for numbered headers */
.table thead tr th {
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    font-weight: 700 !important;
    text-align: center;
    vertical-align: middle;
}

/* Extra contrast for numerical headers like 0, 1, 2 */
.table thead th:contains('0'),
.table thead th:contains('1'),
.table thead th:contains('2'),
.table thead th:contains('3'),
.table thead th:contains('4'),
.table thead th:contains('5') {
    background: #1e3a8a !important;
    color: #ffffff !important;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 1) !important;
    font-weight: 900 !important;
    font-size: 1.1rem !important;
}

/* =================================================================== */
/* FORM STYLES */
/* =================================================================== */

.form-control {
    background-color: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: var(--transition);
    padding: 0.625rem 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* =================================================================== */
/* ENHANCED BUTTON STYLES */
/* =================================================================== */

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--text-light);
    text-decoration: none;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: var(--text-light);
}

.btn-success:hover {
    background-color: #16a34a;
    border-color: #16a34a;
    color: var(--text-light);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--text-light);
}

.btn-warning:hover {
    background-color: #d97706;
    border-color: #d97706;
    color: var(--text-light);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--text-light);
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: var(--text-light);
}

/* =================================================================== */
/* MODERN ALERTS */
/* =================================================================== */

.modern-alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modern-alert.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(255, 112, 67, 0.1));
    color: #d97706;
    border-left: 4px solid var(--warning-color);
}

.modern-alert.alert-info {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(32, 201, 151, 0.1));
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.modern-alert.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(32, 201, 151, 0.1));
    color: #16a34a;
    border-left: 4px solid var(--success-color);
}

.modern-alert.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: #dc2626;
    border-left: 4px solid var(--danger-color);
}

/* =================================================================== */
/* MODAL STYLING */
/* =================================================================== */

.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-heavy);
    background: var(--bg-white);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    border-radius: 1rem 1rem 0 0;
    border: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-close, .close {
    color: var(--text-light);
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-close:hover, .close:hover {
    opacity: 1;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Modal specific styles */
.selected-columns-list {
    min-height: 200px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.rename-inputs-list {
    min-height: 200px;
}

/* =================================================================== */
/* ANIMATIONS */
/* =================================================================== */

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

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =================================================================== */
/* DARK THEME ENHANCEMENTS */
/* =================================================================== */

body.dark-theme .analysis-stat {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .analysis-stat .label {
    color: var(--text-secondary);
}

body.dark-theme .analysis-stat .value {
    color: #60a5fa;
}

body.dark-theme .analysis-stat .value.truncate:hover::before {
    color: var(--text-secondary);
}

body.dark-theme .analysis-stat .value.truncate:hover {
    background: rgba(37, 99, 235, 0.2);
}

body.dark-theme .analysis-stat .value.expanded {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

body.dark-theme .modern-btn:disabled {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: var(--text-secondary);
    border-color: #374151;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

body.dark-theme .upload-btn:disabled {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: var(--text-secondary);
    border-color: #374151;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

body.dark-theme .collapse-trigger {
    background: linear-gradient(135deg, rgba(26, 37, 47, 0.9), rgba(13, 17, 23, 0.9));
    border-color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

body.dark-theme .collapse-trigger:hover {
    background: linear-gradient(135deg, rgba(13, 17, 23, 1), rgba(0, 0, 0, 0.9));
    text-shadow: 0 3px 8px rgba(0, 0, 0, 1);
}

body.dark-theme .collapse-content {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-theme .modern-btn, 
body.dark-theme .file-label, 
body.dark-theme .upload-btn {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

body.dark-theme .modern-btn:hover, 
body.dark-theme .file-label:hover, 
body.dark-theme .upload-btn:hover {
    text-shadow: 0 3px 8px rgba(0, 0, 0, 1);
}

body.dark-theme .page-title, 
body.dark-theme .page-subtitle {
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}

body.dark-theme .modern-btn i, 
body.dark-theme .file-label i, 
body.dark-theme .upload-btn i {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
}

body.dark-theme .table-striped tbody tr:nth-of-type(odd) {
    background-color: #2a2e35;
}

body.dark-theme .table thead th {
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-theme .table thead th:first-child {
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

body.dark-theme .thead-light th {
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-theme .table tbody td:first-child {
    background: var(--bg-white) !important;
    color: var(--text-primary) !important;
    border-right: 1px solid var(--border-color);
}

body.dark-theme .table th:first-child,
body.dark-theme .table td:first-child {
    background-color: inherit;
}

body.dark-theme .table thead th {
    background-color: var(--primary-color);
    color: var(--text-light);
}

body.dark-theme .table tbody td {
    background-color: var(--bg-white);
    color: var(--text-primary);
}

body.dark-theme .card-body,
body.dark-theme .table,
body.dark-theme .form-control {
    color: var(--text-primary);
}

body.dark-theme .text-muted {
    color: #f3f4f6 !important; /* Wymuś jasny kolor w dark mode */
}

body.dark-theme .selected-columns-list {
    background-color: var(--bg-white);
}

body.dark-theme .upload-btn {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-theme .upload-btn:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

body.dark-theme .upload-section {
    background: linear-gradient(var(--bg-white), var(--bg-white)) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--accent-color)) border-box;
}

body.dark-theme .upload-section::before {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(240, 147, 251, 0.05));
}

body.dark-theme .upload-section:hover::before {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(240, 147, 251, 0.1));
}

body.dark-theme .upload-section.has-file {
    background: linear-gradient(var(--bg-white), var(--bg-white)) padding-box,
                linear-gradient(135deg, var(--success-color), #10b981) border-box;
}

body.dark-theme .upload-section.has-file::before {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.08));
}

/* Dark theme for analysis methods */
body.dark-theme .target-form {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-theme .current-target {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--text-primary);
}

body.dark-theme .analysis-method-card {
    background: var(--bg-white);
    border-color: var(--border-color);
}

body.dark-theme .method-content p {
    color: var(--text-secondary);
}

body.dark-theme .feature-item {
    color: var(--text-primary);
}

body.dark-theme .method-footer {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

/* Dark theme for visualization components */
body.dark-theme .visualization-container {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

body.dark-theme .visualization-form {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-theme .plot-card {
    background: var(--bg-white);
    border-color: var(--border-color);
}

body.dark-theme .loading-container {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-theme .loading-text {
    color: var(--text-secondary);
}

body.dark-theme .modal-info {
    color: var(--text-secondary);
}

/* =================================================================== */
/* VISUALIZATION AND PLOTTING STYLES */
/* =================================================================== */

/* Visualization Containers */
.visualization-container {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.image-preview {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.image-preview:hover {
    transform: scale(1.02);
}

.visualization-image {
    width: 100%;
    height: auto;
    transition: var(--transition);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
    font-size: 1.1rem;
    font-weight: 500;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Visualization Forms */
.visualization-form {
    background: var(--glass-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 200px;
    gap: 1rem;
    align-items: end;
}

.histogram-form {
    grid-template-columns: 1fr 200px;
}

/* Plot Components */
.plot-container {
    min-height: 100px;
}

.plot-card {
    background: var(--bg-white);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.plot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.plot-header h6 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plot-body {
    padding: 1.5rem;
}

/* Loading States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--glass-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.loading-text {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 1rem 0 0 0;
}

/* Modal Components */
.modal-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 auto;
}

.modal-info i {
    color: var(--primary-color);
}

.modal-image {
    border-radius: 0.5rem;
    max-height: 70vh;
    object-fit: contain;
}

/* =================================================================== */
/* ANALYSIS METHODS AND TARGET SELECTION STYLES */
/* =================================================================== */

/* Target Variable Form */
.target-form {
    background: var(--glass-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.target-selection {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.target-selection .form-control {
    flex: 1;
}

.current-target {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.current-target i {
    color: var(--primary-color);
}

/* Analysis Methods Grid */
.analysis-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.analysis-method-card {
    background: var(--bg-white);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
    height: fit-content;
    box-shadow: var(--shadow);
}

.analysis-method-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Method Card Headers */
.method-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pca-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.pcr-header {
    background: linear-gradient(135deg, var(--success-color), #10b981);
}

.mlr-header {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.clustering-header {
    background: linear-gradient(135deg, var(--warning-color), #f97316);
}

.method-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.method-title h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.method-category {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Method Card Content */
.method-content {
    padding: 1.5rem;
}

.method-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.method-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feature-item i {
    width: 16px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.method-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

/* =================================================================== */
/* RESPONSIVE DESIGN */
/* =================================================================== */

@media (max-width: 768px) {
    body {
        margin-top: 8rem; /* Adjusted for mobile navbar height */
    }
    
    .content-section,
    .modern-card {
        padding: 1.5rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }

    .analysis-stat.filename {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        text-align: center;
    }

    .analysis-stat.rows {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    .analysis-stat.columns {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .analysis-stat.dimension {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
    }

    .analysis-stat.missing {
        grid-column: 1 / 2;
        grid-row: 5 / 6;
    }

    .page-title {
        font-size: 2rem;
    }

    .analysis-stat {
        text-align: center;
    }
    
    .col-lg-5,
    .col-lg-7 {
        width: 100%;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .navbar-subtitle-text {
        font-size: 0.85rem;
    }

    .title-content {
        flex-direction: column;
        text-align: center;
    }
    
    .title-icon {
        margin-bottom: 1rem;
    }
    
    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .target-selection {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analysis-methods-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .method-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .method-icon {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .histogram-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .analysis-stat .value.truncate {
        font-size: 1rem;
    }
    
    .analysis-grid {
        gap: 0.8rem;
    }
    
    .modern-card {
        padding: 1rem;
    }
}

/* =================================================================== */
/* HOMEPAGE SPECIFIC STYLES */
/* =================================================================== */

/* Homepage body override */
body.homepage-body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e3f2fd 100%);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
    transition: all 0.3s ease;
}

/* Dark theme homepage body */
[data-theme="dark"] body.homepage-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
}

/* Homepage theme toggle button */
.homepage-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #e2e8f08b;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-color);
}

.homepage-theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.homepage-theme-toggle i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .homepage-theme-toggle {
    background: #374151;
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

/* Animated background molecules */
.molecules-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.molecule {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.molecule:nth-child(odd) {
    background: rgba(118, 75, 162, 0.3);
    animation-duration: 25s;
}

.molecule:nth-child(3n) {
    background: rgba(240, 147, 251, 0.3);
    animation-duration: 30s;
}

[data-theme="dark"] .molecule {
    background: rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .molecule:nth-child(odd) {
    background: rgba(118, 75, 162, 0.2);
}

[data-theme="dark"] .molecule:nth-child(3n) {
    background: rgba(240, 147, 251, 0.2);
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Homepage header */
.homepage-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    flex-shrink: 0;
}

[data-theme="dark"] .homepage-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.homepage-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.logo-container {
    position: relative;
    z-index: 2;
}

.homepage-logo {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color), var(--success-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #ffffff;
    box-shadow: var(--shadow-medium);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.homepage-tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 300;
    text-align: center;
    margin-top: 0.5rem;
}

/* Homepage main content */
.homepage-content {
    padding: 2rem 0;
    position: relative;
    flex: 1;
}

.options-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.section-title p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

[data-theme="dark"] .section-title p {
    color: #94a3b8;
}

/* Option cards */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.option-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

[data-theme="dark"] .option-card {
    border-color: rgba(255, 255, 255, 0.1);
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.option-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.option-card:hover::before {
    transform: scaleX(1);
}

.option-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    position: relative;
    transition: all 0.3s ease;
}

.analysis-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.merger-icon {
    background: linear-gradient(135deg, var(--success-color), var(--accent-color));
}

.episuite-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.option-card:hover .option-icon {
    transform: scale(1.1) rotate(5deg);
}

.option-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 1rem;
}

.option-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
}

[data-theme="dark"] .option-description {
    color: #94a3b8;
}

.option-features {
    list-style: none;
    margin-bottom: 2rem;
}

.option-features li {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    color: #475569;
}

[data-theme="dark"] .option-features li {
    color: #cbd5e0;
}

.option-features li i {
    color: var(--success-color);
    margin-right: 0.8rem;
    font-size: 0.9rem;
}

.option-button {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.analysis-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.merger-button {
    background: linear-gradient(135deg, var(--success-color), var(--accent-color));
}

.episuite-button {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.option-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.option-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.option-button:hover::before {
    left: 100%;
}

/* Homepage stats section */
.homepage-stats {
    background: var(--white);
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

[data-theme="dark"] .homepage-stats {
    border-color: rgba(255, 255, 255, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    text-align: center;
}

.stat-item {
    padding: 0.5rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .stat-label {
    color: #94a3b8;
}

/* Homepage footer */
.homepage-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    flex-shrink: 0;
}

[data-theme="dark"] .homepage-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.homepage-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footerGrid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23footerGrid)"/></svg>');
    opacity: 0.5;
}

.footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.4;
}

.footer-author {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.footer-author i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.footer-year {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.footer-link {
    color: #90cdf4;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.footer-link:hover {
    color: #63b3ed;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.footer-link i {
    font-size: 0.8rem;
}

/* Homepage loading animation */
.homepage-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[data-theme="dark"] .homepage-loading {
    background: rgba(15, 23, 42, 0.95);
}

.homepage-loading.active {
    opacity: 1;
    visibility: visible;
}

.homepage-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: homepage-spin 1s linear infinite;
}

[data-theme="dark"] .homepage-spinner {
    border-color: #374151;
    border-top-color: var(--primary-color);
}

@keyframes homepage-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design for homepage */
@media (max-width: 768px) {
    .homepage-theme-toggle {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .homepage-theme-toggle span {
        display: none;
    }

    .homepage-logo {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .option-card {
        padding: 2rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .homepage-content {
        padding: 1.5rem 0;
    }

    .footer-content {
        font-size: 0.8rem;
    }

    .options-container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .homepage-theme-toggle {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
    }

    .homepage-theme-toggle i {
        font-size: 14px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .option-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .homepage-logo {
        font-size: 2rem;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* =================================================================== */
/* MERGER STANDALONE PAGE STYLES */
/* =================================================================== */

/* Merger body */
body.merger-body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e3f2fd 100%);
    min-height: 100vh;
    color: var(--text-primary, #1f2937);
    line-height: 1.6;
    margin-top: 9rem;
    padding: 0;
}

[data-theme="dark"] body.merger-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f9fafb;
}

/* Navigation */
.merger-navbar {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 1rem 0;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.merger-nav-brand {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.merger-nav-brand:hover {
    color: #60a5fa;
    text-decoration: none;
    transform: translateY(-1px);
}

.merger-nav-brand i {
    font-size: 1.8rem;
    color: var(--primary-color, #2563eb);
}

.merger-theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
}

.merger-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.merger-theme-toggle i {
    font-size: 16px;
    transition: transform 0.3s ease;
}


/* Coming soon card */
.merger-coming-soon-card {
    background: var(--bg-white, #ffffff);
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .merger-coming-soon-card {
    background: #2d3748;
    color: #e2e8f0;
}

.merger-coming-soon-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #4ecdc4, #f093fb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 2rem;
    animation: merger-pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

@keyframes merger-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Feature preview */
.merger-feature-preview {
    background: var(--bg-primary, #f9fafb);
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .merger-feature-preview {
    background: #1a202c;
}

.merger-feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.merger-feature-item {
    background: var(--bg-white, #ffffff);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

[data-theme="dark"] .merger-feature-item {
    background: #2d3748;
    color: #e2e8f0;
}

.merger-feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.merger-feature-item i {
    color: #4ecdc4;
    font-size: 1.1rem;
    width: 20px;
    flex-shrink: 0;
}

.merger-feature-item span {
    font-weight: 500;
    color: var(--text-primary, #1f2937);
}

[data-theme="dark"] .merger-feature-item span {
    color: #e2e8f0;
}

/* Buttons */
.merger-back-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin: 1rem 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.merger-back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.merger-analysis-button {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin: 1rem 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.merger-analysis-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #16a34a, #059669);
}

/* Upload preview */
.merger-upload-preview {
    padding: 2rem;
    text-align: center;
    border: 2px dashed var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-primary, #f9fafb);
    transition: all 0.3s ease;
}

[data-theme="dark"] .merger-upload-preview {
    background: #1a202c;
    border-color: rgba(255, 255, 255, 0.2);
}

.merger-upload-preview:hover {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.05);
}

[data-theme="dark"] .merger-upload-preview:hover {
    background: rgba(78, 205, 196, 0.1);
}

.merger-upload-preview i {
    font-size: 3rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1rem;
}

[data-theme="dark"] .merger-upload-preview i {
    color: #9ca3af;
}

/* Config preview */
.merger-config-preview {
    padding: 1.5rem;
    background: var(--bg-primary, #f9fafb);
    border-radius: 10px;
    border: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .merger-config-preview {
    background: #1a202c !important;
    color: #e2e8f0;
}

.merger-config-preview .form-group {
    margin-bottom: 1rem;
}

.merger-config-preview label {
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.5rem;
    display: block;
}

.merger-config-preview .form-control {
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-primary, #1f2937);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    opacity: 0.7;
}

[data-theme="dark"] .merger-config-preview .form-control {
    background: #4a5568;
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

/* Card styles */
.merger-card {
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

[data-theme="dark"] .merger-card {
    background: #2d3748;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.merger-card-header {
    background: linear-gradient(135deg, var(--primary-color, #2563eb), var(--secondary-color, #764ba2));
    color: white;
    padding: 1rem 1.5rem;
    border: none;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .merger-card-header {
    background: #1a202c;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.merger-card-body {
    padding: 1.5rem;
}

/* Text utilities for merger */
.text-muted {
    color: var(--text-secondary, #6b7280) !important;
}

[data-theme="dark"] .text-muted {
    color: #cbd5e0 !important;
}

.text-warning {
    color: #f59e0b !important;
}

/* Spacing utilities */
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-3 { margin-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Container and grid for merger */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.5rem;
}

/* Responsive design for merger */
@media (max-width: 768px) {
    .merger-theme-toggle span {
        display: none;
    }

    .merger-coming-soon-card {
        padding: 2rem;
        margin: 0 1rem 3rem;
    }

    .merger-coming-soon-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .merger-feature-preview {
        padding: 1.5rem;
    }

    .merger-feature-list {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .merger-feature-item {
        padding: 0.8rem;
    }

    .merger-back-button,
    .merger-analysis-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        margin: 0.5rem 0.25rem;
    }

    .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .merger-nav-brand {
        font-size: 1.3rem;
    }

    .merger-card-body {
        padding: 1rem;
    }

    .merger-upload-preview {
        padding: 1.5rem;
    }

    .merger-upload-preview i {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .merger-coming-soon-card {
        padding: 1.5rem;
    }

    .merger-feature-preview {
        padding: 1rem;
    }

    .merger-config-preview {
        padding: 1rem;
    }

    .merger-back-button,
    .merger-analysis-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        margin: 0.5rem 0;
        width: 100%;
        justify-content: center;
    }

    .merger-nav-brand {
        font-size: 1.2rem;
    }

    .merger-nav-brand i {
        font-size: 1.5rem;
    }

    .merger-theme-toggle {
        padding: 0.4rem 0.6rem;
        font-size: 12px;
    }

    .merger-theme-toggle i {
        font-size: 14px;
    }
}

