:root {
    /* Color Palette - Professional & Modern */
    --primary-color: #2563eb;       /* Modern Blue */
    --primary-dark: #1e40af;        /* Darker Blue for hover */
    --secondary-color: #64748b;     /* Slate Gray */
    --success-color: #10b981;       /* Emerald Green */
    --warning-color: #f59e0b;       /* Amber */
    --danger-color: #ef4444;        /* Red */
    
    /* Backgrounds - Light */
    --bg-body: #f8fafc;             /* Very light slate */
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-navbar: rgba(255, 255, 255, 0.95);
    
    /* Typography - Light */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --text-main: #1e293b;           /* Dark Slate */
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.05);
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

[data-theme="dark"] {
    /* Backgrounds - Dark */
    --bg-body: #0f172a;             /* Deep slate */
    --bg-surface: #1e293b;          /* Darker slate */
    --bg-card: rgba(30, 41, 59, 0.9);
    --bg-navbar: rgba(15, 23, 42, 0.95);
    
    /* Typography - Dark */
    --text-main: #f1f5f9;           /* Light gray */
    --text-muted: #94a3b8;          /* Muted blue-gray */
    --border-color: rgba(255, 255, 255, 0.1);

    /* Form Elements - Dark */
    --bg-input: #1e293b;
    --border-input: #334155;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Theme-aware Utilities */
.bg-white {
    background-color: var(--bg-surface) !important;
}

.bg-light {
    background-color: var(--bg-body) !important;
}

.bg-body-secondary {
    background-color: var(--bg-body) !important;
    opacity: 0.8;
}

.text-dark {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.card {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-main);
}

.modal-content {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-color);
}

.form-control, .form-select {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-color: var(--border-color);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.table {
    color: var(--text-main);
    border-color: var(--border-color);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: inherit;
    border-bottom-color: var(--border-color);
}

.list-group-item {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* Global Reset & Typography */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    letter-spacing: -0.025em; /* Tighter tracking for headings */
}

a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Navbar */
.navbar {
    backdrop-filter: blur(10px);
    background-color: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
    color: var(--text-main) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main) !important;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    padding: 160px 0 100px;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-surface) 100%);
    position: relative;
    overflow: hidden;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-image {
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: perspective(1000px) rotateY(0deg);
}

/* Progress Sidebar */
.progress-steps {
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
    z-index: 0;
}

.step-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    background-color: var(--bg-surface);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.step-text {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Cards & Forms */
.card {
    background: var(--bg-surface);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-control, .form-select {
    padding: 1rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-surface) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary-color) !important;
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

/* Upload Zones */
.upload-zone {
    border: 2px dashed var(--border-color);
    background-color: var(--bg-body);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.icon-box {
    width: 64px;
    height: 64px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Verification Steps */
.verification-step {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.verification-step.active {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.step-indicator {
    width: 28px;
    height: 28px;
    background-color: #cbd5e1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 1rem;
}

.verification-step.active .step-indicator {
    background-color: var(--primary-color);
}

.camera-wrapper {
    height: 400px;
    box-shadow: var(--shadow-lg);
    position: relative; /* Ensure positioning context */
    background-color: #000; /* Black background behind video */
}

#cameraPlaceholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Above video initially */
    background-color: #333; /* Fallback color */
}

#videoElement {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5; /* Below placeholder initially */
}

.camera-active #cameraPlaceholder {
    display: none !important;
}

.camera-active #videoElement {
    z-index: 20; /* Above everything when active */
    display: block !important;
}

/* Chat Enhancements */
.chat-image-container {
    max-width: 250px;
    margin: 5px 0;
}

.chat-image-container img {
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

.chat-image-container img:hover {
    transform: scale(1.05);
}

.cursor-pointer {
    cursor: pointer;
}

/* Animations */
[data-aos] {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-aos="fade-up"] {
    transform: translateY(20px);
}

[data-aos="fade-left"] {
    transform: translateX(20px);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0);
}

.hover-scale {
    transition: transform 0.2s ease;
}

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

/* Responsive */
@media (max-width: 991.98px) {
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 120px 0 60px;
        text-align: center;
    }
    
    .progress-card {
        display: none;
    }
}
