/* ============================================
   CCTV Store Analytics - Complete UI Redesign
   Neutral Analytics Theme with Glass Morphism
   ============================================ */

/* ============================================
   CSS VARIABLES & THEME
   ============================================ */
:root {
    /* Color Palette - Professional Blue & White Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-solid: #ffffff;
    --bg-hover: rgba(59, 130, 246, 0.05);

    /* Accents - Professional Blue */
    --accent-primary: #2563eb;
    --accent-secondary: #1e40af;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Borders */
    --border-color: rgba(226, 232, 240, 0.8);
    --border-hover: rgba(59, 130, 246, 0.3);

    /* Shadows - Light theme optimized */
    --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.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   GLOBAL RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
}

button {
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-base);
}

input, textarea, select {
    font-family: var(--font-family);
    outline: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* ============================================
   SCREEN SYSTEM
   ============================================ */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn var(--transition-slow);
}

.screen.active {
    display: block;
}

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

/* ============================================
   HERO / LANDING SCREEN
   ============================================ */
.hero-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 1) 0%, rgba(30, 41, 59, 1) 100%);
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-lg);
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.hero-visual {
    position: relative;
    height: 400px;
    z-index: 1;
}

.floating-card {
    position: absolute;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 50%;
    right: 20%;
    animation-delay: -2s;
}

.floating-card.card-3 {
    bottom: 15%;
    left: 30%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.mini-chart {
    display: flex;
    gap: 6px;
    height: 60px;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.chart-bar {
    width: 20px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    transition: height var(--transition-base);
}

.card-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pulse-indicator {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    margin-bottom: 0.75rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.projects-section {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.section-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.filter-btn.active,
.filter-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon svg {
    stroke: var(--text-muted);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

.btn-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   UPLOAD SCREEN
   ============================================ */
.upload-header-modern {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.btn-back-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: all var(--transition-base);
}

.btn-back-modern:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.upload-title-section h2 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-base);
    margin-bottom: 1.5rem;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.05);
}

.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    margin-bottom: 1rem;
}

.upload-icon svg {
    stroke: var(--accent-primary);
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.upload-formats {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.upload-progress {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    transition: width var(--transition-base);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.objectives-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.objective-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.objective-card.selected {
    border-color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.1);
}

.objective-icon {
    margin-bottom: 1rem;
}

.objective-icon svg {
    stroke: var(--accent-primary);
}

.objective-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.objective-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ============================================
   ZONE SETUP SCREEN
   ============================================ */
.zones-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.zones-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.zones-actions {
    display: flex;
    gap: 1rem;
}

.zones-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.zones-canvas-container {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#zones-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.zones-toolbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.tool-btn {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.tool-btn:hover,
.tool-btn.active {
    background: var(--accent-primary);
    color: white;
}

.tool-divider {
    width: 1px;
    background: var(--border-color);
}

.zones-hint {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.zones-sidebar {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

.zones-sidebar h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.zone-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap; /* Prevent wrapping */
}

.zone-name-input {
    flex: 1;
    min-width: 0; /* Allow input to shrink */
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.btn-draw-zone {
    flex-shrink: 0; /* Prevent button from shrinking */
    padding: 0.75rem 1rem; /* Reduced from 0.75rem 1.5rem */
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    white-space: nowrap; /* Prevent text wrapping */
}

.zone-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.preset-chip {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-chip:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.zones-list {
    min-height: 200px;
}

.empty-zones {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 2rem 0;
}

/* ============================================
   PROCESSING SCREEN (NEW DESIGN)
   ============================================ */
.processing-overlay {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.processing-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.processing-content-center {
    max-width: 800px;
    width: 100%;
    text-align: center;
    z-index: 1;
}

/* Circular Progress Ring */
.progress-ring-container {
    position: relative;
    margin: 0 auto 2rem;
    width: 200px;
    height: 200px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 12;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.processing-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.processing-subtitle {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Status Cards */
.status-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.5s forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.status-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.1);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}

.status-card-content {
    flex: 1;
    text-align: left;
}

.status-card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-card.completed .status-card-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Findings Feed Compact */
.findings-feed-compact {
    max-height: 200px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

/* ============================================
   APP LAYOUT (Results Screen)
   ============================================ */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.app-sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
    position: relative;
    z-index: 100;
    overflow-x: hidden;
}

.app-sidebar.collapsed {
    width: 64px;
}

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

.logo-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    padding: 2px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-sidebar.collapsed .sidebar-footer {
    padding: 1.5rem 0.75rem;
}

.app-sidebar.collapsed .sidebar-toggle {
    margin-left: 2px !important;
}

.app-sidebar.collapsed .nav-item span,
.app-sidebar.collapsed .btn-sidebar-action span {
    display: none;
}

.app-sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.875rem 0.75rem;
}

.app-sidebar.collapsed .btn-sidebar-action {
    justify-content: center;
    padding: 0.75rem;
}

/* Hide logo text in collapsed state, keep only icon */
.app-sidebar.collapsed .logo-compact svg {
    margin: 0;
}

/* Adjust sidebar header padding in collapsed state */
.app-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.5rem 0.75rem;
}

.app-sidebar.collapsed .nav-item {
    position: relative;
}

.app-sidebar.collapsed .nav-item::after {
    content: attr(data-tab);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    text-transform: capitalize;
}

.app-sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    transition: all var(--transition-base);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
}

.nav-item.active::before {
    transform: scaleY(1);
}

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

.btn-sidebar-action {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.btn-sidebar-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

.content-area {
    flex: 1;
    overflow: auto; 
}

.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Add this - prevents header from shrinking */
    position: sticky; /* Add this */
    top: 0; /* Add this */
    z-index: 50; /* Add this */
}

.header-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-meta .divider {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-header-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-header-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-header-action-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-header-action-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-header-action-ai {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
}

.btn-header-action-success {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.btn-header-action-ai:hover,
.btn-header-action-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Empty State Card */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin: 2rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-state-icon svg {
    stroke: var(--accent-primary);
}

.empty-state-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    max-width: 400px;
}

/* Split Pane Layout */
.split-pane-container {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 0;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.video-pane {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
}

.video-player-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 0;
}

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

.video-header h3 {
    font-size: 1.125rem;
}

.video-controls-toggle {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.toggle-btn:hover,
.toggle-btn.active {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
    background: black;
}

.results-video {
    width: 100%;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.btn-compare {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.btn-compare:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-secondary);
    transform: translateY(-1px);
}

/* Content Pane */
.content-pane {
    overflow-y: scroll;
    padding: 0;
    background: var(--bg-primary);
    height: calc(100vh - 100px);
}

/* Force scrollbar to always show - DARK and VISIBLE */
.content-pane::-webkit-scrollbar {
    width: 14px;
}

.content-pane::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-left: 1px solid #cbd5e1;
}

.content-pane::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 7px;
    border: 2px solid #e2e8f0;
}

.content-pane::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Also add scrollbar to individual tabs for extra safety */
.tab-content {
    display: none;
    animation: fadeIn var(--transition-base);
    min-height: calc(100vh - 150px);
    padding: 2rem;
    overflow-y: auto;
}

.tab-content::-webkit-scrollbar {
    width: 14px;
}

.tab-content::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.tab-content::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 7px;
    border: 2px solid #e2e8f0;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.tab-content.active {
    display: block;
}

/* ============================================
   CARD COMPONENTS (Glass Morphism)
   ============================================ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.1);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}

/* ============================================
   COMPARISON MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-base);
}

.modal-overlay.active {
    display: flex;
}

.modal-large {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: scaleIn var(--transition-base);
}

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

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

.modal-header h3 {
    font-size: 1.5rem;
}

.btn-close {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-close:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.modal-header-left {
    display: flex;
    align-items: center;
}

.modal-header-left h3 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-sync {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-base);
}

.btn-sync:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
}

.comparison-video-wrapper {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.comparison-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.625rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    z-index: 10;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-label svg {
    color: #64748b;
}

.comparison-label-ai {
    background: #ffffff;
    border: 2px solid #8b5cf6;
}

.comparison-label-ai svg {
    color: #8b5cf6;
}

.comparison-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.comparison-divider-label {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.comparison-video {
    width: 100%;
    border-radius: var(--radius-lg);
    background: black;
}

.comparison-divider {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
    margin: 0 1rem;
}

.comparison-controls {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-sync {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-sync:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .split-pane-container {
        grid-template-columns: 400px 1fr;
    }
}

@media (max-width: 1024px) {
    .hero-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        display: none;
    }

    .upload-container {
        grid-template-columns: 1fr;
    }

    .split-pane-container {
        grid-template-columns: 1fr;
    }

    .video-pane {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .app-sidebar {
        width: 64px;
    }

    .app-sidebar .nav-item span,
    .btn-sidebar-action span {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .objectives-grid {
        grid-template-columns: 1fr;
    }

    .zones-content {
        grid-template-columns: 1fr;
    }

    .comparison-container {
        grid-template-columns: 1fr;
    }

    .comparison-divider {
        display: none;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* ============================================
   NEW INNOVATIVE HOME PAGE
   ============================================ */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.home-left {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    z-index: 2;
}

.home-right {
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    position: relative;
    z-index: 2;
}

/* Brand Section */
.brand-section {
    text-align: left;
}

.logo-large {
    margin-bottom: 1.5rem;
    animation: float 6s ease-in-out infinite;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.brand-tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
}

/* Features List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.1);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.feature-icon svg {
    stroke: var(--accent-primary);
}

.feature-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.feature-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Upload Card Main */
.upload-card-main {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.upload-header-main {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-header-main h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-header-main p {
    color: var(--text-secondary);
}

/* Upload Zone Main */
.upload-zone-main {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-base);
    margin-bottom: 2rem;
    position: relative;
}

.upload-zone-main:hover {
    border-color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.05);
    transform: scale(1.02);
}

.upload-zone-main.drag-over {
    border-color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

.upload-zone-content {
    pointer-events: none;
}

.upload-icon-large {
    margin-bottom: 1.5rem;
}

.upload-icon-large svg {
    stroke: var(--accent-primary);
    animation: float 3s ease-in-out infinite;
}

.upload-prompt {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Upload Progress Main */
.upload-progress-main {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.file-preview svg {
    stroke: var(--accent-primary);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar-main {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill-main {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    transition: width var(--transition-base);
    width: 0%;
}

.progress-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Form Fields Main */
.form-fields-main {
    margin-bottom: 2rem;
}

.form-group-inline {
    margin-bottom: 1rem;
}

.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-main {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.input-main:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.input-main::placeholder {
    color: var(--text-muted);
}

/* Features Badge */
.features-badge {
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.features-badge-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.features-badge-header svg {
    stroke: var(--accent-primary);
}

.features-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag {
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Analyze Button Main */
.btn-analyze-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.125rem 2rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.btn-analyze-main:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-analyze-main:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animated Background */
.home-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orb-float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4) 0%, transparent 70%);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

/* Responsive Home Page */
@media (max-width: 1024px) {
    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-left {
        padding: 3rem 2rem;
    }

    .home-right {
        padding: 3rem 2rem;
    }

    .brand-title {
        font-size: 2.5rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .home-left {
        padding: 2rem 1.5rem;
    }

    .home-right {
        padding: 2rem 1.5rem;
    }

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

    .upload-card-main {
        padding: 2rem 1.5rem;
    }

    .form-row-inline {
        grid-template-columns: 1fr;
    }

    .features-list {
        gap: 1rem;
    }

    .feature-item {
        padding: 1rem;
    }
}

/* ============================================
   ANALYTICS GRID & CHARTS
   ============================================ */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-value {
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ai-summary {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    line-height: 1.8;
    color: var(--text-secondary);
}

/* People List */
.people-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.person-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-base);
}

.person-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

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

.person-id {
    font-weight: 600;
    color: var(--text-primary);
}

.person-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.person-stat {
    text-align: center;
}

.person-stat .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.person-stat .stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Anomalies */
.anomalies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.anomaly-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.anomaly-card:hover {
    border-color: var(--danger);
    transform: translateX(4px);
}

.anomaly-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.anomaly-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.anomaly-icon svg {
    stroke: currentColor;
}

.anomaly-content {
    flex: 1;
}

.anomaly-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.anomaly-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.anomaly-time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.zone-avoidance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.zone-avoidance-card {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.zone-avoidance-card.avoided {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.zone-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.zone-status {
    margin-top: 0.5rem;
}

/* Zone Item */
.zone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.btn-remove-zone {
    padding: 0.25rem;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   DASHBOARD TAB STYLES
   ============================================ */
.dash-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dash-metric-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.dash-card-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.dash-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.dash-metric-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.dash-metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.dash-metric-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.dash-metric-jump {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all var(--transition-base);
}

.dash-metric-jump:hover {
    background: var(--accent-secondary);
    transform: scale(1.1);
}

/* Activity Flow Heatmap */
.dash-heatmap-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dash-heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dash-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.heatmap-legend {
    display: flex;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.heatmap-track {
    display: flex;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.heatmap-block {
    height: 100%;
    transition: opacity 0.2s;
    cursor: pointer;
}

.heatmap-block:hover {
    opacity: 0.8;
}

.heatmap-time-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Bottom Row */
.dash-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
}

.dash-dwell-section, .dash-insights-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.dwell-donut-wrap {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.dwell-donut {
    flex-shrink: 0;
}

.dwell-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dwell-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dwell-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dwell-legend-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.dwell-legend-pct {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--accent-primary);
}

/* Top Insights */
.dash-insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-insight-card {
    position: relative;
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition: all var(--transition-base);
}

.dash-insight-card:hover {
    background: var(--bg-hover);
}

.dash-insight-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.dash-insight-stripe.queue { background: #EF4444; }
.dash-insight-stripe.crowd { background: #F59E0B; }
.dash-insight-stripe.promo { background: #10B981; }
.dash-insight-stripe.bounce { background: #DD1D21; }

.dash-insight-body {
    flex: 1;
}

.dash-insight-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.dash-insight-cat {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dash-insight-cat.queue { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.dash-insight-cat.crowd { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.dash-insight-cat.promo { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.dash-insight-cat.bounce { background: rgba(221, 29, 33, 0.15); color: #DD1D21; }

.dash-conf-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.dash-conf-badge.high { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.dash-conf-badge.medium { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.dash-conf-badge.low { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

.dash-insight-card h5 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.dash-insight-jump {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.dash-insight-jump:hover {
    background: var(--accent-secondary);
    transform: translateX(2px);
}

.dash-limitations {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dash-limitations svg {
    color: #F59E0B;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ============================================
   HIGHLIGHTS TAB STYLES
   ============================================ */
.hl-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.highlights-container {
    padding: 1.5rem;
}

.hl-header-row {
    margin-bottom: 1.5rem;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.hl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.hl-card:hover {
    transform: translateY(-2px); /* Reduced from -4px */
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.hl-visual {
    position: relative;
    width: 100%;
    height: 120px; /* Reduced from 180px */
    background: var(--bg-secondary);
    overflow: hidden;
}

.hl-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hl-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.hl-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.hl-card:hover .hl-overlay {
    opacity: 1;
}

.hl-play-circle {
    width: 48px; /* Reduced from 56px */
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-fast);
}

.hl-card:hover .hl-play-circle {
    transform: scale(1.1);
}

.hl-cat-badge {
    position: absolute;
    top: 0.5rem; /* Reduced from 0.75rem */
    left: 0.5rem;
    padding: 0.25rem 0.625rem; /* Reduced padding */
    border-radius: var(--radius-md);
    font-size: 0.6875rem; /* Reduced from 0.75rem */
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    backdrop-filter: blur(10px);
}

.hl-time-badge {
    position: absolute;
    bottom: 0.5rem; /* Reduced from 0.75rem */
    right: 0.5rem;
    padding: 0.25rem 0.625rem; /* Reduced padding */
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-size: 0.6875rem; /* Reduced from 0.75rem */
    font-weight: 600;
    color: white;
}

.hl-info {
    padding: 0.875rem; /* Reduced from 1.25rem */
}

.hl-info h5 {
    font-size: 0.875rem; /* Reduced from 1rem */
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hl-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hl-dur-chip {
    padding: 0.25rem 0.5rem; /* Reduced padding */
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem; /* Reduced from 0.875rem */
    font-weight: 600;
}


/* Responsive adjustments */
@media (max-width: 1400px) {
    .hl-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 1024px) {
    .hl-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .hl-visual {
        height: 100px;
    }
}

@media (max-width: 768px) {
    .hl-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

.hl-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.hl-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hl-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.hl-category-badge.queue { background: rgba(59, 130, 246, 0.9); color: white; }
.hl-category-badge.crowd { background: rgba(245, 158, 11, 0.9); color: white; }
.hl-category-badge.promo { background: rgba(16, 185, 129, 0.9); color: white; }
.hl-category-badge.bounce { background: rgba(221, 29, 33, 0.9); color: white; }

.hl-time-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.hl-content {
    padding: 1.25rem;
}

.hl-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.hl-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.hl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Changed from 320px to 200px */
    gap: 1rem; /* Reduced from 1.5rem to 1rem */
}

.hl-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   PEOPLE TAB STYLES
   ============================================ */
.people-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.people-empty svg {
    margin-bottom: 1rem;
}

.people-empty h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.people-container {
    padding: 1.5rem;
}

.people-summary-bar {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.people-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.people-stat-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.people-stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.person-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
}

.person-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.person-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.person-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.person-card-info {
    flex: 1;
}

.person-card-info h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.person-exit-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.person-conf-badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.person-conf-badge.high { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.person-conf-badge.medium { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.person-conf-badge.low { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

.person-stats-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.person-mini-stat {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.person-mini-stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

.person-journey-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.journey-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.journey-step:hover {
    background: var(--bg-hover);
}

.journey-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.journey-step-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.journey-step-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.journey-connector {
    width: 20px;
    height: 2px;
    background: var(--border-color);
    flex-shrink: 0;
}

.person-journey-detail {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.person-journey-step-detail {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.person-journey-step-detail:hover {
    background: var(--bg-hover);
}

.pjsd-time {
    color: var(--accent-primary);
    font-weight: 600;
}

.pjsd-zone {
    color: var(--text-primary);
    font-weight: 500;
}

.pjsd-dwell {
    color: var(--text-muted);
}

.pjsd-actions {
    grid-column: 2 / -1;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-style: italic;
}

.person-keyframes {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.person-kf-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.person-kf-thumb:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

/* ============================================
   ANALYTICS TAB STYLES
   ============================================ */
.analytics-container {
    padding: 1.5rem;
}

.analytics-row-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.analytics-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
}

/* Customer Journey Patterns (Clusters) */
.cluster-layout {
    display: flex;
    gap: 2rem;
    align-items: start;
}

.cluster-pie {
    flex-shrink: 0;
}

.cluster-cards-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cluster-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.cluster-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cluster-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.cluster-card-header strong {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.cluster-pct {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9375rem;
}

.cluster-card-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.cluster-card-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Peak vs Off-Peak */
.temporal-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
}

.temporal-half {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.temporal-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.temporal-window {
    font-size: 0.8125rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.temporal-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.temporal-stat:last-child {
    border-bottom: none;
}

.temporal-stat span {
    color: var(--text-muted);
}

.temporal-stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

.temporal-divider {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.temporal-delta {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.temporal-delta span {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.temporal-delta strong {
    font-size: 1.125rem;
    font-weight: 700;
}

.temporal-delta strong.pos {
    color: #10B981;
}

.temporal-delta strong.neg {
    color: #EF4444;
}

/* Dwell-Time Distribution */
.dwell-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dwell-row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 1rem;
    align-items: center;
}

.dwell-zone-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dwell-bar-wrap {
    height: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.dwell-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    transition: width 0.5s ease;
}

.dwell-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}

.dwell-avg {
    color: var(--text-primary);
}

.dwell-avg strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.dwell-med, .dwell-p90 {
    color: var(--text-muted);
}

.dwell-visitors {
    color: var(--text-secondary);
}

.dwell-long {
    color: #F59E0B;
}

/* Flow Direction */
.flow-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.flow-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
}

.flow-card-header {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.flow-arrow-wrap {
    margin: 0.75rem 0;
}

.flow-card-stats {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.flow-card-stats strong {
    color: var(--text-primary);
}

/* Queue Detection */
.queue-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.queue-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.queue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.queue-severity-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.queue-severity-ring {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.queue-card-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.queue-card-stats > div {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.queue-card-stats span {
    color: var(--text-muted);
}

.queue-card-stats strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   ANOMALIES TAB STYLES
   ============================================ */
.anomalies-container {
    padding: 1.5rem;
}

.anomalies-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.anomalies-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.loitering-alerts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Anomaly Alert Cards */
.anomaly-alert {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.anomaly-alert:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.anomaly-alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.anomaly-alert-body {
    flex: 1;
}

.anomaly-alert-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.anomaly-alert-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.anomaly-zone {
    padding: 0.25rem 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
}

.anomaly-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.anomaly-dur {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.anomaly-dur strong {
    color: #F59E0B;
    font-weight: 700;
}

/* Timeline Bar */
.anomaly-timeline-bar {
    margin-top: 0.75rem;
}

.anomaly-tl-track {
    position: relative;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.anomaly-tl-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.anomaly-tl-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.zone-eng-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.zone-eng-card {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.zone-eng-card:hover {
    box-shadow: var(--shadow-md);
}

.zone-eng-card.zone-eng-avoided {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.zone-eng-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.zone-eng-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.zone-eng-bar-wrap {
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.zone-eng-bar {
    height: 100%;
    border-radius: var(--radius-md);
    transition: width 0.5s ease;
}

.zone-eng-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.zone-eng-stats span {
    display: flex;
    align-items: center;
}

.zone-eng-alert {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--danger);
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.anomalies-row-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.anomalies-staff {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.staff-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.staff-half {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.staff-label {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.staff-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
}

.staff-stat span {
    color: var(--text-muted);
}

.staff-stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

.staff-arrow {
    display: flex;
    align-items: center;
    font-size: 2rem;
    color: var(--text-muted);
}

.staff-deltas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.staff-delta {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.staff-delta span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.staff-delta strong {
    font-size: 1.25rem;
    font-weight: 700;
}

.staff-delta strong.pos {
    color: #10B981;
}

.staff-delta strong.neg {
    color: #EF4444;
}

.staff-recommendation {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.staff-rec-icon {
    font-size: 1.25rem;
}

/* ============================================
   ACTIONS TAB STYLES
   ============================================ */
.actions-container-new {
    padding: 1.5rem;
}

.actions-header-row {
    margin-bottom: 2rem;
}

.actions-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.actions-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

.matrix-labels {
    margin-bottom: 1rem;
}

.matrix-label-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.matrix-label-corner {
    /* Empty corner cell */
}

.impact-effort-matrix {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 1rem;
}

.matrix-row-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.matrix-quadrant {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.matrix-q-header {
    padding: 1rem;
    text-align: center;
}

.matrix-q-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.matrix-q-sub {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.25rem;
}

.matrix-q-body {
    padding: 1rem;
    min-height: 200px;
}

.matrix-q-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.matrix-action-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.matrix-action-card:last-child {
    margin-bottom: 0;
}

.matrix-action-priority {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.matrix-action-body h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
}

.matrix-action-body p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   YOLO OUTPUT MODAL STYLES
   ============================================ */
.yolo-output-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.yolo-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.yolo-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.yolo-output-img {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

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

.yolo-stat-card {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
}

.yolo-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.yolo-stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.yolo-zone-counts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.yolo-zone-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.yolo-zone-count-name {
    font-weight: 600;
    color: var(--text-primary);
}

.yolo-zone-count-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.yolo-zone-in {
    color: #10B981;
    font-weight: 600;
}

.yolo-zone-out {
    color: #3B82F6;
    font-weight: 600;
}

/* ============================================
   ASK VIDEO / CHAT TAB STYLES
   ============================================ */
.chat-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    position: relative;
    padding-bottom: 80px; /* Space for fixed input row */
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-message {
    display: flex;
    gap: 1rem;
    align-items: start;
    animation: slideIn 0.3s ease-out;
}

.chat-message.user {
    flex-direction: row-reverse;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}


.message-bubble {
    max-width: 85%; /* Increased max-width */
    width: fit-content; /* Dynamic width based on content */
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-secondary);
}

.message-bubble ul {
    margin: 0.75rem 0 0 1.25rem;
    padding: 0;
}

.message-bubble li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.chat-message.user .message-bubble li {
    color: rgba(255, 255, 255, 0.9);
}

/* Chat bullet list styling */
.chat-bullet-list {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
}

.chat-bullet-list li {
    position: relative;
    padding-left: 1.5rem;
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.chat-bullet-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.2em;
}

.chat-message.user .chat-bullet-list li {
    color: rgba(255, 255, 255, 0.95);
}

.chat-message.user .chat-bullet-list li::before {
    color: rgba(255, 255, 255, 0.8);
}

.message-citations {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ====================================
   MARKDOWN CHAT STYLING
   ==================================== */

/* Numbered lists */
.chat-numbered-list {
    list-style: none;
    counter-reset: item;
    margin: 0.5rem 0;
    padding: 0;
}

.chat-numbered-list li {
    position: relative;
    padding-left: 2rem;
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--text-primary);
    counter-increment: item;
}

.chat-numbered-list li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Inline code */
.chat-inline-code {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.chat-message.user .chat-inline-code {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Code blocks */
.chat-code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.chat-code-block code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-primary);
}

.chat-message.user .chat-code-block {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Blockquotes */
.chat-blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.chat-message.user .chat-blockquote {
    border-left-color: rgba(255, 255, 255, 0.6);
    color: rgba(255, 255, 255, 0.8);
}

/* Headings in chat */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-bubble h1 { font-size: 1.5em; }
.message-bubble h2 { font-size: 1.3em; }
.message-bubble h3 { font-size: 1.1em; }
.message-bubble h4 { font-size: 1em; }

/* Paragraphs */
.message-bubble p {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.message-bubble p:first-child {
    margin-top: 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

/* Bold and emphasis */
.message-bubble strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-bubble em {
    font-style: italic;
    color: var(--text-muted);
}

/* Links in chat */
.message-bubble a {
    color: var(--accent-primary);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.message-bubble a:hover {
    opacity: 0.8;
}

.chat-message.user .message-bubble a {
    color: rgba(255, 255, 255, 0.95);
}

/* Tables in chat (if needed) */
.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.message-bubble th,
.message-bubble td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.message-bubble th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Horizontal rules */
.message-bubble hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.citation-btn {
    padding: 0.375rem 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.chat-message.assistant.error .message-bubble {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* .chat-input-area {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
} */

/* .suggested-prompts {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
} */

/* .prompt-chip {
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.prompt-chip:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
} */

.chat-input-row {
    position: fixed;
    bottom: 0;
    left: 240px; /* Account for sidebar width */
    right: 0;
    display: flex;
    gap: 0.75rem;
    align-items: end;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.app-sidebar.collapsed ~ .app-main .chat-input-row {
    left: 64px; /* Account for collapsed sidebar */
}

/* 50% width constraint on the input container */
.chat-input-row .chat-input {
    max-width: calc(50vw - 240px - 3rem); /* 50% of viewport minus sidebar and padding */
}

.app-sidebar.collapsed ~ .app-main .chat-input-row .chat-input {
    max-width: calc(50vw - 64px - 3rem); /* Adjust for collapsed sidebar */
}

.chat-input {
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    min-width: 75%;
    transition: all var(--transition-fast);
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

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

/* ============================================
   WEB APPLICATION HOME PAGE
   ============================================ */

.app-home-container {
    min-height: 100vh;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.app-home-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

/* Main Content */
.app-home-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Hero Section */
.app-hero-section {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.app-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.app-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.app-hero-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.btn-upload-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.btn-upload-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.4);
}

/* Analytics Grid */
.app-analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.app-analytics-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.75rem;
    transition: all 0.3s ease;
}

.app-analytics-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.analytics-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.app-analytics-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.app-analytics-card p {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
}

/* Quick Stats */
.app-quick-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-stat-item {
    text-align: center;
}

.quick-stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.quick-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ====================================
   PREVIOUS ANALYSES HISTORY
   ==================================== */

.analyses-history-section {
    margin-top: 3rem;
}

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

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.btn-clear-history {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-history:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-clear-history svg {
    width: 16px;
    height: 16px;
}

.analyses-history-list {
    display: grid;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for history list */
.analyses-history-list::-webkit-scrollbar {
    width: 8px;
}

.analyses-history-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.analyses-history-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.analyses-history-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #06b6d4;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.1);
    transform: translateY(-2px);
}

.history-item-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    border-radius: 0.5rem;
    color: white;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.history-item-actions {
    flex-shrink: 0;
}

.history-delete-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.history-delete-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.empty-history {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.empty-history p {
    font-size: 1.125rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 0.5rem 0;
}

.empty-history span {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Logout button */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-logout svg {
    width: 20px;
    height: 20px;
}

/* Upload Modal */
.upload-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.upload-modal-overlay.active {
    display: flex;
}

.upload-modal {
    background: white;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 1000px; /* Increased from 700px */
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.75rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.upload-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.upload-modal-body {
    padding: 2rem;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: 380px 1fr; /* Two column layout */
    gap: 2rem;
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 2rem 1.5rem; /* Reduced from 3rem 2rem */
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    margin-bottom: 0; /* Remove margin since we're in grid */
    height: fit-content;
    min-height: 200px; /* Reduced from implicit height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-dropzone:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    transform: scale(1.02);
}

.upload-dropzone.drag-over {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.08);
    transform: scale(1.05);
}

.upload-dropzone svg {
    stroke: #8b5cf6;
    margin-bottom: 1rem;
    width: 40px; /* Reduced from 48px */
    height: 40px;
}

.upload-dropzone h3 {
    font-size: 1rem; /* Reduced from 1.125rem */
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.upload-dropzone p {
    font-size: 0.875rem; /* Reduced from 0.9375rem */
    color: #64748b;
    margin-bottom: 0.75rem;
}

.upload-formats {
    font-size: 0.8125rem; /* Reduced from 0.875rem */
    color: #94a3b8;
}

/* Upload Progress */
/* Upload Progress - Left Column */
.upload-progress-area {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 0;
    height: fit-content;
}

.upload-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 0; /* Remove margin since we're in grid */
    grid-column: 2; /* Ensure it's in the right column */
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    min-width: 0; /* Important for flex overflow handling */
}

.file-preview-item svg {
    stroke: #8b5cf6;
    flex-shrink: 0;
}

.file-info-area {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.file-name-text {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.file-size-text {
    font-size: 0.875rem;
    color: #64748b;
}

.progress-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #8b5cf6);
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-status-text {
    font-size: 0.875rem;
    color: #475569;
    text-align: center;
}

/* Form Fields */
.upload-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #1e293b;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.analytics-enabled-badge {
    grid-column: 1 / -1; /* Span both columns */
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin-top: 1rem;
}

.analytics-enabled-badge svg {
    stroke: #8b5cf6;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Modal Actions */
.upload-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.btn-modal-cancel {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
    background: #f8fafc;
    color: #1e293b;
}

.btn-modal-analyze {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-modal-analyze:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.btn-modal-analyze:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .app-home-main {
        padding: 2rem 1rem;
        gap: 2rem;
    }

    .app-hero-title {
        font-size: 2rem;
    }

    .app-analytics-grid {
        grid-template-columns: 1fr;
    }

    .app-quick-stats {
        flex-direction: column;
        gap: 2rem;
    }

    .upload-modal {
        margin: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .upload-modal {
        max-width: 95%;
        margin: 1rem;
    }
    
    .upload-modal-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .upload-form-fields {
        grid-column: 1;
    }
    
    .analytics-enabled-badge {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .upload-modal-body {
        padding: 1.5rem;
    }
    
    .upload-dropzone {
        min-height: 180px;
        padding: 1.5rem 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LOGIN SCREEN - ENHANCED WITH ANIMATIONS
   ============================================ */

/* Base login layout */
.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Animated gradient background for left side */
.login-left {
    background: linear-gradient(-45deg, #e0f2fe, #f0f9ff, #dbeafe, #e0f2fe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated background orbs */
.login-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Enhanced floating orbs with glow */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.4;
    animation: float-orb 25s ease-in-out infinite;
    box-shadow: 0 0 80px rgba(6, 182, 212, 0.3);
}

.floating-orb.orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.5) 0%, rgba(6, 182, 212, 0.1) 50%, transparent 70%);
    top: -225px;
    left: -225px;
    animation-delay: 0s;
}

.floating-orb.orb-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.5) 0%, rgba(139, 92, 246, 0.1) 50%, transparent 70%);
    bottom: -180px;
    right: -180px;
    animation-delay: -7s;
}

.floating-orb.orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(236, 72, 153, 0.1) 50%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

.floating-orb.orb-4 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0.1) 50%, transparent 70%);
    top: 20%;
    right: 15%;
    animation-delay: -21s;
}

@keyframes float-orb {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(60px, -60px) scale(1.15) rotate(90deg);
    }
    50% {
        transform: translate(-40px, 40px) scale(0.85) rotate(180deg);
    }
    75% {
        transform: translate(50px, 70px) scale(1.05) rotate(270deg);
    }
}

/* Enhanced left content with slide-in animation */
.login-left-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    color: #1e293b;
    animation: fadeInLeft 0.8s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animated brand section */
.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s ease-out 0.2s backwards;
}

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

.brand-icon {
    animation: rotate-pulse 8s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(6, 182, 212, 0.4));
}

@keyframes rotate-pulse {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 6s ease infinite;
}

@keyframes gradientText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-tagline {
    font-size: 1.125rem;
    color: #475569;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

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

/* REDESIGNED FEATURE SHOWCASE - Card Grid Style */
.feature-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.feature-showcase-item {
    position: relative;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 2px solid transparent;
    border-radius: 1rem;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Staggered entrance animation */
.feature-showcase-item:nth-child(1) {
    animation: featureSlideIn 0.6s ease-out 0.8s forwards;
}

.feature-showcase-item:nth-child(2) {
    animation: featureSlideIn 0.6s ease-out 1s forwards;
}

.feature-showcase-item:nth-child(3) {
    animation: featureSlideIn 0.6s ease-out 1.2s forwards;
}

@keyframes featureSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animated gradient border on hover */
.feature-showcase-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-showcase-item:hover::before {
    opacity: 1;
}

.feature-showcase-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

/* Animated shine effect on hover */
.feature-showcase-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.feature-showcase-item:hover::after {
    opacity: 1;
    animation: shine 1.5s ease;
}

@keyframes shine {
    from {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    to {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Feature icon with pulse animation */
.feature-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
    }
}

/* Rotating gradient border for icon */
.feature-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(45deg, #06b6d4, #8b5cf6, #ec4899, #06b6d4);
    background-size: 300% 300%;
    border-radius: 14px;
    z-index: -1;
    animation: rotateBorder 4s linear infinite;
    opacity: 0.6;
}

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

.feature-showcase-item h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.feature-showcase-item p {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Right side animations */
.login-right {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow-y: auto;
    animation: fadeIn 0.8s ease-out 0.3s backwards;
}

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

.login-form-container {
    width: 100%;
    max-width: 420px;
    animation: slideInRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s backwards;
}

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

/* Form header animation */
.login-form-header {
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out 0.6s backwards;
}

.login-form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.login-form-header p {
    color: #64748b;
    font-size: 0.9375rem;
}

/* Staggered form field animations */
.form-group-login {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-group-login:nth-child(1) {
    animation-delay: 0.7s;
}

.form-group-login:nth-child(2) {
    animation-delay: 0.8s;
}

.form-group-login label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

/* Input container */
.input-with-icon {
    position: relative;
}

.input-with-icon svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    stroke: #94a3b8;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Enhanced input focus animation */
.input-with-icon input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-with-icon input:focus {
    outline: none;
    border-color: #06b6d4;
    background: white;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1), 0 8px 16px rgba(6, 182, 212, 0.15);
    transform: translateY(-2px);
}

.input-with-icon input:focus + svg {
    stroke: #06b6d4;
    transform: translateY(-50%) scale(1.1);
}

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #06b6d4;
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.875rem;
    color: #64748b;
}

.forgot-password {
    font-size: 0.875rem;
    color: #06b6d4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #0891b2;
}

/* Button with ripple effect */
.btn-login-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.9s backwards;
}

.btn-login-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
    background-position: 100% 50%;
}

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

.btn-login-primary svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.btn-login-primary:hover svg {
    transform: translateX(6px);
}

/* Divider */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e2e8f0;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    padding: 0 1rem;
    background: white;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Social login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}

/* Login footer */
.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    color: #64748b;
    font-size: 0.9375rem;
}

.signup-link {
    color: #06b6d4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.signup-link:hover {
    color: #0891b2;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .login-layout {
        grid-template-columns: 1fr;
    }
    
    .login-left {
        display: none;
    }
    
    .login-right {
        padding: 2rem 1.5rem;
    }
    
    .login-form-container {
        animation: fadeIn 0.6s ease-out;
    }
}

@media (max-width: 640px) {
    .feature-showcase {
        grid-template-columns: 1fr;
    }
    
    .login-form-header h2 {
        font-size: 1.75rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
}

/* Logo containers */
.login-logo-left,
.login-logo-right {
    position: absolute;
    top: 2rem;
    z-index: 10;
    animation: fadeInDown 0.8s ease-out 0.2s backwards;
}

.login-logo-left {
    left: 2rem;
}

.login-logo-right {
    right: 2rem;
}

.logo-image {
    height: 28px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Add top padding to login-left-content to avoid overlap */
.login-left-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    color: #1e293b;
    animation: fadeInLeft 0.8s ease-out;
    padding-top: 80px; /* Add this to push content down */
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .login-logo-left {
        display: none; /* Hide left logo on mobile since left section is hidden */
    }
    
    .login-logo-right {
        top: 1.5rem;
        right: 1.5rem;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .login-left-content {
        padding-top: 0; /* Reset padding on mobile */
    }
}

@media (max-width: 640px) {
    .login-logo-right {
        top: 1rem;
        right: 1rem;
    }
    
    .logo-image {
        height: 35px;
    }
}