/* Refactored for CSS Variables - 2025-08-16 */
/**
 * Theme Variables - WCAG AA Compliant Color System
 * All color combinations have been validated for minimum contrast ratios
 * Normal text: 4.5:1, Large text: 3:1, UI elements: 3:1
 */

:root {
  /* Light Theme (Default) */
  --bg-surface: #FFFFFF;
  --bg-card: #F5F5F5;
  --bg-input: #FFFFFF;
  --bg-hover: #F0F0F0;
  
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #888888;
  --text-on-accent: #FFFFFF;
  
  --border-default: #949494;  /* Darker border for 3:1 contrast */
  --border-subtle: #F0F0F0;
  --border-focus: #667eea;
  --bg-hover-alpha: rgba(255, 255, 255, 0.1);
  
  --link: #2563EB;
  --link-hover: #1D4ED8;
  --error: #DC2626;
  --success: #047857;  /* Darker green for better contrast */
  --warning: #D97706;
  
  /* Dark Theme - WCAG AA Compliant */
  --bg-surface-dark: #181A1B;        /* Base background */
  --bg-card-dark: #232526;           /* Card/elevated surfaces (5% lighter) */
  --bg-input-dark: #2D2F30;          /* Input fields (10% lighter) */
  --bg-hover-dark: #2F3133;          /* Hover states */
  
  --text-primary-dark: #F3F3F3;      /* Main text on dark bg (13.5:1 contrast) */
  --text-secondary-dark: #B0B0B0;    /* Secondary text (7.3:1 contrast) */
  --text-muted-dark: #888888;        /* De-emphasized (4.9:1 contrast) */
  --text-on-accent-dark: #FFFFFF;    /* Text on colored backgrounds */
  
  --border-default-dark: #575A5E;    /* Visible borders (3.5:1 contrast) */
  --border-subtle-dark: #353738;     /* Subtle dividers */
  --border-focus-dark: #6DB3F2;      /* Focus indicators */
  --bg-hover-alpha-dark: rgba(0, 0, 0, 0.1);
  
  /* Special Cases for Dark Theme */
  --text-on-light-dark: #1A1A1A;    /* For light backgrounds in dark mode */
  --link-dark: #6DB3F2;              /* Accessible blue (5.1:1 on dark) */
  --link-hover-dark: #93C5FD;        /* Lighter on hover */
  --error-dark: #FF6B6B;             /* Error red (5.2:1 on dark) */
  --success-dark: #51CF66;           /* Success green (5.0:1 on dark) */
  --warning-dark: #FFD93D;           /* Warning yellow (11.4:1 on dark) */
  
  /* Status background colors for light theme */
  --success-bg: #d4edda;
  --success-text: #155724;
  --error-bg: #f8d7da;
  --error-text: #721c24;
  --warning-bg: #fff3cd;
  --warning-text: #856404;
  --info-bg: #e3f2fd;
  --info-text: #1565c0;
  --info: #2196f3;
  --info-hover: #1976d2;
  --warning-hover: #B87F04;
  --success-hover: #036E47;
  
  /* Status background colors for dark theme */
  --success-bg-dark: rgba(34, 139, 34, 0.2);
  --success-text-dark: #51CF66;
  --error-bg-dark: rgba(220, 53, 69, 0.2);
  --error-text-dark: #FF6B6B;
  --warning-bg-dark: rgba(255, 193, 7, 0.2);
  --warning-text-dark: #FFD93D;
  --info-bg-dark: rgba(33, 150, 243, 0.2);
  --info-text-dark: #6DB3F2;
  --info-hover-dark: #5CA3E2;
  --warning-hover-dark: #FFC707;
  --success-hover-dark: #3EBF52;
  
  /* Navbar colors */
  --navbar-bg: #2c3e50;
  --navbar-text: #ffffff;
  --navbar-hover: rgba(255, 255, 255, 0.1);
  --navbar-bg-dark: #1a1a1a;
  --navbar-text-dark: #f3f3f3;
  --navbar-hover-dark: rgba(255, 255, 255, 0.1);
  
  /* Additional theme colors */
  --primary-dark: #5a4ba2;
  --primary-shadow: rgba(102, 126, 234, 0.3);
  --shadow-color-md: rgba(0, 0, 0, 0.15);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-color: rgba(0, 0, 0, 0.3);
  
  --shadow-sm-dark: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md-dark: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg-dark: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  
  /* Additional theme colors */
  --primary-color: var(--link);
  --primary: #2553a0;  /* Darker primary for better contrast */
  --primary-dark: #1d4080;  /* Even darker for hover states */
  --primary-bg-light: rgba(102, 126, 234, 0.1);
  --primary-bg-medium: rgba(102, 126, 234, 0.3);
  --primary-hover: #1d4080;
  --primary-light: #A29BFE;
  --success-color: var(--success);
  --danger-color: var(--error);
  --warning-color: var(--warning);
  --info-color: var(--link);
  
  --hover-overlay: rgba(0, 0, 0, 0.05);
  --border-light: rgba(255, 255, 255, 0.2);
  --hover-color: var(--bg-hover);
  --focus-color: #e5e7eb;
  --danger-bg-light: #fee2e2;
  --overlay-dark: rgba(0, 0, 0, 0.5);
  --skeleton-base: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  --shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.3);
  --link-shadow: rgba(52, 152, 219, 0.3);
  --bg-overlay: rgba(255, 255, 255, 0.95);
  --error-dark-bg: #2a1a1a;
  --error-dark-border: #553333;
  --success-dark-bg: #1a2a1a;
  --success-dark-border: #335533;
  --warning-hover: #e68900;
  --success-bg-light: #d1fae5;
  --warning-bg-light: #fcf4e9;
  --error-bg-light: #fadbd8;
  --info-bg-light: #e3f2fd;
  --info-dark: #0c5460;
  --success-dark: #155724;
  --error-border: #fcc;
  --success-border: #c6f6d5;
  --warning-border: #fed7d7;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --error-shadow: rgba(220, 53, 69, 0.7);
  --info-hover: #1976d2;
  --warning-shadow: rgba(243, 156, 18, 0.3);
  
  /* Legacy support */
  --white: #FFFFFF;
  --background-color: var(--bg-surface);
  --text-color: var(--text-primary);
  --border-color: var(--border-default);
}

/* Mobile Enhancements - Boost contrast for outdoor viewing */
@media (max-width: 768px) {
  :root {
    /* Light theme mobile adjustments */
    --text-primary: #000000;        /* Pure black for maximum contrast */
    --text-secondary: #4A4A4A;      /* Darker secondary text */
    
    /* Dark theme mobile adjustments */
    --text-primary-dark: #FFFFFF;   /* Pure white for mobile */
    --text-secondary-dark: #C0C0C0; /* Brighter secondary */
    --border-default-dark: #606366; /* More visible borders (3.8:1 contrast) */
  }
}

/* OLED Display Optimizations */
@media (prefers-color-scheme: dark) and (display-mode: fullscreen) {
  :root {
    --bg-surface-dark: #000000;     /* Pure black for OLED battery saving */
    --bg-card-dark: #0A0A0A;        /* Near black for cards */
    --bg-input-dark: #141414;       /* Slightly lighter for inputs */
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    /* Light theme high contrast */
    --text-primary: #000000;
    --text-secondary: #000000;
    --border-default: #000000;
    
    /* Dark theme high contrast */
    --bg-surface-dark: #000000;
    --bg-card-dark: #1A1A1A;
    --text-primary-dark: #FFFFFF;
    --text-secondary-dark: #FFFFFF;
    --border-default-dark: #FFFFFF;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Media - Force light theme with high contrast */
@media print {
  :root {
    --bg-surface: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #000000;
    --border-default: #000000;
  }
}  --accent-bg-light: #fed7e2;
  --info-bg-light: #bee3f8;
  --bg-card-alpha: rgba(255, 255, 255, 0.9);
  --overlay-light: rgba(0, 0, 0, 0.2);
  --text-on-dark: rgba(255, 255, 255, 0.8);
  --danger-hover: #c82333;
  --overlay-darker: rgba(0, 0, 0, 0.95);
  --white-alpha-20: rgba(255, 255, 255, 0.2);
  --white-alpha-30: rgba(255, 255, 255, 0.3);
  --white-alpha-10: rgba(255, 255, 255, 0.1);
/* Reset & Normalize */
/* Global Styles */
:root {
    --primary-color: #2c5282;
    --secondary-color: #285e61;
    --accent-color: #ed8936;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #f7fafc;
    --white: #ffffff;
    --error-color: #e53e3e;
    --success-color: #38a169;
    --border-color: var(--border-default);
    --border-radius: 0.375rem;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Default paragraph spacing - scoped to avoid global conflicts */
.content p,
.dashboard p,
.story-content p,
.timeline-content p {
    margin-bottom: 1rem;
}

/* Legal pages have their own spacing rules */
.legal-content p {
    /* Handled by legal.css */
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
/* Desktop Layout */
/* Shared Grid Styles for Dashboard Upgrade */

/* Base Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

/* Auto-fit Grid */
.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(var(--grid-min-width, 300px), 1fr));
}

/* Fixed Column Grids */
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

/* Widget Grid */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

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

/* Masonry Grid */
.masonry-grid {
    column-count: 4;
    column-gap: 1.5rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Grid Item Spans */
.grid-span-2 {
    grid-column: span 2;
}

.grid-span-3 {
    grid-column: span 3;
}

.grid-span-full {
    grid-column: 1 / -1;
}

/* Grid Alignment */
.grid-center {
    place-items: center;
}

.grid-start {
    place-items: start;
}

.grid-stretch {
    place-items: stretch;
}

/* Responsive Grids */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .widget-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .masonry-grid {
        column-count: 1;
    }
    
    /* Reset spans on mobile */
    .grid-span-2,
    .grid-span-3 {
        grid-column: span 1;
    }
}

/* Grid Loading States */
.grid-loading {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Grid Empty State */
.grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.grid-empty-icon {
    font-size: 4rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

.grid-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.grid-empty-text {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Utility Classes */
.gap-xs { gap: 0.5rem; }
.gap-sm { gap: 1rem; }
.gap-md { gap: 1.5rem; }
.gap-lg { gap: 2rem; }
.gap-xl { gap: 3rem; }

@keyframes spin {
    to { transform: rotate(360deg); }
}.container {
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
.form-container {
    .feature-grid {
        grid-template-columns: 1fr;
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    display: flex;
/* Mobile Layout - Consolidated */
/* From mobile-complete.css */
/* Mobile Complete - Professional Consolidated Mobile Styles */
/* Date: 2025-08-15 */
/* This replaces ALL other mobile fix files */

/* ========================================
   BASE MOBILE STYLES
   ======================================== */

@media screen and (max-width: 768px) {
  
  /* Reset and Base */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-size: 16px;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  /* ========================================
     NAVBAR - Complete Mobile Layout
     ======================================== */
  
  .navbar,
  .modern-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-surface);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 60px;
  }

  .navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 12px;
  }

  /* Menu Button */
  .navbar-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  /* Brand */
  .navbar-brand {
    flex: 1;
    text-align: center;
    padding: 0 8px;
  }

  .brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
  }

  /* Actions Section */
  .navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .navbar-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
  }

  /* User Avatar */
  #user-avatar-container,
  .user-avatar-container {
    display: block;
    position: relative;
  }

  .user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--link);
    color: var(--text-on-accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  /* Avatar Dropdown - Slide up from bottom */
  .user-dropdown {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10000;
  }

  .user-dropdown.active {
    transform: translateY(0);
  }

  .user-dropdown-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
  }

  .user-dropdown-backdrop.active {
    display: block;
  }

  .user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    min-height: 50px;
    cursor: pointer;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    text-decoration: none;
    color: var(--text-primary);
  }

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

  /* ========================================
     DASHBOARD MOBILE
     ======================================== */
  
  .dashboard-modern {
    padding: 0;
    min-height: calc(100vh - 60px);
  }

  .dashboard-container {
    padding: 16px;
  }

  /* Page Header */
  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
  }

  .page-help-button {
    padding: 8px 16px;
    background: var(--link);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-height: 44px;
  }

  /* Welcome Section */
  .welcome-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--text-on-accent);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
  }

  .welcome-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-on-accent);
  }

  .welcome-subtitle {
    font-size: 14px;
    opacity: 0.9;
  }

  /* Stats Grid */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }

  .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
  }

  .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
  }

  /* Quick Actions */
  .quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: var(--bg-surface);
    border-radius: 12px;
    min-height: 100px;
    text-decoration: none;
    border: 1px solid var(--border-subtle);
  }

  .quick-action-icon {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--link);
  }

  .quick-action-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
  }

  /* Recent Activity */
  .recent-activity {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
  }

  .activity-list {
    max-height: 400px;
    overflow-y: auto;
  }

  .activity-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
  }

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

  /* ========================================
     CHAT MOBILE
     ======================================== */
  
  .chat-container {
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }

  /* Hide breadcrumb to save space */
  .breadcrumb {
    display: none;
  }

  /* Chat Hero */
  .chat-hero {
    padding: 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid #e5e7eb;
  }

  .chat-hero-content {
    flex-direction: column;
    gap: 10px;
  }

  .chat-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .chat-hero-actions button {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
    background: var(--link);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }

  /* Messages Container */
  .messages-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    min-height: 0;
  }

  /* Messages */
  .message {
    max-width: 85%;
    margin: 8px 0;
  }

  .message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    background: var(--bg-hover);
  }

  .message.own {
    margin-left: auto;
  }

  .message.own .message-bubble {
    background: var(--link);
    color: var(--text-on-accent);
  }

  /* Input Area */
  .chat-input-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid #e5e7eb;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
  }

  .chat-input,
  #messageInput {
    flex: 1;
    height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--border-default);
    border-radius: 22px;
    font-size: 16px;
    background: var(--bg-card);
    min-width: 0;
  }

  .chat-input-wrapper button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  .btn-send-message {
    background: var(--link);
    color: var(--text-on-accent);
  }

  .btn-voice,
  .btn-attachment {
    background: var(--text-secondary);
    color: var(--text-on-accent);
  }

  /* ========================================
     DARK MODE
     ======================================== */
  
  [data-theme="dark"] .navbar,
  [data-theme="dark"] .modern-navbar {
    background: #1f2937;
  }

  [data-theme="dark"] .brand-name,
  [data-theme="dark"] .page-title,
  [data-theme="dark"] .section-title {
    color: #f9fafb;
  }

  [data-theme="dark"] .stat-card,
  [data-theme="dark"] .quick-action-card,
  [data-theme="dark"] .recent-activity,
  [data-theme="dark"] .chat-hero,
  [data-theme="dark"] .user-dropdown {
    background: #1f2937;
    border-color: var(--border-default);
  }

  [data-theme="dark"] .stat-value,
  [data-theme="dark"] .user-dropdown-item {
    color: var(--bg-hover);
  }

  [data-theme="dark"] .activity-item {
    border-bottom-color: #374151;
  }

  [data-theme="dark"] .chat-input-wrapper {
    background: #1f2937;
    border-top-color: #374151;
  }

  [data-theme="dark"] .chat-input,
  [data-theme="dark"] #messageInput {
    background: #374151;
    border-color: var(--text-secondary);
    color: var(--text-on-accent);
  }

  /* ========================================
     UTILITIES
     ======================================== */
  
  /* Touch feedback */
  button:active,
  a:active {
    opacity: 0.8;
    transform: scale(0.98);
  }

  /* Hide scrollbars but keep scrolling */
  .messages-container::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  /* Prevent body scroll when modals open */
  body.modal-open,
  body.dropdown-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */

@media screen and (max-width: 768px) and (orientation: landscape) {
  .chat-hero {
    display: none;
  }
  
  .messages-container {
    max-height: calc(100vh - 120px);
  }
  
  .chat-input-wrapper {
    padding: 4px 8px;
  }
  
  .chat-input,
  #messageInput {
    height: 36px;
  }
  
  .chat-input-wrapper button {
    width: 36px;
    height: 36px;
  }
}

/* ========================================
   VERY SMALL DEVICES
   ======================================== */

@media screen and (max-width: 360px) {
  .navbar-action-btn:first-child {
    display: none;
  }
  
  .brand-name {
    font-size: 16px;
  }
  
  .stats-grid,
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}/* From mobile-consolidated.css */
/**
 * Mobile Consolidated Styles
 * Created: 2025-08-15
 * Purpose: Consolidate all emergency fixes and mobile overrides
 * This file combines multiple fix files to reduce CSS complexity
 */

/* ========================================
   MOBILE VIEWPORT & BASE
   ======================================== */

/* Ensure proper mobile viewport */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  /* Prevent horizontal scroll */
  .container,
  .main-content,
  .page-wrapper {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ========================================
   NAVIGATION FIXES
   ======================================== */

/* Force mobile navigation visibility */
@media (max-width: 768px) {
  .modern-navbar,
  .navigation-menu,
  .mobile-nav,
  .navbar-mobile {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-surface, #ffffff);
    border-top: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  }
  
  /* Hide desktop navigation */
  .desktop-nav,
  .sidebar-navigation {
    display: none !important;
  }
  
  /* Bottom tab bar pattern */
  .nav-tabs,
  .navigation-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 56px;
    padding: 0 8px;
  }
  
  .nav-tab,
  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--text-secondary, #666);
    font-size: 12px;
    min-height: 44px;
    position: relative;
  }
  
  .nav-tab.active,
  .nav-item.active {
    color: var(--primary-color, #2E8B57);
  }
  
  .nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
  }
}

/* ========================================
   CHAT FIXES
   ======================================== */

@media (max-width: 768px) {
  /* Chat container adjustments */
  .chat-container {
    height: calc(100vh - 56px - 60px); /* Account for bottom nav and input */
    display: flex;
    flex-direction: column;
  }
  
  /* Chat messages area */
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
  }
  
  /* Chat input area */
  .chat-input-container {
    position: fixed;
    bottom: 56px; /* Above bottom navigation */
    left: 0;
    right: 0;
    background: var(--bg-surface, #ffffff);
    border-top: 1px solid var(--border-color, #e0e0e0);
    padding: 10px;
    z-index: 100;
  }
  
  /* Message bubbles */
  .message-bubble {
    max-width: 85%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Thread panel as overlay */
  .thread-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-surface, #ffffff);
    transition: left 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  
  .thread-panel.open {
    left: 0;
  }
  
  /* Overlay backdrop */
  .thread-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  
  .thread-overlay.show {
    display: block;
  }
}

/* ========================================
   DASHBOARD FIXES
   ======================================== */

@media (max-width: 768px) {
  /* Dashboard layout */
  .dashboard-container {
    padding: 60px 10px 70px; /* Top and bottom spacing for fixed elements */
  }
  
  /* Dashboard cards */
  .dashboard-card,
  .widget-card {
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  /* Dashboard grid */
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  /* Stats cards */
  .stat-card {
    padding: 15px;
    background: var(--bg-surface, #ffffff);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* ========================================
   AVATAR & USER MENU FIXES
   ======================================== */

@media (max-width: 768px) {
  /* User avatar in mobile nav */
  .user-avatar-container {
    position: relative;
    width: 32px;
    height: 32px;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
  }
  
  /* Avatar dropdown menu */
  .avatar-dropdown {
    position: fixed;
    bottom: 70px;
    right: 10px;
    left: auto;
    width: 200px;
    background: var(--bg-surface, #ffffff);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    display: none;
  }
  
  .avatar-dropdown.show {
    display: block;
  }
  
  .avatar-dropdown-item {
    padding: 12px 16px;
    display: block;
    color: var(--text-primary, #333);
    text-decoration: none;
    transition: background 0.2s;
  }
  
  .avatar-dropdown-item:active {
    background: var(--bg-hover, #f5f5f5);
  }
}

/* ========================================
   MODAL & OVERLAY FIXES
   ======================================== */

@media (max-width: 768px) {
  /* Modal positioning */
  .modal,
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
  }
  
  .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-surface, #ffffff);
    border-radius: 12px;
    padding: 20px;
  }
  
  /* Modal close button */
  .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    font-size: 20px;
  }
}

/* ========================================
   FORM & INPUT FIXES
   ======================================== */

@media (max-width: 768px) {
  /* Form inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    width: 100%;
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    -webkit-appearance: none;
  }
  
  /* Buttons */
  .btn,
  button {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 16px;
    touch-action: manipulation;
  }
  
  /* File upload areas */
  .upload-zone {
    min-height: 120px;
    border: 2px dashed var(--border-color, #e0e0e0);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
  }
}

/* ========================================
   TOUCH OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
  /* Increase touch targets */
  a,
  button,
  .clickable,
  .touchable {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover effects on touch devices */
  @media (hover: none) {
    *:hover {
      background: inherit !important;
      color: inherit !important;
    }
  }
  
  /* Active states for touch feedback */
  a:active,
  button:active,
  .clickable:active {
    opacity: 0.7;
    transform: scale(0.98);
  }
  
  /* Prevent text selection on UI elements */
  .nav-item,
  .button,
  .tab,
  .menu-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
  /* Hardware acceleration for transforms */
  .slide-panel,
  .drawer,
  .modal {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
  }
  
  /* Reduce animations on low-end devices */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
  }
}

/* ========================================
   Z-INDEX HIERARCHY FIX
   ======================================== */

:root {
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-notification: 600;
  --z-tooltip: 700;
  --z-emergency: 9999;
}

/* Apply consistent z-index */
.dropdown { z-index: var(--z-dropdown); }
.sticky-header { z-index: var(--z-sticky); }
.fixed-nav { z-index: var(--z-fixed); }
.modal-backdrop { z-index: var(--z-modal-backdrop); }
.modal { z-index: var(--z-modal); }
.notification { z-index: var(--z-notification); }
.tooltip { z-index: var(--z-tooltip); }

/* Mobile specific z-index */
@media (max-width: 768px) {
  .modern-navbar,
  .mobile-nav {
    z-index: var(--z-fixed);
  }
  
  .chat-input-container {
    z-index: calc(var(--z-fixed) - 10);
  }
  
  .thread-panel {
    z-index: var(--z-modal);
  }
  
  .thread-overlay {
    z-index: var(--z-modal-backdrop);
  }
  
  .avatar-dropdown {
    z-index: var(--z-dropdown);
  }
}

/* ========================================
   CRITICAL VISIBILITY FIXES
   ======================================== */

/* Force critical elements to be visible */
.modern-navbar,
.navigation-menu,
.main-content,
.dashboard-container,
.chat-container {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* Remove any problematic overlays */
.loading-overlay:not(.active),
.splash-screen:not(.active),
.onboarding-overlay:not(.active) {
  display: none !important;
}

/* ========================================
   END OF CONSOLIDATED STYLES
   ======================================== *//* From mobile.css */
/* Mobile-First CSS Framework for Family History Portal */

/* Base Mobile Styles (320px and up) */
:root {
  /* Mobile-optimized spacing */
  --mobile-padding: 16px;
  --mobile-margin: 12px;
  --mobile-border-radius: 8px;
  
  /* Touch-friendly sizes */
  --touch-target-min: 44px;
  --button-height: 48px;
  --input-height: 52px;
  
  /* Mobile typography */
  --mobile-font-size-xs: 12px;
  --mobile-font-size-sm: 14px;
  --mobile-font-size-base: 16px;
  --mobile-font-size-lg: 18px;
  --mobile-font-size-xl: 20px;
  --mobile-font-size-2xl: 24px;
  --mobile-font-size-3xl: 28px;
  
  /* Mobile colors */
  --mobile-primary: #2E8B57;
  --mobile-primary-dark: #1F5F3F;
  --mobile-secondary: #4A90E2;
  --mobile-success: #27AE60;
  --mobile-warning: #F39C12;
  --mobile-error: #E74C3C;
  --mobile-info: #3498DB;
  
  /* Mobile backgrounds */
  --mobile-bg-primary: #FFFFFF;
  --mobile-bg-secondary: #F8F9FA;
  --mobile-bg-dark: #343A40;
  --mobile-bg-overlay: rgba(0, 0, 0, 0.5);
  
  /* Mobile shadows */
  --mobile-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --mobile-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --mobile-shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  
  /* Mobile transitions */
  --mobile-transition: all 0.3s ease;
  --mobile-transition-fast: all 0.15s ease;
}

/* Mobile-first reset and base styles */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--mobile-font-size-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--mobile-bg-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile container */
.mobile-container {
  width: 100%;
  max-width: 100vw;
  padding: 0 var(--mobile-padding);
  margin: 0 auto;
}

/* Mobile navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--mobile-bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  padding: 12px var(--mobile-padding);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.mobile-nav-brand {
  font-size: var(--mobile-font-size-lg);
  font-weight: 600;
  color: var(--mobile-primary);
  text-decoration: none;
}

.mobile-nav-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mobile-border-radius);
  transition: var(--mobile-transition-fast);
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus {
  background: var(--hover-overlay);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mobile-bg-overlay);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: var(--mobile-transition);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--mobile-bg-primary);
  z-index: 1002;
  transform: translateX(100%);
  transition: var(--mobile-transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--mobile-shadow-lg);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-header {
  padding: var(--mobile-padding);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mobile-border-radius);
}

.mobile-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--mobile-padding);
}

.mobile-menu-item {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--mobile-border-radius);
  margin-bottom: 4px;
  font-weight: 500;
  transition: var(--mobile-transition-fast);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus {
  background: var(--primary-bg-light);
  color: var(--mobile-primary);
}

.mobile-menu-item-icon {
  margin-right: 12px;
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* Mobile content spacing */
.mobile-content {
  margin-top: 80px; /* Account for fixed nav */
  min-height: calc(100vh - 80px);
  padding-bottom: 80px; /* Account for bottom nav if present */
}

/* Mobile buttons */
.mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: var(--mobile-font-size-base);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--mobile-border-radius);
  cursor: pointer;
  transition: var(--mobile-transition);
  min-height: var(--button-height);
  min-width: var(--touch-target-min);
  position: relative;
  overflow: hidden;
  -webkit-appearance: none;
  user-select: none;
}

.mobile-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mobile-btn-primary {
  background: var(--mobile-primary);
  color: var(--text-on-accent);
}

.mobile-btn-primary:hover:not(:disabled) {
  background: var(--mobile-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--mobile-shadow-md);
}

.mobile-btn-secondary {
  background: var(--mobile-secondary);
  color: var(--text-on-accent);
}

.mobile-btn-outline {
  background: transparent;
  border: 2px solid var(--mobile-primary);
  color: var(--mobile-primary);
}

.mobile-btn-outline:hover:not(:disabled) {
  background: var(--mobile-primary);
  color: var(--text-on-accent);
}

.mobile-btn-full {
  width: 100%;
}

.mobile-btn-large {
  padding: 16px 32px;
  font-size: var(--mobile-font-size-lg);
  min-height: 56px;
}

.mobile-btn-small {
  padding: 8px 16px;
  font-size: var(--mobile-font-size-sm);
  min-height: 36px;
}

/* Mobile forms */
.mobile-form {
  width: 100%;
  max-width: 100%;
}

.mobile-form-group {
  margin-bottom: var(--mobile-margin);
}

.mobile-form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: var(--mobile-font-size-sm);
}

.mobile-form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--mobile-font-size-base);
  border: 2px solid var(--border-subtle);
  border-radius: var(--mobile-border-radius);
  background: var(--bg-surface);
  transition: var(--mobile-transition-fast);
  min-height: var(--input-height);
  -webkit-appearance: none;
  appearance: none;
}

.mobile-form-input:focus {
  outline: none;
  border-color: var(--mobile-primary);
  box-shadow: 0 0 0 3px var(--primary-bg-light);
}

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

.mobile-form-textarea {
  min-height: 120px;
  resize: vertical;
}

.mobile-form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 48px;
}

/* Mobile cards */
.mobile-card {
  background: var(--bg-surface);
  border-radius: var(--mobile-border-radius);
  box-shadow: var(--mobile-shadow-sm);
  margin-bottom: var(--mobile-margin);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.mobile-card-header {
  padding: var(--mobile-padding);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--mobile-bg-secondary);
}

.mobile-card-title {
  margin: 0;
  font-size: var(--mobile-font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-card-content {
  padding: var(--mobile-padding);
}

.mobile-card-footer {
  padding: var(--mobile-padding);
  border-top: 1px solid var(--border-subtle);
  background: var(--mobile-bg-secondary);
}

/* Mobile grid system */
.mobile-grid {
  display: grid;
  gap: var(--mobile-margin);
  width: 100%;
}

.mobile-grid-1 { grid-template-columns: 1fr; }
.mobile-grid-2 { grid-template-columns: repeat(2, 1fr); }
.mobile-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Mobile utilities */
.mobile-text-center { text-align: center; }
.mobile-text-left { text-align: left; }
.mobile-text-right { text-align: right; }

.mobile-hidden { display: none !important; }
.mobile-visible { display: block !important; }

.mobile-mt-0 { margin-top: 0; }
.mobile-mt-1 { margin-top: 8px; }
.mobile-mt-2 { margin-top: 16px; }
.mobile-mt-3 { margin-top: 24px; }
.mobile-mt-4 { margin-top: 32px; }

.mobile-mb-0 { margin-bottom: 0; }
.mobile-mb-1 { margin-bottom: 8px; }
.mobile-mb-2 { margin-bottom: 16px; }
.mobile-mb-3 { margin-bottom: 24px; }
.mobile-mb-4 { margin-bottom: 32px; }

.mobile-p-0 { padding: 0; }
.mobile-p-1 { padding: 8px; }
.mobile-p-2 { padding: 16px; }
.mobile-p-3 { padding: 24px; }
.mobile-p-4 { padding: 32px; }

/* Mobile bottom navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  z-index: 1000;
  padding: 8px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-bottom-nav-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
}

.mobile-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--mobile-font-size-xs);
  padding: 8px 12px;
  border-radius: var(--mobile-border-radius);
  transition: var(--mobile-transition-fast);
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  justify-content: center;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item.active {
  color: var(--mobile-primary);
}

.mobile-bottom-nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

/* Mobile gestures and touch */
.mobile-swipeable {
  touch-action: pan-y;
  user-select: none;
}

.mobile-no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Mobile loading states */
.mobile-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mobile-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top: 2px solid var(--mobile-primary);
  border-radius: 50%;
  animation: mobile-spin 1s linear infinite;
}

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

/* Mobile alerts and notifications */
.mobile-alert {
  padding: 12px 16px;
  border-radius: var(--mobile-border-radius);
  margin-bottom: var(--mobile-margin);
  border-left: 4px solid;
}

.mobile-alert-success {
  background: var(--success-bg-light);
  border-color: var(--mobile-success);
  color: var(--success-dark);
}

.mobile-alert-warning {
  background: var(--warning-bg-light);
  border-color: var(--mobile-warning);
  color: var(--warning-dark);
}

.mobile-alert-error {
  background: var(--error-bg-light);
  border-color: var(--mobile-error);
  color: var(--error-dark);
}

.mobile-alert-info {
  background: var(--info-bg-light);
  border-color: var(--mobile-info);
  color: var(--info-dark);
}

/* Mobile modals */
.mobile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mobile-bg-overlay);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--mobile-transition);
}

.mobile-modal.active {
  opacity: 1;
  visibility: visible;
}

.mobile-modal-content {
  background: var(--bg-surface);
  width: 100%;
  max-width: 100vw;
  max-height: 90vh;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: var(--mobile-transition);
  overflow: hidden;
}

.mobile-modal.active .mobile-modal-content {
  transform: translateY(0);
}

.mobile-modal-header {
  padding: var(--mobile-padding);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.mobile-modal-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
}

.mobile-modal-title {
  margin: 0;
  font-size: var(--mobile-font-size-lg);
  font-weight: 600;
}

.mobile-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mobile-border-radius);
}

.mobile-modal-body {
  padding: var(--mobile-padding);
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

/* Mobile camera and media */
.mobile-camera-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-surface-dark);
  border-radius: var(--mobile-border-radius);
  overflow: hidden;
}

.mobile-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--mobile-padding);
  background: linear-gradient(transparent, var(--shadow-color));
}

.mobile-camera-capture {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 4px solid var(--border-light);
  cursor: pointer;
  transition: var(--mobile-transition-fast);
}

.mobile-camera-capture:active {
  transform: scale(0.95);
}

/* Responsive breakpoints */
@media (min-width: 480px) {
  .mobile-container {
    padding: 0 24px;
  }
  
  .mobile-grid-sm-2 { grid-template-columns: repeat(2, 1fr); }
  .mobile-grid-sm-3 { grid-template-columns: repeat(3, 1fr); }
  .mobile-grid-sm-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .mobile-hidden-md { display: none !important; }
  .mobile-visible-md { display: block !important; }
  
  .mobile-grid-md-2 { grid-template-columns: repeat(2, 1fr); }
  .mobile-grid-md-3 { grid-template-columns: repeat(3, 1fr); }
  .mobile-grid-md-4 { grid-template-columns: repeat(4, 1fr); }
  
  .mobile-modal {
    align-items: center;
  }
  
  .mobile-modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 16px;
    transform: scale(0.9);
  }
  
  .mobile-modal.active .mobile-modal-content {
    transform: scale(1);
  }
  
  .mobile-bottom-nav {
    display: none;
  }
  
  .mobile-content {
    padding-bottom: 0;
  }
}

@media (min-width: 1024px) {
  .mobile-hidden-lg { display: none !important; }
  .mobile-visible-lg { display: block !important; }
  
  .mobile-grid-lg-2 { grid-template-columns: repeat(2, 1fr); }
  .mobile-grid-lg-3 { grid-template-columns: repeat(3, 1fr); }
  .mobile-grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
  .mobile-grid-lg-5 { grid-template-columns: repeat(5, 1fr); }
  .mobile-grid-lg-6 { grid-template-columns: repeat(6, 1fr); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --mobile-bg-primary: #1a1a1a;
    --mobile-bg-secondary: #2d2d2d;
    --mobile-bg-dark: #000000;
  }
  
  body {
    background-color: var(--mobile-bg-primary);
    color: var(--text-on-accent);
  }
  
  .mobile-nav,
  .mobile-menu,
  .mobile-card,
  .mobile-bottom-nav {
    background: var(--mobile-bg-primary);
    border-color: var(--border-default-dark);
  }
  
  .mobile-form-input {
    background: var(--mobile-bg-secondary);
    border-color: var(--border-default-dark);
    color: var(--text-on-accent);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  .mobile-btn,
  .mobile-form-input,
  .mobile-card {
    border-width: 2px;
  }
}/* From mobile-forms.css */
/**
 * Mobile Forms Optimization
 * Enhanced form inputs and controls for mobile devices
 */

/* Base form improvements for touch */
@media (max-width: 968px) {
    /* Increase touch targets */
    .form-input,
    .form-select,
    textarea,
    select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="time"] {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
        border-width: 2px;
    }
    
    /* Better focus states */
    .form-input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px var(--link-bg-alpha);
        outline: none;
    }
    
    /* Larger labels */
    .form-label {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
    }
    
    /* Form groups spacing */
    .form-group {
        margin-bottom: 24px;
    }
    
    /* Checkbox and radio improvements */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        flex-shrink: 0;
        cursor: pointer;
    }
    
    /* Labels for checkboxes/radios */
    label:has(input[type="checkbox"]),
    label:has(input[type="radio"]) {
        display: flex;
        align-items: flex-start;
        cursor: pointer;
        padding: 8px 0;
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Select dropdown improvements */
    select {
        appearance: none;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        padding-right: 40px;
    }
    
    /* Textarea improvements */
    textarea {
        min-height: 120px;
        resize: vertical;
        line-height: 1.5;
    }
    
    /* Button spacing in forms */
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 32px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 16px;
        padding: 14px 24px;
        font-weight: 600;
    }
    
    /* File upload areas */
    .file-upload-area {
        min-height: 120px;
        border: 2px dashed var(--border-color);
        border-radius: 12px;
        padding: 20px;
        text-align: center;
    }
    
    .upload-prompt {
        font-size: 16px;
    }
    
    /* Form hints and errors */
    .form-hint,
    .form-error,
    small {
        font-size: 14px;
        margin-top: 6px;
        display: block;
        line-height: 1.4;
    }
    
    /* Inline form elements */
    .form-row {
        flex-direction: column;
        gap: 24px;
    }
    
    .form-row .form-group {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Date inputs - native on mobile */
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        position: relative;
    }
    
    /* Number input spinners */
    input[type="number"] {
        -moz-appearance: textfield;
    }
    
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
        height: 44px;
        width: 44px;
        cursor: pointer;
    }
    
    /* Password visibility toggle */
    .password-field-wrapper {
        position: relative;
    }
    
    .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--text-light);
        cursor: pointer;
        padding: 8px;
        font-size: 20px;
    }
    
    /* Floating labels for better UX */
    .floating-label-group {
        position: relative;
        margin-bottom: 24px;
    }
    
    .floating-label-group input:focus + label,
    .floating-label-group input:not(:placeholder-shown) + label {
        transform: translateY(-24px) scale(0.85);
        color: var(--primary-color);
    }
    
    .floating-label-group label {
        position: absolute;
        left: 16px;
        top: 14px;
        transition: all 0.2s ease;
        pointer-events: none;
        color: var(--text-light);
    }
    
    /* Search inputs */
    input[type="search"] {
        -webkit-appearance: none;
        padding-left: 44px;
    }
    
    .search-wrapper {
        position: relative;
    }
    
    .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
    }
    
    /* Form section headers */
    .form-section {
        margin-bottom: 32px;
        padding: 20px;
        background: var(--bg-surface);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
    }
    
    .form-section h3 {
        font-size: 20px;
        margin-bottom: 20px;
        color: var(--primary-color);
    }
    
    /* Progress indicators for multi-step forms */
    .form-progress {
        display: flex;
        justify-content: space-between;
        margin-bottom: 32px;
        padding: 0;
        list-style: none;
    }
    
    .form-progress li {
        flex: 1;
        text-align: center;
        position: relative;
        font-size: 14px;
    }
    
    /* Autocomplete suggestions */
    .autocomplete-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        max-height: 200px;
        overflow-y: auto;
        z-index: 100;
    }
    
    .autocomplete-suggestion {
        padding: 12px 16px;
        cursor: pointer;
        font-size: 16px;
    }
    
    .autocomplete-suggestion:hover {
        background: var(--bg-color);
    }
    
    /* Toggle switches */
    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 32px;
    }
    
    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    
    .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--border-default);
        transition: .4s;
        border-radius: 34px;
    }
    
    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 24px;
        width: 24px;
        left: 4px;
        bottom: 4px;
        background-color: var(--bg-surface);
        transition: .4s;
        border-radius: 50%;
    }
    
    input:checked + .toggle-slider {
        background-color: var(--primary-color);
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(28px);
    }
    
    /* Accessibility improvements */
    .form-input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Loading states */
    .form-input.loading {
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.5A6.5 6.5 0 0 0 3.5 10 .75.75 0 0 1 2 10a8 8 0 1 1 8 8 .75.75 0 0 1 0-1.5A6.5 6.5 0 0 0 10 3.5z' fill='%23666' fill-rule='evenodd'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 44px;
    }
    
    /* Validation states */
    .form-input.is-valid {
        border-color: var(--success-color);
        padding-right: 44px;
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2338a169' fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }
    
    .form-input.is-invalid {
        border-color: var(--error-color);
        padding-right: 44px;
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23e53e3e' fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .form-input,
    select,
    textarea {
        font-size: 16px; /* Ensure no zoom on iOS */
        padding: 10px 14px;
    }
    
    .form-section {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .form-actions {
        gap: 10px;
        margin-top: 24px;
    }
    
    .form-actions .btn {
        padding: 12px 20px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 968px) and (orientation: landscape) {
    .form-container {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .form-section {
        padding: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .form-input,
    select,
    textarea {
        background-color: var(--bg-surface-dark);
        color: var(--text-primary-dark);
        border-color: var(--border-default-dark);
    }
    
    .form-input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--link-dark);
        box-shadow: 0 0 0 4px var(--link-bg-alpha);
    }
    
    .form-section {
        background: var(--bg-card-dark);
    }
}/* From mobile-navbar-proper.css */
/* Mobile Navbar Proper Fix */
/* Date: 2025-08-15 */
/* Show hamburger menu and avatar correctly on mobile */

@media screen and (max-width: 768px) {
  /* ========================================
     TOP NAVBAR - PROPER MOBILE LAYOUT
     ======================================== */
  
  .navbar,
  .modern-navbar {
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: var(--bg-surface) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    height: 60px !important;
  }

  .navbar-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
    padding: 0 12px !important;
  }

  /* ========================================
     HAMBURGER MENU - LEFT SIDE
     ======================================== */
  
  .navbar-menu-btn,
  #navbar-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .menu-icon {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 24px !important;
    height: 24px !important;
    position: relative !important;
  }

  .menu-line {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background: #374151 !important;
    margin: 3px 0 !important;
    transition: all 0.3s ease !important;
    border-radius: 1px !important;
  }

  /* ========================================
     BRAND - CENTER
     ======================================== */
  
  .navbar-brand {
    flex: 1 !important;
    text-align: center !important;
    padding: 0 8px !important;
  }

  .brand-name {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .brand-icon {
    display: none !important; /* Hide icon on mobile to save space */
  }

  /* ========================================
     RIGHT SIDE - NOTIFICATIONS & AVATAR
     ======================================== */
  
  .navbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
  }

  /* Hide add button on mobile */
  #quick-add-btn {
    display: none !important;
  }

  /* Keep notifications */
  #notifications-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 18px !important;
    position: relative !important;
  }

  .notification-badge {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    background: var(--error) !important;
    color: var(--text-on-accent) !important;
    font-size: 10px !important;
    font-weight: bold !important;
    padding: 2px 4px !important;
    border-radius: 10px !important;
    min-width: 16px !important;
    text-align: center !important;
  }

  /* ========================================
     AVATAR - SHOW WITH INITIALS
     ======================================== */
  
  #user-avatar-container {
    display: block !important;
    position: relative !important;
  }

  .user-avatar-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .user-avatar-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--link) !important;
    color: var(--text-on-accent) !important;
    border: 2px solid white !important;
    cursor: pointer !important;
    position: relative !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
  }

  /* Hide icon, show initials */
  .user-avatar-icon {
    display: none !important;
  }

  .user-avatar-initials {
    display: block !important;
    color: var(--text-on-accent) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  /* Remove dropdown arrow from avatar */
  .user-avatar-btn .dropdown-arrow,
  .user-avatar-btn svg,
  .user-avatar-btn i {
    display: none !important;
  }

  /* Show initials */
  .user-avatar-btn .user-avatar-initials {
    display: block !important;
  }

  /* ========================================
     BOTTOM NAVIGATION - KEEP SEPARATE
     ======================================== */
  
  .mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 56px !important;
    background: var(--bg-surface) !important;
    border-top: 1px solid #e5e7eb !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 999 !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
  }

  .bottom-nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 6px 4px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .bottom-nav-item.active {
    color: var(--link) !important;
  }

  .bottom-nav-item .nav-icon {
    font-size: 20px !important;
    margin-bottom: 2px !important;
  }

  .bottom-nav-item .nav-label {
    font-size: 11px !important;
    font-weight: 500 !important;
  }

  /* ========================================
     DARK MODE
     ======================================== */
  
  [data-theme="dark"] .navbar,
  [data-theme="dark"] .modern-navbar {
    background: #1f2937 !important;
  }

  [data-theme="dark"] .menu-line {
    background: #d1d5db !important;
  }

  [data-theme="dark"] .brand-name {
    color: #f9fafb !important;
  }

  [data-theme="dark"] #notifications-btn {
    color: #d1d5db !important;
  }

  [data-theme="dark"] .mobile-bottom-nav {
    background: #1f2937 !important;
    border-top-color: #374151 !important;
  }

  [data-theme="dark"] .bottom-nav-item {
    color: var(--text-muted) !important;
  }

  [data-theme="dark"] .bottom-nav-item.active {
    color: #60a5fa !important;
  }
}

/* Very small screens */
@media screen and (max-width: 360px) {
  .brand-name {
    font-size: 16px !important;
  }
  
  #notifications-btn {
    display: none !important; /* Hide notifications on very small screens */
  }
}/* From mobile-nav.css */
/**
 * Mobile Navigation Styles
 * Responsive navigation for all screen sizes
 */

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--hover-overlay);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: var(--hover-overlay);
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 20px;
}

.hamburger span {
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

/* Active state */
.mobile-nav-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
    transform-origin: center;
}

.mobile-nav-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
    transform-origin: center;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.open {
    right: 0;
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    z-index: 1;
}

/* Mobile Menu Content */
.mobile-nav-items {
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    gap: 0;
}

.mobile-nav-items .nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--border-default);
    transition: all 0.2s ease;
}

.mobile-nav-items .nav-link:hover,
.mobile-nav-items .nav-link.active {
    background-color: var(--bg-color);
    color: var(--primary-color);
    padding-left: 30px;
}

/* Mobile Nav Actions */
.mobile-nav-actions {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-default);
}

.mobile-nav-actions .language-selector {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Theme toggle in mobile menu */
.mobile-nav-actions #theme-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.mobile-nav-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Admin dropdown in mobile */
.mobile-nav-items .nav-dropdown {
    position: relative;
}

.mobile-nav-items .dropdown-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--bg-color);
    margin: 0;
    width: 100%;
    padding: 0;
}

.mobile-nav-items .nav-dropdown.show .dropdown-menu {
    display: block;
}

.mobile-nav-items .dropdown-menu .dropdown-item {
    padding: 12px 40px;
    border-bottom: 1px solid var(--border-default);
}

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    display: none;
    z-index: 999;
}

.mobile-menu-overlay.show {
    display: block;
}

/* Desktop adjustments */
@media (min-width: 969px) {
    .mobile-nav-toggle,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile adjustments */
@media (max-width: 968px) {
    /* Show mobile nav */
    .mobile-nav-toggle {
        display: block;
    }
    
    /* Hide desktop nav items */
    .nav-menu {
        display: none;
    }
    
    /* Adjust navbar layout */
    .navbar .container,
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    /* Adjust nav brand */
    .nav-brand h1,
    .nav-brand .tenant-name {
        font-size: 1.25rem;
    }
    
    /* User avatar visible on mobile */
    .user-avatar-container {
        display: flex !important;
        position: relative;
        margin-right: 60px; /* Space for hamburger */
        z-index: 1002;
    }
    
    /* Hide other nav actions on mobile but keep theme toggle visible */
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-right: 60px; /* Space for hamburger */
    }
    
    /* Keep theme toggle visible on mobile */
    #theme-toggle-container {
        display: flex !important;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .mobile-menu {
        width: 90%;
    }
    
    .nav-brand h1,
    .nav-brand .tenant-name {
        font-size: 1.1rem;
    }
    
    .mobile-nav-items .nav-link {
        padding: 12px 15px;
    }
}

/* Ensure proper stacking */
body.mobile-menu-open {
    overflow: hidden;
}

/* Touch-friendly sizes */
@media (max-width: 968px) {
    .btn,
    button,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 968px) and (orientation: landscape) {
    .mobile-menu {
        padding-top: 10px;
    }
    
    .mobile-nav-items {
        padding-top: 60px;
    }
    
    .mobile-nav-items .nav-link {
        padding: 10px 15px;
    }
}/* From mobile-responsive.css */
/**
 * Mobile Responsive Styles
 * Ensures optimal experience across all devices
 */

/* Base Mobile-First Approach */

/* Touch Target Sizes */
.btn,
.button,
button,
a.button,
input[type="submit"],
input[type="button"],
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
}

/* Mobile Navigation */
@media (max-width: 767px) {
    /* Hide desktop nav */
    .desktop-nav {
        display: none;
    }
    
    /* Mobile nav toggle */
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }
    
    /* Mobile menu */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding: 20px;
    }
    
    .mobile-menu.open {
        left: 0;
    }
    
    /* Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--overlay-dark);
        display: none;
        z-index: 999;
    }
    
    .mobile-menu-overlay.show {
        display: block;
    }
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: 20px;
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: Full columns */
@media (min-width: 1024px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Typography */
@media (max-width: 767px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Form Responsiveness */
@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    select,
    textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .form-inline .form-group {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Modal Responsiveness */
@media (max-width: 767px) {
    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        position: sticky;
        top: 0;
        background: var(--white);
        z-index: 10;
    }
    
    .modal-close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}

/* Table Responsiveness */
@media (max-width: 767px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Alternative: Card layout for tables */
    .table-cards tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 15px;
    }
    
    .table-cards td {
        display: block;
        text-align: right;
        padding: 5px 0;
        border: none;
    }
    
    .table-cards td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
}

/* Card Component */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .card {
        padding: 15px;
    }
}

/* Image Responsiveness */
img {
    max-width: 100%;
    height: auto;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 767px) {
    .image-gallery .image-item {
        flex: 1 1 100%;
    }
}

/* Button Groups */
@media (max-width: 767px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* Timeline Responsiveness */
@media (max-width: 767px) {
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-item {
        margin-left: 20px;
    }
    
    .timeline-item::before {
        left: -25px;
    }
}

/* Dashboard Specific */
@media (max-width: 767px) {
    .dashboard-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 250px;
        background: var(--white);
        transition: left 0.3s ease;
        z-index: 100;
    }
    
    .dashboard-sidebar.open {
        left: 0;
    }
    
    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }
}

/* Utility Classes */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
    
    .full-width-mobile {
        width: 100%;
    }
    
    .stack-mobile {
        flex-direction: column;
    }
    
    .no-padding-mobile {
        padding: 0;
    }
    
    .small-padding-mobile {
        padding: 10px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn,
    .button {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid currentColor;
    }
}

/* Print Styles */
@media print {
    .no-print,
    .mobile-nav-toggle,
    .mobile-menu,
    .dashboard-sidebar,
    .btn-group,
    .form-actions {
        display: none !important;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    .print-break-before {
        page-break-before: always;
    }
}/* Print Styles */
/* Print Manager Styles */

.print-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.print-dialog-overlay.show {
  opacity: 1;
}

.print-dialog {
  background: var(--bg-surface);
  border-radius: 8px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px var(--shadow-color, rgba(0, 0, 0, 0.2));
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.print-dialog-overlay.show .print-dialog {
  transform: scale(1);
}

.print-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-default);
}

.print-dialog-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.close-button:hover {
  color: var(--text-primary);
}

.print-dialog-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.print-preview-container {
  flex: 1;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.print-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-default);
}

.print-preview-header h3 {
  margin: 0;
  font-size: 18px;
}

.preview-btn {
  background: var(--bg-hover);
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}

.preview-btn:hover {
  background: #e0e0e0;
}

.print-preview {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-loading,
.preview-error {
  text-align: center;
  color: var(--text-secondary);
}

.preview-loading i,
.preview-error i {
  font-size: 48px;
  margin-bottom: 10px;
  display: block;
}

.preview-error i {
  color: #dc3545;
}

.preview-thumbnails {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-page {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-number {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.page-placeholder {
  width: 120px;
  height: 160px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ccc;
}

.preview-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 160px;
  background: var(--bg-hover);
  border: 1px dashed #ccc;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

.print-settings-container {
  width: 400px;
  display: flex;
  flex-direction: column;
}

.settings-tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.tab-btn:hover {
  background: #e8e8e8;
}

.tab-btn.active {
  background: var(--bg-surface);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #007bff;
}

.tab-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: none;
}

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

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-default);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-text {
  font-size: 12px;
  color: #6c757d;
  margin-top: 5px;
}

.btn-group {
  display: flex;
  gap: 0;
}

.btn-group .btn {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid #007bff;
  background: var(--bg-surface);
  color: #007bff;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-group .btn:first-child {
  border-radius: 4px 0 0 4px;
}

.btn-group .btn:last-child {
  border-radius: 0 4px 4px 0;
}

.btn-group .btn.btn-primary {
  background: #007bff;
  color: var(--text-on-accent);
}

.margin-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.margin-input {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.margin-input label {
  font-size: 12px;
  margin: 0;
}

.margin-input input {
  padding: 5px 8px;
}

.form-control-range {
  width: 100%;
}

.custom-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-control-input {
  margin: 0;
}

.print-services {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.print-service-card {
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.print-service-card:hover {
  border-color: var(--border-default);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.print-service-card.selected {
  border-color: var(--border-default);
  background: #f0f7ff;
}

.print-service-card h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.print-service-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.turnaround {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: #28a745 !important;
}

.service-options {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
}

.print-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.cost-estimate {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cost-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.cost-value {
  font-size: 20px;
  font-weight: bold;
  color: #28a745;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cost-breakdown-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 16px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-primary {
  background: #007bff;
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: var(--text-on-accent);
}

.btn-secondary:hover {
  background: #545b62;
}

.btn-link {
  background: none;
  color: #007bff;
  text-decoration: underline;
}

.print-success {
  padding: 40px;
  text-align: center;
}

.print-success i {
  font-size: 64px;
  color: #28a745;
  margin-bottom: 20px;
}

.print-success h3 {
  margin-bottom: 10px;
}

.print-job-details {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}

.print-job-details p {
  margin: 5px 0;
}

.print-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-surface);
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  z-index: 10000;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid #28a745;
}

.notification-success i {
  color: #28a745;
}

.notification-error {
  border-left: 4px solid #dc3545;
}

.notification-error i {
  color: #dc3545;
}

.notification-warning {
  border-left: 4px solid #ffc107;
}

.notification-warning i {
  color: #ffc107;
}

.notification-info {
  border-left: 4px solid #17a2b8;
}

.notification-info i {
  color: #17a2b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .print-dialog {
    width: 95%;
    max-height: 95vh;
  }
  
  .print-dialog-body {
    flex-direction: column;
  }
  
  .print-preview-container {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    max-height: 300px;
  }
  
  .print-settings-container {
    width: 100%;
  }
  
  .margin-inputs {
    grid-template-columns: 1fr;
  }
  
  .print-dialog-footer {
    flex-direction: column;
    gap: 15px;
  }
  
  .action-buttons {
    width: 100%;
  }
  
  .action-buttons .btn {
    flex: 1;
  }
}/* Button Components */
/**
 * Button System - Theme-aware button styles with WCAG AA compliance
 * This file provides consistent button styling across the application
 * ensuring proper contrast ratios in both light and dark themes
 */

/* Base button resets and defaults */
.btn,
button.btn {
  /* Reset browser defaults */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  
  /* Base properties */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  
  /* Spacing */
  padding: 0.75rem 1.5rem;
  margin: 0;
  
  /* Typography */
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  
  /* Styling */
  border: 1px solid transparent;
  border-radius: var(--border-radius, 0.375rem);
  cursor: pointer;
  
  /* Transitions */
  transition: all 0.2s ease;
  
  /* States */
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}

/* Focus styles for accessibility */
.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button - High contrast for CTAs */
.btn-primary {
  /* Light theme colors */
  background-color: var(--link); /* Darker blue for better contrast */
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.btn-primary:hover:not(:disabled) {
  background-color: #1d4080; /* Even darker on hover */
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 83, 160, 0.25);
}

.btn-primary:active:not(:disabled) {
  background-color: #163360;
  border-color: var(--border-default);
  transform: translateY(0);
}

/* Dark theme primary button */
.theme-dark .btn-primary {
  background-color: #4B8BF5; /* Bright blue for dark backgrounds */
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.theme-dark .btn-primary:hover:not(:disabled) {
  background-color: #6B9FF7;
  border-color: var(--border-default);
}

.theme-dark .btn-primary:active:not(:disabled) {
  background-color: #3B7BE5;
  border-color: var(--border-default);
}

/* Secondary Button - Outlined style */
.btn-secondary {
  /* Light theme */
  background-color: transparent;
  color: var(--link);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--link);
  color: var(--text-on-accent);
  border-color: var(--border-default);
  transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
  background-color: #1d4080;
  border-color: var(--border-default);
  transform: translateY(0);
}

/* Dark theme secondary button */
.theme-dark .btn-secondary {
  background-color: transparent;
  color: #6DB3F2;
  border-color: var(--border-default);
}

.theme-dark .btn-secondary:hover:not(:disabled) {
  background-color: #6DB3F2;
  color: var(--text-primary);
  border-color: var(--border-default);
}

.theme-dark .btn-secondary:active:not(:disabled) {
  background-color: #5DA3E2;
  border-color: var(--border-default);
}

/* Success Button */
.btn-success {
  /* Light theme */
  background-color: var(--success); /* Dark green for contrast */
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.btn-success:hover:not(:disabled) {
  background-color: #036544;
  border-color: var(--border-default);
  transform: translateY(-1px);
}

/* Dark theme success */
.theme-dark .btn-success {
  background-color: var(--success);
  color: var(--text-primary); /* Black text on bright green */
  border-color: var(--border-default);
}

.theme-dark .btn-success:hover:not(:disabled) {
  background-color: #34D399;
  border-color: var(--border-default);
}

/* Danger Button */
.btn-danger {
  /* Light theme */
  background-color: var(--error);
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.btn-danger:hover:not(:disabled) {
  background-color: #B91C1C;
  border-color: var(--border-default);
  transform: translateY(-1px);
}

/* Dark theme danger */
.theme-dark .btn-danger {
  background-color: var(--error);
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.theme-dark .btn-danger:hover:not(:disabled) {
  background-color: var(--error);
  border-color: var(--border-default);
}

/* Warning Button */
.btn-warning {
  /* Light theme */
  background-color: var(--warning);
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.btn-warning:hover:not(:disabled) {
  background-color: #B45309;
  border-color: var(--border-default);
  transform: translateY(-1px);
}

/* Dark theme warning */
.theme-dark .btn-warning {
  background-color: var(--warning);
  color: var(--text-primary); /* Black text on yellow */
  border-color: var(--border-default);
}

.theme-dark .btn-warning:hover:not(:disabled) {
  background-color: var(--warning);
  border-color: var(--border-default);
}

/* Info Button */
.btn-info {
  /* Light theme */
  background-color: #0891B2;
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.btn-info:hover:not(:disabled) {
  background-color: #0E7490;
  border-color: var(--border-default);
  transform: translateY(-1px);
}

/* Dark theme info */
.theme-dark .btn-info {
  background-color: #06B6D4;
  color: var(--text-primary);
  border-color: var(--border-default);
}

.theme-dark .btn-info:hover:not(:disabled) {
  background-color: #22D3EE;
  border-color: var(--border-default);
}

/* Ghost/Text Button */
.btn-ghost,
.btn-text {
  background-color: transparent;
  color: var(--text-primary);
  border-color: transparent;
  padding: 0.5rem 1rem;
}

.btn-ghost:hover:not(:disabled),
.btn-text:hover:not(:disabled) {
  background-color: var(--bg-hover);
  text-decoration: underline;
}

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Full width button */
.btn-block {
  width: 100%;
  display: flex;
}

/* Icon-only buttons */
.btn-icon {
  padding: 0.75rem;
  min-width: 44px; /* Touch target size */
  min-height: 44px;
}

.btn-icon.btn-sm {
  padding: 0.5rem;
  min-width: 36px;
  min-height: 36px;
}

/* Loading state */
.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

/* Button groups */
.btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 0 1 auto;
}

.btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .btn {
    /* Larger touch targets on mobile */
    min-height: 44px;
    padding: 0.875rem 1.25rem;
  }
  
  .btn-sm {
    min-height: 36px;
    padding: 0.625rem 1rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }
  
  .btn:focus-visible {
    outline-width: 3px;
  }
}

/* Print styles */
@media print {
  .btn {
    border: 1px solid currentColor !important;
    color: var(--text-primary) !important;
    background: transparent !important;
  }
}/* Form Components */
/* Shared Form Styles for Dashboard Upgrade */

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    background-color: var(--bg-card);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Select */
select.form-control {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-label.required::after {
    content: ' *';
    color: var(--error);
}

.form-help {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.input-group-prepend,
.input-group-append {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
}

.input-group-prepend {
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

.input-group-append {
    border-left: 0;
    border-radius: 0 8px 8px 0;
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Search Input */
.search-input {
    position: relative;
}

.search-input .form-control {
    padding-left: 2.75rem;
}

.search-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.search-input.has-value .search-input-clear {
    opacity: 1;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin: 0;
    margin-right: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    background-color: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.form-check-input[type="checkbox"]:checked::after {
    width: 6px;
    height: 10px;
    border: 2px solid white;
    border-top: 0;
    border-left: 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.form-check-input[type="radio"]:checked::after {
    width: 8px;
    height: 8px;
    background-color: var(--bg-surface);
    border-radius: 50%;
}

.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Toggle Switch */
.form-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-switch-input {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-switch-input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--bg-surface);
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-switch-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch-input:checked::after {
    transform: translateX(24px);
}

.form-switch-label {
    margin-left: 0.75rem;
    cursor: pointer;
    user-select: none;
}

/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    padding: 0;
    background-color: var(--bg-secondary);
    border-radius: 3px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    border: none;
}

/* Form Validation */
.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-invalid:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(var(--error-rgb), 0.1);
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-valid:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(var(--success-rgb), 0.1);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--error);
}

.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--success);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

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

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Variants */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-dark);
}

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

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

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

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

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 0 1 auto;
}

.btn-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
    }
}/**
 * Mobile Forms Optimization
 * Enhanced form inputs and controls for mobile devices
 */

/* Base form improvements for touch */
@media (max-width: 968px) {
    /* Increase touch targets */
    .form-input,
    .form-select,
    textarea,
    select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="time"] {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
        border-width: 2px;
    }
    
    /* Better focus states */
    .form-input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px var(--link-bg-alpha);
        outline: none;
    }
    
    /* Larger labels */
    .form-label {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
    }
    
    /* Form groups spacing */
    .form-group {
        margin-bottom: 24px;
    }
    
    /* Checkbox and radio improvements */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        flex-shrink: 0;
        cursor: pointer;
    }
    
    /* Labels for checkboxes/radios */
    label:has(input[type="checkbox"]),
    label:has(input[type="radio"]) {
        display: flex;
        align-items: flex-start;
        cursor: pointer;
        padding: 8px 0;
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Select dropdown improvements */
    select {
        appearance: none;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        padding-right: 40px;
    }
    
    /* Textarea improvements */
    textarea {
        min-height: 120px;
        resize: vertical;
        line-height: 1.5;
    }
    
    /* Button spacing in forms */
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 32px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 16px;
        padding: 14px 24px;
        font-weight: 600;
    }
    
    /* File upload areas */
    .file-upload-area {
        min-height: 120px;
        border: 2px dashed var(--border-color);
        border-radius: 12px;
        padding: 20px;
        text-align: center;
    }
    
    .upload-prompt {
        font-size: 16px;
    }
    
    /* Form hints and errors */
    .form-hint,
    .form-error,
    small {
        font-size: 14px;
        margin-top: 6px;
        display: block;
        line-height: 1.4;
    }
    
    /* Inline form elements */
    .form-row {
        flex-direction: column;
        gap: 24px;
    }
    
    .form-row .form-group {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Date inputs - native on mobile */
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        position: relative;
    }
    
    /* Number input spinners */
    input[type="number"] {
        -moz-appearance: textfield;
    }
    
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
        height: 44px;
        width: 44px;
        cursor: pointer;
    }
    
    /* Password visibility toggle */
    .password-field-wrapper {
        position: relative;
    }
    
    .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--text-light);
        cursor: pointer;
        padding: 8px;
        font-size: 20px;
    }
    
    /* Floating labels for better UX */
    .floating-label-group {
        position: relative;
        margin-bottom: 24px;
    }
    
    .floating-label-group input:focus + label,
    .floating-label-group input:not(:placeholder-shown) + label {
        transform: translateY(-24px) scale(0.85);
        color: var(--primary-color);
    }
    
    .floating-label-group label {
        position: absolute;
        left: 16px;
        top: 14px;
        transition: all 0.2s ease;
        pointer-events: none;
        color: var(--text-light);
    }
    
    /* Search inputs */
    input[type="search"] {
        -webkit-appearance: none;
        padding-left: 44px;
    }
    
    .search-wrapper {
        position: relative;
    }
    
    .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
    }
    
    /* Form section headers */
    .form-section {
        margin-bottom: 32px;
        padding: 20px;
        background: var(--bg-surface);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
    }
    
    .form-section h3 {
        font-size: 20px;
        margin-bottom: 20px;
        color: var(--primary-color);
    }
    
    /* Progress indicators for multi-step forms */
    .form-progress {
        display: flex;
        justify-content: space-between;
        margin-bottom: 32px;
        padding: 0;
        list-style: none;
    }
    
    .form-progress li {
        flex: 1;
        text-align: center;
        position: relative;
        font-size: 14px;
    }
    
    /* Autocomplete suggestions */
    .autocomplete-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        max-height: 200px;
        overflow-y: auto;
        z-index: 100;
    }
    
    .autocomplete-suggestion {
        padding: 12px 16px;
        cursor: pointer;
        font-size: 16px;
    }
    
    .autocomplete-suggestion:hover {
        background: var(--bg-color);
    }
    
    /* Toggle switches */
    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 32px;
    }
    
    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    
    .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--border-default);
        transition: .4s;
        border-radius: 34px;
    }
    
    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 24px;
        width: 24px;
        left: 4px;
        bottom: 4px;
        background-color: var(--bg-surface);
        transition: .4s;
        border-radius: 50%;
    }
    
    input:checked + .toggle-slider {
        background-color: var(--primary-color);
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(28px);
    }
    
    /* Accessibility improvements */
    .form-input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Loading states */
    .form-input.loading {
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.5A6.5 6.5 0 0 0 3.5 10 .75.75 0 0 1 2 10a8 8 0 1 1 8 8 .75.75 0 0 1 0-1.5A6.5 6.5 0 0 0 10 3.5z' fill='%23666' fill-rule='evenodd'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 44px;
    }
    
    /* Validation states */
    .form-input.is-valid {
        border-color: var(--success-color);
        padding-right: 44px;
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2338a169' fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }
    
    .form-input.is-invalid {
        border-color: var(--error-color);
        padding-right: 44px;
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23e53e3e' fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .form-input,
    select,
    textarea {
        font-size: 16px; /* Ensure no zoom on iOS */
        padding: 10px 14px;
    }
    
    .form-section {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .form-actions {
        gap: 10px;
        margin-top: 24px;
    }
    
    .form-actions .btn {
        padding: 12px 20px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 968px) and (orientation: landscape) {
    .form-container {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .form-section {
        padding: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .form-input,
    select,
    textarea {
        background-color: var(--bg-surface-dark);
        color: var(--text-primary-dark);
        border-color: var(--border-default-dark);
    }
    
    .form-input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--link-dark);
        box-shadow: 0 0 0 4px var(--link-bg-alpha);
    }
    
    .form-section {
        background: var(--bg-card-dark);
    }
}/* Card Components */
/* Shared Card Styles for Dashboard Upgrade */

/* Base Card Container */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    transition: all 0.3s var(--animation-timing, cubic-bezier(0.4, 0, 0.2, 1));
    overflow: hidden;
    position: relative;
}

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

.card:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

/* Card Header */
.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

/* Card Body */
.card-body {
    padding: 1.5rem;
}

.card-body.no-padding {
    padding: 0;
}

/* Card Footer */
.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-action {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Card Media */
.card-media {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card-media img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.card:hover .card-media img {
    transform: scale(1.05);
}

.card-media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: var(--text-on-accent);
    transform: translateY(100%);
    transition: transform 0.3s;
}

.card:hover .card-media-overlay {
    transform: translateY(0);
}

/* Card Variants */
.card.clickable {
    cursor: pointer;
}

.card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Card Badges */
.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: var(--text-on-accent);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-badge.warning {
    background: var(--warning);
}

.card-badge.error {
    background: var(--error);
}

.card-badge.success {
    background: var(--success);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Story Card Specific */
.story-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.story-card-content {
    flex: 1;
    padding: 1.5rem;
}

.story-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.story-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.story-card-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.story-card-author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-card-author-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.story-card-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.story-card-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.story-card-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.story-card-stat i {
    font-size: 1rem;
}

/* Card Loading State */
.card.loading {
    position: relative;
    overflow: hidden;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

/* Card Empty State */
.card-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.card-empty-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.card-empty-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.card-empty-action {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--text-on-accent);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.card-empty-action:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 0.75rem 1rem;
    }
}

/* Animations */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}/* Modal Components */
/* Shared Help Modal Styles */

/* Page Help Button */
.page-help-button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.page-help-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.page-help-button i {
    font-size: 1rem;
}

/* Help Modal */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.help-modal.active {
    display: block;
}

.help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.help-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.help-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.help-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.help-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section p {
    margin: 0 0 0.75rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-section ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}

.help-section li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.25rem;
}

.help-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.help-section li strong {
    color: var(--text-primary);
}

/* Help Footer */
.help-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle);
}

.help-modal-footer h5 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.help-footer-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.help-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.help-footer-link:hover {
    background: var(--primary);
    color: var(--text-on-accent);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .help-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .help-modal-header {
        padding: 1rem;
    }
    
    .help-modal-body {
        padding: 1rem;
    }
    
    .help-modal-footer {
        padding: 1rem;
    }
    
    .help-footer-links {
        flex-direction: column;
    }
    
    .help-footer-link {
        width: 100%;
        justify-content: center;
    }
}

/* Animation */
.help-modal.show {
    display: block;
}

.help-modal.show .help-modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}/* Page Help Modal Component Styles */

.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding: 1rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.help-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.help-modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

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

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

.help-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.help-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.help-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section-icon {
    color: var(--primary);
}

.help-overview {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

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

.help-feature-item,
.help-tip-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-surface);
    border-radius: 8px;
    transition: all 0.2s;
}

.help-feature-item:hover,
.help-tip-item:hover {
    background: var(--bg-hover);
}

.help-feature-icon,
.help-tip-icon {
    color: var(--primary);
    min-width: 24px;
    margin-top: 2px;
}

.help-feature-text,
.help-tip-text {
    color: var(--text-primary);
    line-height: 1.5;
    flex: 1;
}

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

.help-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: opacity 0.2s;
}

.help-link:hover {
    opacity: 0.8;
}

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

.help-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.help-action-btn.primary {
    background: var(--primary);
    color: var(--text-on-accent);
}

.help-action-btn.primary:hover {
    opacity: 0.9;
}

/* Page Help Button */
.page-help-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.page-help-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .help-modal {
        padding: 0;
    }
    
    .help-modal-content {
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }
    
    .help-feature-item,
    .help-tip-item {
        padding: 0.5rem;
    }
}

/* Dark Theme Overrides */
[data-theme="dark"] .help-modal {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .help-modal-content {
    background: var(--bg-card);
}

[data-theme="dark"] .help-feature-item,
[data-theme="dark"] .help-tip-item {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .help-feature-item:hover,
[data-theme="dark"] .help-tip-item:hover {
    background: rgba(255, 255, 255, 0.05);
}/* Family Tree Modal Styles */

.family-tree-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  overflow-y: auto;
}

.family-tree-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.family-tree-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9999;
}

.family-tree-modal-content {
  background: var(--bg-surface, #ffffff);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow-color-md, rgba(0, 0, 0, 0.15));
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 10001;
}

.family-tree-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.family-tree-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary);
}

.family-tree-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.family-tree-modal-close:hover {
  background-color: var(--bg-hover);
}

.family-tree-modal-body {
  padding: 20px;
}

.family-tree-modal-footer {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Styles */
.member-form {
  display: grid;
  gap: 20px;
}

.form-section {
  display: grid;
  gap: 15px;
}

.form-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label.required::after {
  content: ' *';
  color: #dc3545;
}

.form-input,
.form-select,
.form-textarea {
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-default);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

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

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Date input styling now handled by form-row */

.location-input-group {
  display: grid;
  gap: 10px;
}

/* Photo Upload */
.photo-upload-area {
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-upload-area:hover {
  border-color: var(--border-default);
  background-color: #e3f2fd;
}

.photo-upload-area.has-photo {
  padding: 10px;
}

.photo-preview {
  max-width: 200px;
  max-height: 200px;
  margin: 0 auto;
  position: relative;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.photo-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #dc3545;
  color: var(--text-on-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Relationship Modal */
.relationship-form {
  display: grid;
  gap: 20px;
}

.member-selector {
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  padding: 15px;
  background-color: #f8f9fa;
}

.member-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  margin-bottom: 10px;
}

.member-list {
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  gap: 5px;
}

.member-item {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-item:hover {
  background-color: #e3f2fd;
  border-color: var(--border-default);
}

.member-item.selected {
  background-color: #2196F3;
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.member-info {
  display: flex;
  flex-direction: column;
}

.member-name {
  font-weight: 500;
}

.member-dates {
  font-size: 12px;
  opacity: 0.7;
}

/* Search Modal */
.search-modal-body {
  padding: 0;
}

.search-input-container {
  padding: 20px;
  border-bottom: 1px solid var(--border-default);
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 16px;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

.search-result-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.search-result-details {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.no-results {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

/* Manage Relationships Modal */
.manage-relationships-container {
  min-height: 400px;
}

.relationships-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
}

.relationships-toolbar .search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 14px;
}

.relationship-stats {
  color: var(--text-secondary);
  font-size: 14px;
}

.relationships-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.relationship-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: all 0.2s;
}

.relationship-item:hover {
  background: #e9ecef;
  border-color: var(--border-default);
}

.relationship-info {
  flex: 1;
}

.relationship-description {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.relationship-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.relationship-actions {
  display: flex;
  gap: 8px;
}

.no-relationships {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Button States */
.btn.btn-success {
  background-color: #28a745 !important;
  border-color: var(--border-default) !important;
  color: var(--text-on-accent) !important;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

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

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

/* Toast notifications */
.toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #333;
  color: var(--text-on-accent);
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 10002;
}

.toast-notification.show {
  transform: translateX(0);
}

.toast-notification.success {
  background: #28a745;
}

.toast-notification.error {
  background: #dc3545;
}

.toast-notification i {
  font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .date-input-group {
    grid-template-columns: 1fr;
  }
  
  .family-tree-modal-content {
    max-width: 100%;
    margin: 10px;
  }
  
  .relationship-item {
    flex-direction: column;
    gap: 10px;
  }
  
  .relationship-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Relationship Prompts Styles */
.relationship-prompts {
  margin-top: 15px;
}

.prompt-group {
  margin-bottom: 15px;
  padding: 10px 0;
}

.prompt-label {
  display: block;
  font-weight: 600;
  color: #2E5266;
  margin-bottom: 8px;
  font-size: 14px;
}

.quick-add-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-quick-add {
  background: #6E8898;
  color: var(--text-on-accent);
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-quick-add:hover {
  background: #5a7380;
  transform: translateY(-1px);
}

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

.btn-quick-add i {
  font-size: 11px;
}

/* Existing Relationships Display */
.existing-relationships {
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.relationship-chip {
  display: inline-flex;
  align-items: center;
  background: #e9ecef;
  color: #495057;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
  gap: 5px;
}

.relationship-chip.parent {
  background: #d4edda;
  color: #155724;
}

.relationship-chip.spouse {
  background: #f8d7da;
  color: #721c24;
}

.relationship-chip.child {
  background: #d1ecf1;
  color: #0c5460;
}

.relationship-chip .remove-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-left: 3px;
  opacity: 0.7;
}

.relationship-chip .remove-btn:hover {
  opacity: 1;
}

.no-relationships {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 15px;
  margin: 0;
}

/* Inline Relationship Form */
.inline-relationship-form {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-top: 15px;
  animation: slideDown 0.3s ease-out;
}

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

.inline-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #e9ecef;
  border-bottom: 1px solid #dee2e6;
  border-radius: 8px 8px 0 0;
}

.inline-form-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #2E5266;
}

.inline-form-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-form-close:hover {
  color: #495057;
}

.inline-form-body {
  padding: 16px;
}

.inline-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.inline-form-actions .btn {
  padding: 6px 12px;
  font-size: 13px;
}

/* Responsive updates for relationship prompts */
@media (max-width: 768px) {
  .quick-add-buttons {
    flex-direction: column;
  }
  
  .btn-quick-add {
    justify-content: center;
  }
  
  .inline-form-actions {
    flex-direction: column;
  }
  
  .inline-form-actions .btn {
    width: 100%;
  }
}/* Landing Page Modal Styles */
/* Extracted from index.html to fix rendering issues */

/* Modal Overlay - Use ID selector for higher specificity */
#earlyAccessModal.modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-backdrop, rgba(0, 0, 0, 0.7)) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* When modal is shown via JavaScript */
#earlyAccessModal.modal-overlay[style*="display: flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modal Content Container */
#earlyAccessModal .modal-content {
    background: var(--bg-card) !important;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-default);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    text-align: center;
}

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

.form-group-last {
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-default);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px var(--hover-overlay);
}

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

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.modal-btn.btn-primary {
    background: var(--link);
    color: var(--text-on-accent);
}

.modal-btn.btn-primary:hover {
    background: var(--link-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.modal-btn.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 2px solid var(--border-default);
}

.modal-btn.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--link);
}

.modal-message {
    display: none;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    z-index: 1;
}

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

.modal-close-btn:focus {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

/* Dark mode modal adjustments */
.theme-dark #earlyAccessModal .modal-content {
    background: var(--bg-card-dark);
    border: 1px solid var(--border-subtle);
}

.theme-dark .form-input {
    background: var(--bg-input-dark);
    border-color: var(--border-default-dark);
}

.theme-dark .form-input:focus {
    border-color: var(--link-dark);
}

/* Mobile modal styles */
@media (max-width: 640px) {
    #earlyAccessModal.modal-overlay {
        padding: 0;
        align-items: flex-end !important;
    }
    
    #earlyAccessModal .modal-content {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        margin: 0;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .modal-btn {
        width: 100%;
        padding: 0.875rem;
    }
}/* Navigation Components */
/* Modern Navbar Component Styles */

.modern-navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
}

.navbar-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    margin: 0 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-link.active {
    color: var(--primary);
    background: var(--bg-selected);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem;
        margin: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Dark Theme Overrides */
[data-theme="dark"] .modern-navbar {
    background: var(--bg-card);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}/**
 * Mobile Navigation Styles
 * Responsive navigation for all screen sizes
 */

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--hover-overlay);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: var(--hover-overlay);
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 20px;
}

.hamburger span {
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

/* Active state */
.mobile-nav-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
    transform-origin: center;
}

.mobile-nav-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
    transform-origin: center;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.open {
    right: 0;
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    z-index: 1;
}

/* Mobile Menu Content */
.mobile-nav-items {
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    gap: 0;
}

.mobile-nav-items .nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--border-default);
    transition: all 0.2s ease;
}

.mobile-nav-items .nav-link:hover,
.mobile-nav-items .nav-link.active {
    background-color: var(--bg-color);
    color: var(--primary-color);
    padding-left: 30px;
}

/* Mobile Nav Actions */
.mobile-nav-actions {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-default);
}

.mobile-nav-actions .language-selector {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Theme toggle in mobile menu */
.mobile-nav-actions #theme-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.mobile-nav-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Admin dropdown in mobile */
.mobile-nav-items .nav-dropdown {
    position: relative;
}

.mobile-nav-items .dropdown-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--bg-color);
    margin: 0;
    width: 100%;
    padding: 0;
}

.mobile-nav-items .nav-dropdown.show .dropdown-menu {
    display: block;
}

.mobile-nav-items .dropdown-menu .dropdown-item {
    padding: 12px 40px;
    border-bottom: 1px solid var(--border-default);
}

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    display: none;
    z-index: 999;
}

.mobile-menu-overlay.show {
    display: block;
}

/* Desktop adjustments */
@media (min-width: 969px) {
    .mobile-nav-toggle,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile adjustments */
@media (max-width: 968px) {
    /* Show mobile nav */
    .mobile-nav-toggle {
        display: block;
    }
    
    /* Hide desktop nav items */
    .nav-menu {
        display: none;
    }
    
    /* Adjust navbar layout */
    .navbar .container,
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    /* Adjust nav brand */
    .nav-brand h1,
    .nav-brand .tenant-name {
        font-size: 1.25rem;
    }
    
    /* User avatar visible on mobile */
    .user-avatar-container {
        display: flex !important;
        position: relative;
        margin-right: 60px; /* Space for hamburger */
        z-index: 1002;
    }
    
    /* Hide other nav actions on mobile but keep theme toggle visible */
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-right: 60px; /* Space for hamburger */
    }
    
    /* Keep theme toggle visible on mobile */
    #theme-toggle-container {
        display: flex !important;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .mobile-menu {
        width: 90%;
    }
    
    .nav-brand h1,
    .nav-brand .tenant-name {
        font-size: 1.1rem;
    }
    
    .mobile-nav-items .nav-link {
        padding: 12px 15px;
    }
}

/* Ensure proper stacking */
body.mobile-menu-open {
    overflow: hidden;
}

/* Touch-friendly sizes */
@media (max-width: 968px) {
    .btn,
    button,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 968px) and (orientation: landscape) {
    .mobile-menu {
        padding-top: 10px;
    }
    
    .mobile-nav-items {
        padding-top: 60px;
    }
    
    .mobile-nav-items .nav-link {
        padding: 10px 15px;
    }
}/* Mobile Navbar Proper Fix */
/* Date: 2025-08-15 */
/* Show hamburger menu and avatar correctly on mobile */

@media screen and (max-width: 768px) {
  /* ========================================
     TOP NAVBAR - PROPER MOBILE LAYOUT
     ======================================== */
  
  .navbar,
  .modern-navbar {
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: var(--bg-surface) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    height: 60px !important;
  }

  .navbar-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
    padding: 0 12px !important;
  }

  /* ========================================
     HAMBURGER MENU - LEFT SIDE
     ======================================== */
  
  .navbar-menu-btn,
  #navbar-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .menu-icon {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 24px !important;
    height: 24px !important;
    position: relative !important;
  }

  .menu-line {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background: #374151 !important;
    margin: 3px 0 !important;
    transition: all 0.3s ease !important;
    border-radius: 1px !important;
  }

  /* ========================================
     BRAND - CENTER
     ======================================== */
  
  .navbar-brand {
    flex: 1 !important;
    text-align: center !important;
    padding: 0 8px !important;
  }

  .brand-name {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .brand-icon {
    display: none !important; /* Hide icon on mobile to save space */
  }

  /* ========================================
     RIGHT SIDE - NOTIFICATIONS & AVATAR
     ======================================== */
  
  .navbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
  }

  /* Hide add button on mobile */
  #quick-add-btn {
    display: none !important;
  }

  /* Keep notifications */
  #notifications-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 18px !important;
    position: relative !important;
  }

  .notification-badge {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    background: var(--error) !important;
    color: var(--text-on-accent) !important;
    font-size: 10px !important;
    font-weight: bold !important;
    padding: 2px 4px !important;
    border-radius: 10px !important;
    min-width: 16px !important;
    text-align: center !important;
  }

  /* ========================================
     AVATAR - SHOW WITH INITIALS
     ======================================== */
  
  #user-avatar-container {
    display: block !important;
    position: relative !important;
  }

  .user-avatar-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .user-avatar-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--link) !important;
    color: var(--text-on-accent) !important;
    border: 2px solid white !important;
    cursor: pointer !important;
    position: relative !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
  }

  /* Hide icon, show initials */
  .user-avatar-icon {
    display: none !important;
  }

  .user-avatar-initials {
    display: block !important;
    color: var(--text-on-accent) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  /* Remove dropdown arrow from avatar */
  .user-avatar-btn .dropdown-arrow,
  .user-avatar-btn svg,
  .user-avatar-btn i {
    display: none !important;
  }

  /* Show initials */
  .user-avatar-btn .user-avatar-initials {
    display: block !important;
  }

  /* ========================================
     BOTTOM NAVIGATION - KEEP SEPARATE
     ======================================== */
  
  .mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 56px !important;
    background: var(--bg-surface) !important;
    border-top: 1px solid #e5e7eb !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 999 !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
  }

  .bottom-nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 6px 4px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .bottom-nav-item.active {
    color: var(--link) !important;
  }

  .bottom-nav-item .nav-icon {
    font-size: 20px !important;
    margin-bottom: 2px !important;
  }

  .bottom-nav-item .nav-label {
    font-size: 11px !important;
    font-weight: 500 !important;
  }

  /* ========================================
     DARK MODE
     ======================================== */
  
  [data-theme="dark"] .navbar,
  [data-theme="dark"] .modern-navbar {
    background: #1f2937 !important;
  }

  [data-theme="dark"] .menu-line {
    background: #d1d5db !important;
  }

  [data-theme="dark"] .brand-name {
    color: #f9fafb !important;
  }

  [data-theme="dark"] #notifications-btn {
    color: #d1d5db !important;
  }

  [data-theme="dark"] .mobile-bottom-nav {
    background: #1f2937 !important;
    border-top-color: #374151 !important;
  }

  [data-theme="dark"] .bottom-nav-item {
    color: var(--text-muted) !important;
  }

  [data-theme="dark"] .bottom-nav-item.active {
    color: #60a5fa !important;
  }
}

/* Very small screens */
@media screen and (max-width: 360px) {
  .brand-name {
    font-size: 16px !important;
  }
  
  #notifications-btn {
    display: none !important; /* Hide notifications on very small screens */
  }
}/* Table Components */
  /* Additional light theme colors */
  /* Additional theme colors */
    /* Alternative: Card layout for tables */
    animation-fill-mode: both;
/* Animation for smooth appearance */
/* Animation for smooth transitions */
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.5A6.5 6.5 0 0 0 3.5 10 .75.75 0 0 1 2 10a8 8 0 1 1 8 8 .75.75 0 0 1 0-1.5A6.5 6.5 0 0 0 10 3.5z' fill='%23666' fill-rule='evenodd'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2338a169' fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z'/%3E%3C/svg%3E");
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23e53e3e' fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z'/%3E%3C/svg%3E");
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
body.theme-dark {
body.theme-dark .modal-overlay {
body.theme-light {
        border-width: 1px;
        border-width: 2px;
    border-width: 2px;
  border-width: 2px;
  border-width: 5px;
.btn-full-width {
/* Button Styles with Theme Support */
 * Button System - Theme-aware button styles with WCAG AA compliance
.calc-input-group input[type="range"]::-moz-range-thumb {
.calc-input-group input[type="range"]::-webkit-slider-thumb {
/* Carousel Component Styles with Theme Support */
  clip-path: inset(0 50% 0 0);
.comment-author {
    .comparison-table,
.comparison-table {
.connections-overlay path {
.connection-strength {
/* CSS Variables for theming */
/* Dark theme class override */
/* Dark theme danger */
    /* Dark theme high contrast */
/* Dark theme info */
    /* Dark theme mobile adjustments */
/* Dark theme primary button */
/* Dark theme secondary button */
/* Dark theme success */
/* Dark theme warning */
.data-table {
.data-table tbody tr:hover {
.data-table td {
.data-table th {
.data-table th,
[data-theme="dark"] {
  [data-theme="dark"] .activity-item {
  [data-theme="dark"] .bottom-nav-item {
  [data-theme="dark"] .bottom-nav-item.active {
  [data-theme="dark"] .brand-name {
  [data-theme="dark"] .brand-name,
[data-theme="dark"] .center-sphere {
  [data-theme="dark"] .chat-hero,
  [data-theme="dark"] .chat-input,
  [data-theme="dark"] .chat-input-wrapper {
[data-theme="dark"] .chat-professional-page {
[data-theme="dark"] .loading-overlay {
  [data-theme="dark"] .menu-line {
  [data-theme="dark"] #messageInput {
  [data-theme="dark"] .mobile-bottom-nav {
  [data-theme="dark"] .modern-navbar {
  [data-theme="dark"] .navbar,
  [data-theme="dark"] #notifications-btn {
[data-theme="dark"] .orbit {
[data-theme="dark"] .orbital-section {
[data-theme="dark"] .orbit-dot {
  [data-theme="dark"] .page-title,
  [data-theme="dark"] .quick-action-card,
  [data-theme="dark"] .recent-activity,
  [data-theme="dark"] .section-title {
  [data-theme="dark"] .stat-card,
  [data-theme="dark"] .stat-value,
  [data-theme="dark"] .user-dropdown {
  [data-theme="dark"] .user-dropdown-item {
/* Debug - removed border that was causing issues */
/* Disable transitions on theme change */
.emoji-grid::-webkit-scrollbar-thumb {
.emoji-grid::-webkit-scrollbar-thumb:hover {
/* Ensure carousel content stays within bounds */
 * ensuring proper contrast ratios in both light and dark themes
.event-card.birth { border-color: var(--success-color); }
.event-card.death { border-color: var(--text-secondary); }
.event-marker.birth { border-color: var(--success-color); }
.event-marker.death { border-color: var(--text-secondary); }
.event-month {
.event-table {
.event-table td {
.event-table th {
.event-table tr:hover {
.event-type-badge.birth { background-color: var(--success-bg-light); color: var(--success-color); }
.event-type-badge.death { background-color: var(--bg-hover); color: var(--text-primary); }
.event-type-badge.other { background-color: var(--bg-hover); color: var(--text-secondary); }
.face-thumbnail {
.face-thumbnail img {
.form-group.full-width {
/* Full width button */
    .full-width-mobile {
.future-theme {
    .gallery-table {
.gallery-table {
    .gallery-table td {
.gallery-table td {
    .gallery-table th,
.gallery-table th {
.gallery-table tr:hover {
.generation-tree::-webkit-scrollbar-thumb {
.generation-tree::-webkit-scrollbar-thumb:hover {
.hamburger span:nth-child(1) {
.hamburger span:nth-child(2) {
.hamburger span:nth-child(3) {
.health-card {
/* Health cards */
.health-details {
    .health-grid {
.health-grid {
/* Health Grid */
.health-header {
.health-indicator {
.health-indicator.error {
.health-indicator.healthy {
/* Health indicators for system page */
.health-indicator.warning {
.health-item {
.health-label {
.health-status {
    height: auto; /* Grow with content */
    /* Hide other nav actions on mobile but keep theme toggle visible */
/* Hide the navbar on chat page */
html.theme-dark,
html.theme-light,
/* Integration with animate.css */
/* Integration with landing page */
    /* Keep theme toggle visible on mobile */
    /* Language Selector Dark Mode - Use theme variables */
/* Legal pages have their own spacing rules */
/* Legal sections have their own padding rules */
  /* Light theme */
  /* Light theme colors */
/* Light theme (default and explicit) */
    /* Light theme high contrast */
    /* Light theme mobile adjustments */
    /* Map missing variables to theme system */
        max-width: 100%;
    max-width: 100%;
  max-width: 100%;
    max-width: 1000px;
  max-width: 1000px;
  max-width: 100vw;
    max-width: 1200px;
  max-width: 1200px;
    max-width: 1400px;
    max-width: 1600px; /* Prevent too wide spreading */
    max-width: 180px;
  max-width: 200px;
    max-width: 250px;
        max-width: 300px;
    max-width: 300px;
  max-width: 300px;
        max-width: 320px;
    max-width: 320px;
  max-width: 320px;
  max-width: 350px;
    max-width: 400px;
  max-width: 400px;
    max-width: 450px;
    max-width: 480px;
    max-width: 50%;
    max-width: 500px;
  max-width: 500px;
    max-width: 60%;
        max-width: 600px;
    max-width: 600px;
  max-width: 600px;
  max-width: 70%;
    max-width: 700px;
    max-width: 750px;
    max-width: 768px;
    max-width: 800px;
  max-width: 800px;
    max-width: 800px; /* Limit width to force wrapping */
    max-width: 85%;
  max-width: 85vw;
    max-width: 90%;
    max-width: 900px;
  max-width: 900px;
    max-width: 90vw;
        max-width: 95%;
    max-width: calc(100vw - 40px);
        max-width: none;
    max-width: none;
        max-width: none !important;
@media (max-width: 1024px) {
@media (max-width: 1200px) {
@media (max-width: 480px) {
@media (max-width: 640px) {
@media (max-width: 767px) {
    @media (max-width: 768px) {
@media (max-width: 768px) {
@media (max-width: 768px) and (orientation: landscape) {
@media (max-width: 968px) {
@media (max-width: 968px) and (orientation: landscape) {
@media (min-width: 1024px) {
@media (min-width: 1025px) {
@media (min-width: 480px) {
@media (min-width: 768px) {
@media (min-width: 768px) and (max-width: 1023px) {
@media (min-width: 769px) and (max-width: 1024px) {
@media (min-width: 969px) {
@media screen and (max-width: 360px) {
@media screen and (max-width: 768px) {
@media screen and (max-width: 768px) and (orientation: landscape) {
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 768px),
/* Member cards - Modern design with dates */
.member-grid::-webkit-scrollbar-thumb,
.member-grid::-webkit-scrollbar-thumb:hover,
.migration-health { stroke: var(--migration-health, #e83e8c); }
.migration-other { stroke: var(--migration-other, #6c757d); }
.migration-path {
.migration-path.active {
/* Migration path enhancements for layers */
.migration-path.family-branch {
.migration-path:hover {
/* Migration Path Styles */
.migration-path.time-period {
       (min-resolution: 192dpi) and (max-width: 768px) {
    min-width: 0;
  min-width: 0;
        min-width: 100%;
    min-width: 100%;
  min-width: 100%;
        min-width: 100px;
    min-width: 100px;
  min-width: 100px;
    min-width: 120px;
    min-width: 140px;
    min-width: 150px;
  min-width: 150px;
    min-width: 16px !important;
    min-width: 180px;
    min-width: 18px;
  min-width: 18px;
        min-width: 200px;
    min-width: 200px;
  min-width: 200px;
    min-width: 20px;
    min-width: 280px;
  min-width: 300px;
    min-width: 350px;
    min-width: 36px;
  min-width: 36px;
    min-width: 3rem;
        min-width: 40px;
    min-width: 40px;
  min-width: 40px;
        min-width: 44px;
    min-width: 44px;
  min-width: 44px; /* Touch target size */
  min-width: 45px;
  min-width: 50px;
        min-width: 600px;
    min-width: 60px;
    min-width: 70px;
    min-width: 80px;
  min-width: 80px;
        min-width: auto;
    min-width: auto;
  min-width: var(--touch-target-min);
/* Mobile adjustments for theme toggle */
/* Mobile Enhancements - Boost contrast for outdoor viewing */
.mobile-nav-actions #theme-toggle-container {
.mobile-nav-toggle.active .hamburger span:nth-child(1) {
.mobile-nav-toggle.active .hamburger span:nth-child(2) {
.mobile-nav-toggle.active .hamburger span:nth-child(3) {
    -moz-osx-font-smoothing: grayscale;
  -moz-osx-font-smoothing: grayscale;
.nav-dropdown:focus-within .dropdown-menu,
/* NUCLEAR OVERRIDE - Maximum specificity with !important on everything */
 * Optimizes the dashboard experience for mobile devices
    outline-width: 3px;
.overlay-controls input[type="range"]::-webkit-slider-thumb {
.parent-author {
.parent-author img {
.parent-author span {
.password-strength {
.password-strength-bar {
.password-strength-bar.medium {
.password-strength-bar.strong {
.password-strength-bar.weak {
/* Password Strength Indicator */
.password-strength-text {
.password-strength-text.medium {
.password-strength-text.strong {
.password-strength-text.weak {
/* Phase type badges with icons */
.photo-theme {
.preview-thumbnails {
/* Print Media - Force light theme with high contrast */
/* Profile container with proper spacing */
/* Profile header with help button */
.related-stories::-webkit-scrollbar-thumb {
/* Remove duplicate profile-header styles since we defined them above */
:root.theme-dark,
    scroll-behavior: smooth;
  scroll-behavior: smooth;
/* Smooth scroll behavior */
/* Smooth scrolling */
  /* Status background colors for dark theme */
  /* Status background colors for light theme */
.status-indicator.healthy {
.stories-list::-webkit-scrollbar-thumb {
.stories-list::-webkit-scrollbar-thumb:hover {
.story-author::before {
.story-thumbnail {
    stroke-width: 2;
  stroke-width: 3;
  stroke-width: 4;
  stroke-width: 5;
 * Styling for the emoji selection interface
 * Styling for thread list modal and thread UI components
/* System preference detection - DISABLED to force manual theme selection */
    table {
table {
    .table-cards tbody tr {
    .table-cards td {
    .table-cards td:before {
    .table-preview {
.table-preview {
.table-preview-icon {
    .table-responsive {
.table-responsive {
td {
    text-decoration: line-through;
th {
.theme-dark .action-tile {
.theme-dark .action-tile:hover {
.theme-dark .activity-item {
.theme-dark .btn-danger {
.theme-dark .btn-danger:hover:not(:disabled) {
.theme-dark .btn-info {
.theme-dark .btn-info:hover:not(:disabled) {
.theme-dark .btn-primary {
.theme-dark .btn-primary:active:not(:disabled) {
.theme-dark .btn-primary:hover:not(:disabled) {
.theme-dark .btn-secondary {
.theme-dark .btn-secondary:active:not(:disabled) {
.theme-dark .btn-secondary:hover:not(:disabled) {
.theme-dark .btn-success {
.theme-dark .btn-success:hover:not(:disabled) {
.theme-dark .btn-warning {
.theme-dark .btn-warning:hover:not(:disabled) {
.theme-dark .connections-overlay path {
.theme-dark #earlyAccessModal .modal-content {
.theme-dark .form-input {
.theme-dark .form-input:focus {
.theme-dark .lang-btn {
.theme-dark .lang-btn.active,
.theme-dark .lang-btn:hover {
.theme-dark .profile-container {
.theme-dark .profile-section {
.theme-dark .progress-bar {
.theme-dark .stat-card {
.theme-dark .status-indicator {
.theme-dark .toggle-slider {
.theme-dark .toggle-switch input:checked + .toggle-slider {
.theme-dark .widget {
.theme-dark .widget:hover {
.theme-light .toggle-slider {
.theme-light .toggle-switch input:checked + .toggle-slider {
 * Theme System - Unified theme management
  .theme-toggle-btn {
.theme-toggle-btn {
.theme-toggle-btn:active {
.theme-toggle-btn:hover {
    #theme-toggle-container {
#theme-toggle-container {
.theme-transitioning * {
 * This file provides consistent button styling across the application
 * This file provides the theme switching mechanism and component-agnostic styles
/* This replaces ALL other mobile fix files */
.thread-back-btn {
.thread-back-btn:hover {
.thread-badge {
.thread-content {
.thread-count {
.thread-description {
.thread-empty-state {
.thread-empty-state i {
.thread-empty-state p {
.thread-empty-state .text-muted {
    .thread-filters {
.thread-filters {
.thread-filters .filter-btn {
.thread-filters .filter-btn.active {
.thread-filters .filter-btn:hover {
.thread-filters .filter-btn i {
.thread-header {
.thread-icon {
.thread-indicator {
.thread-indicator:hover {
.thread-info {
.thread-info .thread-count {
.thread-info .thread-title {
    .thread-item {
.thread-item {
.thread-item:hover {
.thread-list {
.thread-list-modal {
.thread-list-modal .modal-backdrop {
.thread-list-modal .modal-body {
.thread-list-modal .modal-close {
.thread-list-modal .modal-close:hover {
    .thread-list-modal .modal-content {
.thread-list-modal .modal-content {
.thread-list-modal .modal-footer {
.thread-list-modal .modal-header {
.thread-list-modal .modal-header h2 {
.thread-list-modal.show {
    .thread-list-modal.show .modal-content {
.thread-list-modal.show .modal-content {
    .thread-meta {
.thread-meta {
.thread-meta i {
.thread-meta span {
.thread-modal {
.thread-modal .form-group {
.thread-modal input[type="text"],
.thread-modal input[type="text"]:focus,
.thread-modal label {
.thread-modal .modal-backdrop {
    .thread-modal .modal-content {
.thread-modal .modal-content {
.thread-modal.show {
.thread-modal.show .modal-content {
.thread-modal textarea {
.thread-modal textarea:focus {
.thread-nav {
  .thread-overlay {
  .thread-overlay.show {
  .thread-panel {
  .thread-panel.open {
.thread-parent-message {
.thread-title {
.thread-type-options {
.thread-type-options input[type="radio"] {
.thread-type-options input[type="radio"]:checked + span {
.thread-type-options label {
.thread-type-options label:hover {
    .timeline-event:nth-child(odd) {
.timeline-event:nth-child(odd) {
    .timeline-event:nth-child(odd) .event-card {
.timeline-event:nth-child(odd) .event-card {
    .timeline-event:nth-child(odd) .event-content,
.timeline-event:nth-child(odd) .event-content {
    .timeline-event:nth-child(odd) .event-date {
.timeline-event:nth-child(odd) .event-date {
.timeline-events-list::-webkit-scrollbar-thumb,
.timeline-events-list::-webkit-scrollbar-thumb:hover,
.timeline-events-mini::-webkit-scrollbar-thumb,
.timeline-slider::-moz-range-thumb {
.timeline-slider::-webkit-slider-thumb {
.timeline-theme {
    transition: width 0.1s ease, background-color 0.2s ease;
    transition: width 0.3s;
    transition: width 0.3s ease;
  transition: width 0.3s ease;
    transition: width 0.3s ease-in-out;
    transition: width 0.5s ease;
  transition: width 0.5s ease;
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    transition: width var(--animation-duration) var(--animation-timing);
/* Tree canvas - the scrollable/zoomable area */
/* Tree viewport and canvas - removed duplicate definitions that were breaking positioning */
/* Tree viewport - the visible area */
/* Tree visualization container - full width */
.trivia-theme {
.typing-dots span:nth-child(2) {
.typing-dots span:nth-child(3) {
/* Users must explicitly choose their theme via the toggle button */
.user-table {
.user-table td {
.user-table th {
.user-table tr:hover {
    -webkit-font-smoothing: antialiased;
  -webkit-font-smoothing: antialiased;
.widget:focus-within {
.widget:nth-child(1) { animation-delay: 0s; }
.widget:nth-child(2) { animation-delay: 0.1s; }
.widget:nth-child(3) { animation-delay: 0.2s; }
.widget:nth-child(4) { animation-delay: 0.3s; }
.widget:nth-child(5) { animation-delay: 0.4s; }
    .widget.widget-two-thirds {
        width: 0;
    width: 0%;
    width: 0;
        width: 100%;
    width: 100%;
  width: 100%;
        width: 100px;
    width: 100px;
        width: 10px;
    width: 10px;
  width: 10px;
        width: 120px;
    width: 120px;
  width: 120px;
    width: 1.25rem;
        width: 12px;
    width: 12px;
  width: 12px;
    width: 140px; /* Slightly smaller cards */
        width: 14px;
        width: 150px;
  width: 150px;
    width: 160px;
        width: 16px;
    width: 16px;
  width: 16px;
    width: 18px;
  width: 18px;
  width: 1px;
  width: 1rem;
  width: 200%;
    width: 200px;
  width: 200px;
    width: 20px;
  width: 20px;
    width: 22px;
    width: 22px !important;
        width: 24px;
    width: 24px;
  width: 24px;
    width: 24px !important;
        width: 250px;
        width: 26px;
  width: 280px;
    width: 2px;
  width: 2px;
    width: 2rem;
    width: 30px;
  width: 30px;
    width: 320px;
  width: 320px;
        width: 32px;
    width: 32px;
  width: 32px;
    width: 33%;
  width: 350px;
    width: 35px;
        width: 36px;
    width: 36px;
  width: 36px;
    width: 36px !important;
  width: 380px;
        width: 38px;
    width: 3px;
  width: 3px;
    width: 4%;
  width: 400px;
        width: 40px;
    width: 40px;
  width: 40px;
    width: 40px !important;
        width: 44px;
    width: 44px;
  width: 44px;
        width: 48px;
    width: 48px;
  width: 48px;
    width: 4px;
        width: 50px;
    width: 50px;
        width: 52px;
        width: 56px;
  width: 56px;
        width: 60px;
    width: 60px;
  width: 60px;
        width: 64px;
    width: 66%;
        width: 66px;
    width: 6px;
        width: 70px;
  width: 70px;
        width: 80%;
    width: 80%;
        width: 80px;
    width: 80px;
  width: 80px;
    width: 85%;
        width: 8px;
    width: 8px;
  width: 8px;
        width: 90%;
    width: 90%;
  width: 90%;
        width: 90px;
        width: 90vw;
        width: 95%;
    width: 95%;
        width: 9px;
        width: auto;
    width: auto;
  width: auto;
        width: calc(100% + 16px);
    width: calc(100vw - 20px);
    width: calc(100vw - 40px);
    width: calc(50% - 3rem);
    width: calc(60% - 3rem);
    width: fit-content;
    width: max-content; /* Grow to fit content */
    z-index: 10; /* Ensure it's above other elements */
/* Widget Components */
/* Dashboard Widget System Styles */

/* Onboarding Carousel */
.onboarding-carousel-container {
    margin: 30px 0;
}

.onboarding-carousel {
    --carousel-gap: 16px;
}

.onboarding-slide {
    min-height: 200px;
    display: flex;
    align-items: stretch;
}

.onboarding-slide > * {
    width: 100%;
}

/* Main Widget Carousel */
.main-widget-carousel-container {
    margin: 40px 0;
    background-color: transparent;
    padding: 20px 0;
}

.carousel-section-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    position: relative;
}

.carousel-section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--link), var(--primary-color));
    border-radius: 2px;
}

.main-widget-carousel {
    --carousel-gap: 20px;
}

.widget-slide {
    min-height: 350px;
    display: flex;
    align-items: stretch;
}

.widget-slide > div {
    width: 100%;
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* Compact Stats Grid */
.stats-grid.compact {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stats-grid.compact .stat-card {
    min-width: 140px;
    max-width: 180px;
    flex: none;
}

/* Activity Feed */
.activity-feed {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-default);
    margin: 30px 0;
}

.activity-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-default);
}

.activity-tab {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.activity-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.activity-tab.active {
    color: var(--link);
}

.activity-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--link);
}

.activity-content {
    position: relative;
}

.activity-panel {
    display: none;
    padding: 24px;
}

.activity-panel.active {
    display: block;
}

/* Legacy Grid Support (Hidden) */
.widgets-container {
    display: none;
}

.widgets-grid {
    display: none;
}

/* Base Widget Styles */
.widget {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-default);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.widget-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-icon {
    font-size: 20px;
}

.widget-refresh {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.widget-refresh:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.widget-content {
    padding: 20px;
}

/* Widget Variants */
.widget.widget-full {
    grid-column: 1 / -1;
}

.widget.widget-half {
    grid-column: span 1;
}

@media (min-width: 1024px) {
    .widget.widget-two-thirds {
        grid-column: span 2;
    }
}

/* Onboarding Cards Container */
.onboarding-cards-container {
    margin-bottom: 30px;
    min-height: 50px; /* Ensure container is visible even when empty */
    position: relative;
    z-index: 10; /* Ensure it's above other elements */
}

/* Debug visibility */
.onboarding-cards-container:empty::after {
    content: 'Onboarding cards container is empty';
    display: block;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-default);
    border-radius: 8px;
}

/* Onboarding Cards */
.onboarding-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.onboarding-card.priority-high {
    border-color: var(--link);
    box-shadow: 0 4px 8px var(--focus-ring);
}

.onboarding-card-inner {
    position: relative;
}

.onboarding-card-dismiss {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s;
}

.onboarding-card-dismiss:hover {
    color: var(--text-secondary);
}

.onboarding-card h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.onboarding-card p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.onboarding-card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.onboarding-card-actions .btn {
    margin: 0;
}

/* Welcome Card Specific */
.onboarding-card-welcome {
    background: linear-gradient(135deg, var(--link) 0%, var(--primary-color) 100%);
    color: var(--text-on-accent);
}

.onboarding-card-welcome h3,
.onboarding-card-welcome p {
    color: var(--text-on-accent);
}

.onboarding-card-welcome .btn-primary {
    background: var(--bg-card);
    color: var(--link);
}

.onboarding-card-welcome .btn-secondary {
    background: var(--border-light);
    color: var(--text-on-accent);
    border-color: var(--border-light);
}

/* Setup Checklist Card */
.checklist-progress {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.checklist-items {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.checklist-item-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checklist-item.completed .checklist-item-checkbox {
    background: var(--success-color);
    border-color: var(--success-color);
}

.checklist-item.completed .checklist-item-checkbox::after {
    content: '✓';
    color: var(--text-on-accent);
    font-size: 12px;
}

.checklist-item-label {
    flex: 1;
    color: var(--text-secondary);
}

.checklist-item.completed .checklist-item-label {
    color: var(--text-secondary);
    text-decoration: line-through;
}

/* Feature Discovery Card */
.onboarding-card-feature_discovery .feature-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

/* Family Connection Widget */
.family-connection-widget {
    text-align: center;
}

.mini-tree-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 8px;
    margin-bottom: 16px;
}

.tree-placeholder {
    color: var(--text-secondary);
}

.tree-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
}

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

.tree-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.tree-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Upcoming Events Widget */
.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.event-date {
    width: 60px;
    text-align: center;
    margin-right: 16px;
}

.event-month {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
}

.event-day {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.event-details {
    flex: 1;
}

.event-title {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.event-type {
    font-size: 14px;
    color: var(--text-secondary);
}

.event-action {
    background: none;
    border: 1px solid var(--link);
    color: var(--link);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.event-action:hover {
    background: var(--link);
    color: var(--text-on-accent);
}

/* Contribution Ideas Widget */
.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-card {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.idea-card:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.idea-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.idea-content {
    flex: 1;
}

.idea-text {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.idea-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Empty States */
.widget-empty {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-message {
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

/* Loading States */
.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.widget-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-default);
    border-top-color: var(--link);
    border-radius: 50%;
    animation: widget-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .widgets-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .widget {
        padding: 15px;
    }
    
    .widget-header {
        margin-bottom: 15px;
    }
    
    .widget-title {
        font-size: 16px;
    }
    
    .widget.widget-two-thirds {
        grid-column: span 1;
    }
    
    /* Onboarding carousel mobile */
    .onboarding-carousel {
        height: auto;
        min-height: 300px;
    }
    
    .onboarding-card {
        padding: 20px;
    }
    
    .onboarding-card h3 {
        font-size: 20px;
    }
    
    .onboarding-card p {
        font-size: 14px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    /* Family tree mobile */
    .tree-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tree-stat {
        flex: 1 1 calc(50% - 10px);
        min-width: 100px;
    }
    
    .tree-stat-value {
        font-size: 20px;
    }
    
    /* Events widget mobile */
    .event-item {
        flex-wrap: wrap;
        padding: 10px 0;
    }
    
    .event-date {
        width: 50px;
        margin-right: 12px;
    }
    
    .event-day {
        font-size: 18px;
    }
    
    /* Discovery widget mobile */
    .discovery-item {
        padding: 12px;
    }
    
    .discovery-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        margin-right: 12px;
    }
    
    /* Ideas widget mobile */
    .idea-card {
        padding: 15px;
    }
    
    .idea-icon {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    /* Buttons mobile */
    .widget .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .widget-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .widget-actions .btn {
        width: 100%;
        justify-content: center;
    }
    }
    
    .event-action {
        width: 100%;
        margin-top: 8px;
    }
}

/* Widget Visibility Toggle */
.widget-settings {
    position: absolute;
    top: 20px;
    right: 20px;
}

.widget-visibility-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.widget-visibility-toggle:hover {
    color: var(--text-primary);
}

/* Enhanced Animations and Transitions */
.widget-enter {
    animation: widget-fade-in 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes widget-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.widget-exit {
    animation: widget-fade-out 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes widget-fade-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Staggered animation for multiple widgets */
.widget:nth-child(1) { animation-delay: 0s; }
.widget:nth-child(2) { animation-delay: 0.1s; }
.widget:nth-child(3) { animation-delay: 0.2s; }
.widget:nth-child(4) { animation-delay: 0.3s; }
.widget:nth-child(5) { animation-delay: 0.4s; }

/* Carousel slide transitions */
.carousel-track {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Onboarding card animations */
.onboarding-card {
    animation: card-slide-in 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    animation-fill-mode: both;
}

@keyframes card-slide-in {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* Button hover animations */
.btn {
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    transition: left 0.5s;
}

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

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

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

/* Stat card animations */
.stat-card {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Loading spinner enhancement */
.widget-spinner {
    animation: enhanced-spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes enhanced-spin {
    0% { 
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% { 
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
    100% { 
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

/* Progress bar animations */
.progress-bar-fill {
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    background: linear-gradient(90deg, var(--success-color), var(--success-color));
    background-size: 200% 100%;
    animation: progress-glow 2s ease-in-out infinite;
}

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

/* Notification/Alert animations */
.alert {
    animation: alert-slide-down 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes alert-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

/* Form focus animations */
input, textarea, select {
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

input:focus, textarea:focus, select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Tab switching animations */
.activity-tab {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.activity-tab::after {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform: scaleX(0);
    transform-origin: center;
}

.activity-tab.active::after {
    transform: scaleX(1);
}

.activity-panel {
    animation: panel-fade-in 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes panel-fade-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Page transition effects */
@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-main {
    animation: page-enter 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Micro-interactions for better UX */
.widget-refresh, .help-button, .carousel-arrow {
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.widget-refresh:hover, .help-button:hover, .carousel-arrow:hover {
    transform: scale(1.1) rotate(5deg);
}

.widget-refresh:active, .help-button:active, .carousel-arrow:active {
    transform: scale(0.95);
}

/* Tooltip animations */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--overlay-darker);
    color: var(--text-on-accent);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}/* Dashboard World Map Styles */
.world-map-section {
    margin: 3rem 0;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.world-map-section .section-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.world-map-container {
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0; /* No buttons below anymore */
    border: 1px solid var(--border-subtle);
    position: relative;
    z-index: 1; /* Keep map container at low z-index */
}

/* Ensure all map elements stay below UI elements */
.world-map-container * {
    max-z-index: 1000 !important;
}

/* Leaflet map specific z-index control */
#world-map-live {
    position: relative;
    z-index: 1;
}

#world-map-live .leaflet-container,
#world-map-live .leaflet-pane,
#world-map-live .leaflet-control {
    z-index: auto !important;
    max-z-index: 1000 !important;
}

/* Map actions removed for cleaner dashboard
.map-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.map-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.map-actions .btn i {
    font-size: 1rem;
}
*/

/* Loading state */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.map-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    border: 3px solid var(--border-subtle);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* Error state */
.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--error);
    font-size: 1.1rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .world-map-section {
        margin: 2rem -1rem;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }
    
    .world-map-section .section-title {
        font-size: 1.25rem;
    }
    
    .world-map-container {
        border-radius: 8px;
    }
    
    #world-map-live {
        height: 300px !important;
    }
    
    /* Map actions removed
    .map-actions {
        justify-content: stretch;
    }
    
    .map-actions .btn {
        flex: 1;
        justify-content: center;
    }
    */
}

/* Small mobile */
@media (max-width: 480px) {
    .world-map-section {
        padding: 1rem;
    }
    
    #world-map-live {
        height: 250px !important;
    }
    
    /* Map actions removed
    .map-actions {
        flex-direction: column;
    }
    
    .map-actions .btn {
        width: 100%;
    }
    */
}/* Enhanced Email Contribution Widget Styles */

.email-contribution-widget {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-hover) 100%);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.email-contribution-widget:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Widget Header */
.email-widget-header {
  background: var(--gradient-primary);
  color: var(--text-on-accent);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.email-widget-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: var(--white-alpha-10);
  border-radius: 50%;
}

.email-widget-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.email-widget-title i {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px var(--shadow-color));
}

.email-widget-title h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.email-address-hero {
  background: var(--white-alpha-20);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.email-address-hero code {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 500;
  background: none;
  color: var(--text-on-accent);
  border: none;
  padding: 0;
}

.copy-email-btn {
  background: var(--bg-surface);
  color: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.copy-email-btn:hover {
  background: var(--bg-surface);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.copy-email-btn.copied {
  background: var(--success);
  color: var(--text-on-accent);
}

/* Widget Body */
.email-widget-body {
  padding: 1.5rem;
}

/* Processing Status */
.email-processing-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.status-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px var(--hover-overlay);
  transition: all 0.2s ease;
  cursor: pointer;
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--hover-overlay);
}

.status-card.active {
  border: 2px solid var(--primary-color);
  background: var(--primary-bg-light);
}

.status-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
}

.status-icon.received {
  background: var(--info-bg-light);
  color: var(--info-color);
}

.status-icon.processing {
  background: var(--warning-bg-light);
  color: var(--warning);
  animation: pulse 2s infinite;
}

.status-icon.processed {
  background: var(--success-bg-light);
  color: var(--success);
}

.status-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

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

/* Quick Tips Carousel */
.email-tips-carousel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}

.tips-carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
}

.tip-slide {
  min-width: 100%;
  padding: 0 2rem;
  text-align: center;
}

.tip-slide i {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.tip-slide p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: var(--text-on-accent);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.carousel-nav:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
  left: 0.5rem;
}

.carousel-nav.next {
  right: 0.5rem;
}

/* Recent Contributions */
.recent-contributions {
  margin-top: 1.5rem;
}

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

.contributions-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.125rem;
}

.view-all-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.view-all-link:hover {
  gap: 0.5rem;
}

.contribution-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: start;
  gap: 1rem;
  box-shadow: 0 2px 8px var(--hover-overlay);
  transition: all 0.2s ease;
  cursor: pointer;
}

.contribution-item:hover {
  box-shadow: 0 4px 12px var(--hover-overlay);
  transform: translateX(4px);
}

.contribution-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.contribution-type-icon.story {
  background: var(--primary-bg-light);
  color: var(--primary-color);
}

.contribution-type-icon.photo {
  background: var(--error-bg-light);
  color: var(--error-light);
}

.contribution-type-icon.document {
  background: var(--warning-bg-light);
  color: var(--warning);
}

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

.contribution-title {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.contribution-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Action Buttons */
.email-widget-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.action-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.action-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-bg-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-btn i {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  display: block;
}

.action-btn span {
  font-weight: 600;
  display: block;
}

/* Email Wizard Modal */
.email-wizard-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay);
  z-index: 1000;
  padding: 2rem;
  overflow-y: auto;
}

.email-wizard-content {
  background: var(--bg-surface);
  border-radius: 16px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.3s ease;
}

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

.wizard-header {
  background: var(--gradient-primary);
  color: var(--text-on-accent);
  padding: 2rem;
  border-radius: 16px 16px 0 0;
  position: relative;
}

.wizard-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--white-alpha-20);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.wizard-close:hover {
  background: var(--white-alpha-30);
  transform: rotate(90deg);
}

.wizard-body {
  padding: 2rem;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .email-processing-status {
    grid-template-columns: 1fr;
  }
  
  .email-widget-actions {
    grid-template-columns: 1fr;
  }
  
  .email-address-hero {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .email-address-hero code {
    font-size: 0.875rem;
    text-align: center;
  }
  
  .copy-email-btn {
    width: 100%;
    justify-content: center;
  }
  
  .contribution-item {
    flex-direction: column;
  }
  
  .contribution-type-icon {
    align-self: center;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .email-contribution-widget {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--dark-bg) 100%);
  }
  
  .status-card,
  .email-tips-carousel,
  .contribution-item,
  .action-btn {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
  }
  
  .status-card:hover,
  .contribution-item:hover,
  .action-btn:hover {
    background: var(--text-secondary);
  }
  
  .contribution-title,
  .contributions-header h4,
  .status-value {
    color: var(--bg-surface);
  }
  
  .tip-slide p,
  .contribution-meta,
  .status-label {
    color: var(--text-muted);
  }
}

/* Wizard Options */
.wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.wizard-option {
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wizard-option:hover {
  border-color: var(--primary-color);
  background: var(--primary-bg-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wizard-option i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: block;
}

.wizard-option span {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

/* Enhanced contribution item hover state */
.contribution-item {
  cursor: pointer;
  position: relative;
}

.contribution-item::after {
  content: '\f054'; /* Font Awesome arrow right */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  opacity: 0;
  transition: all 0.2s ease;
}

.contribution-item:hover::after {
  opacity: 1;
  right: 0.5rem;
}

/* Processing animation for status icon */
@keyframes processingPulse {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}

.status-icon.processing i {
  animation: processingPulse 2s linear infinite;
}

/* Success animation for processed items */
@keyframes successBounce {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.9);
  }
  60% {
    transform: scale(1.1);
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.status-card.active .status-icon.processed {
  animation: successBounce 0.5s ease;
}

/* Loading state for email address */
#family-email-address.loading {
  background: linear-gradient(90deg, var(--border-subtle) 25%, var(--bg-hover) 50%, var(--border-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
  border-radius: 4px;
  display: inline-block;
  min-width: 200px;
  min-height: 1.2em;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}/* Email Processing Widget Styles */
.email-processing-widget {
    width: 100%;
    min-width: 350px;
    transition: all 0.3s ease;
    animation-duration: 0.5s;
}

.email-processing-widget .card-header {
    cursor: move;
    user-select: none;
}

.email-processing-widget .widget-controls button {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.email-processing-widget .widget-controls button:hover {
    opacity: 1;
}

.email-processing-widget .progress {
    transition: all 0.3s ease;
}

.email-processing-widget .progress-bar {
    transition: width 0.5s ease;
}

.email-processing-widget .processing-details {
    border-top: 1px solid var(--border-default);
    padding-top: 8px;
    margin-top: 8px;
}

.email-processing-widget .current-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-processing-widget .email-list {
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 8px;
    background-color: var(--bg-card);
}

.email-processing-widget .email-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

.email-processing-widget .email-item:hover {
    background-color: var(--bg-hover) !important;
}

.email-processing-widget .email-item.bg-light {
    border-left-color: var(--success);
}

.email-processing-widget .email-item.bg-danger-subtle {
    background-color: var(--error-bg);
    border-left-color: var(--error);
}

.email-processing-widget .email-subject {
    font-size: 0.875rem;
    line-height: 1.3;
}

.email-processing-widget .email-meta {
    opacity: 0.8;
}

.email-processing-widget .processing-time {
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #email-processing-widget-container {
        position: fixed !important;
        top: auto !important;
        bottom: 20px !important;
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
    }
    
    .email-processing-widget {
        min-width: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .email-processing-widget {
        background-color: var(--bg-card-dark);
        color: var(--text-primary-dark);
    }
    
    .email-processing-widget .card-header {
        background-color: var(--bg-hover-dark);
        border-bottom-color: var(--border-default-dark);
    }
    
    .email-processing-widget .card-body {
        background-color: var(--bg-card-dark);
    }
    
    .email-processing-widget .card-footer {
        background-color: var(--bg-surface-dark) !important;
        border-top-color: var(--border-default-dark);
    }
    
    .email-processing-widget .email-list {
        background-color: var(--bg-surface-dark);
        border-color: var(--border-default-dark);
    }
    
    .email-processing-widget .email-item {
        color: var(--text-primary-dark);
    }
    
    .email-processing-widget .email-item.bg-light {
        background-color: var(--bg-card-dark) !important;
    }
    
    .email-processing-widget .email-item:hover {
        background-color: var(--border-default-dark) !important;
    }
}

/* Integration with animate.css */
.animate__animated {
    animation-duration: 0.5s;
}

.animate__fadeInRight {
    animation-name: fadeInRight;
}

.animate__fadeOutRight {
    animation-name: fadeOutRight;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(100%, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    to {
        opacity: 0;
        transform: translate3d(100%, 0, 0);
    }
}/**
 * Broadcast Widget Styles
 * For both platform and tenant broadcast widgets
 */

.broadcast-widget {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.broadcast-widget.platform-broadcast {
  border-left: 4px solid #007bff;
}

.broadcast-widget.tenant-broadcast {
  border-left: 4px solid #28a745;
}

/* Widget Header */
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.widget-header h3 {
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-header h3 i {
  font-size: 20px;
}

/* Broadcast Form */
.broadcast-form {
  background: var(--form-background, #f8f9fa);
  padding: 20px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--input-background);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-default);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.char-count {
  color: var(--text-muted);
  font-size: 12px;
  display: block;
  text-align: right;
  margin-top: 5px;
}

.required {
  color: #dc3545;
}

/* Schedule Options */
.schedule-options {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.radio-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-inline input[type="radio"] {
  margin: 0;
}

/* Role Checkboxes */
.role-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
  margin: 0;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* Preview */
.broadcast-preview {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--header-background, #f8f9fa);
  border-bottom: 1px solid var(--border-color);
}

.preview-header h4 {
  margin: 0;
  color: var(--text-primary);
}

.close-preview {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-preview:hover {
  color: var(--text-primary);
}

.preview-content {
  padding: 20px;
}

/* Notification Preview */
.notification-preview {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  background: var(--notification-background, #fff);
}

.notification-preview.priority-critical {
  border-left: 4px solid #dc3545;
  background: var(--notification-critical, #fff5f5);
}

.notification-preview.priority-important {
  border-left: 4px solid #ffc107;
  background: var(--notification-important, #fffbf0);
}

.notification-preview.priority-info {
  border-left: 4px solid #007bff;
  background: var(--notification-info, #f0f8ff);
}

.notification-preview.priority-family {
  border-left: 4px solid #28a745;
  background: var(--notification-family, #f0fff4);
}

.notification-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.priority-icon {
  font-size: 20px;
}

.notification-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
}

.notification-body p {
  margin: 0 0 10px 0;
  color: var(--text-primary);
  line-height: 1.5;
}

.notification-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.notification-footer small {
  color: var(--text-muted);
  font-size: 12px;
}

/* Statistics Cards */
.broadcast-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  flex: 1;
  background: var(--stat-background, #f8f9fa);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Broadcast History */
.broadcast-history h4 {
  margin-bottom: 15px;
  color: var(--text-primary);
}

.history-list {
  margin-bottom: 15px;
}

.broadcast-item {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s ease;
}

.broadcast-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.broadcast-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.priority-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.priority-badge.priority-critical {
  background: var(--priority-critical, #dc3545);
  color: var(--text-on-accent);
}

.priority-badge.priority-important {
  background: var(--priority-important, #ffc107);
  color: #212529;
}

.priority-badge.priority-info {
  background: var(--priority-info, #007bff);
  color: var(--text-on-accent);
}

.priority-badge.priority-family {
  background: var(--priority-family, #28a745);
  color: var(--text-on-accent);
}

.broadcast-header h5 {
  flex: 1;
  margin: 0;
  font-size: 16px;
  color: var(--text-primary);
}

.broadcast-date {
  font-size: 12px;
  color: var(--text-muted);
}

.broadcast-body p {
  margin: 0 0 10px 0;
  color: var(--text-secondary);
  line-height: 1.4;
}

.broadcast-footer {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 12px;
  color: var(--text-muted);
}

.broadcast-scope,
.broadcast-stats {
  display: flex;
  align-items: center;
  gap: 4px;
}

.broadcast-status {
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.status-draft {
  background: var(--status-draft, #6c757d);
  color: var(--text-on-accent);
}

.status-scheduled {
  background: var(--status-scheduled, #007bff);
  color: var(--text-on-accent);
}

.status-sending {
  background: var(--status-sending, #ffc107);
  color: #212529;
}

.status-sent {
  background: var(--status-sent, #28a745);
  color: var(--text-on-accent);
}

.status-failed {
  background: var(--status-failed, #dc3545);
  color: var(--text-on-accent);
}

.status-cancelled {
  background: var(--status-cancelled, #6c757d);
  color: var(--text-on-accent);
}

.broadcast-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-info {
  color: var(--text-muted);
  font-size: 14px;
}

/* Loading and Empty States */
.loading,
.error,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-style: italic;
}

.error {
  color: #dc3545;
}

/* Modal Styles for Stats */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-background);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.modal-header .close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
}

.modal-header .close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stats-grid .stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: var(--stat-background, #f8f9fa);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

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

.stats-grid .stat span {
  font-weight: bold;
  color: var(--text-primary);
}

.read-by-list {
  margin-top: 20px;
}

.read-by-list h4 {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.read-by-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.read-by-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
}

.read-by-list li:last-child {
  border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  
  .broadcast-stats {
    flex-direction: column;
  }
  
  .broadcast-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .broadcast-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  
  .schedule-options,
  .role-checkboxes {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Support */
[data-theme="dark"] .broadcast-widget {
  --card-background: #2d3748;
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e0;
  --text-muted: #a0aec0;
  --border-color: var(--border-default);
  --form-background: #1a202c;
  --input-background: #2d3748;
  --header-background: #1a202c;
  --stat-background: #1a202c;
  --notification-background: #2d3748;
  --notification-critical: #822727;
  --notification-important: #744210;
  --notification-info: #1e3a8a;
  --notification-family: #166534;
}

[data-theme="dark"] .form-control:focus {
  border-color: var(--border-default);
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.25);
}/* Loader Components */
/* Shared Loading States for Dashboard Upgrade */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-hover) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

/* Skeleton Elements */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

.skeleton-button {
    width: 120px;
    height: 40px;
    border-radius: 8px;
}

/* Skeleton Card */
.skeleton-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

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

.skeleton-card-body {
    margin-bottom: 1rem;
}

.skeleton-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Spinner Loading */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
}

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

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    text-align: center;
}

.loading-container .spinner {
    margin-bottom: 1rem;
}

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

/* Progress Bar */
.progress {
    width: 100%;
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: progress-shine 2s ease-in-out infinite;
}

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

.progress-indeterminate .progress-bar {
    width: 30%;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* Dots Loading */
.dots-loading {
    display: inline-flex;
    gap: 0.25rem;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: dot-pulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dot-pulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pulse Loading */
.pulse {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    border-radius: 50%;
    position: relative;
}

.pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: inherit;
    border-radius: inherit;
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-overlay-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 300px;
}

.loading-overlay-content .spinner {
    margin: 0 auto 1rem;
}

/* Button Loading State */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Lazy Load Placeholder */
.lazy-load {
    background-color: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.lazy-load::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lazy-load.loaded::before {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .loading-container {
        min-height: 150px;
    }
    
    .skeleton-image {
        height: 150px;
    }
}/**
 * Onboarding Indicator Styles
 * Subtle, non-intrusive banner for onboarding guidance
 */

.onboarding-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: var(--text-on-accent);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
}

.onboarding-indicator.visible {
    transform: translateY(0);
}

.onboarding-indicator.hiding {
    transform: translateY(-100%);
}

.onboarding-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.onboarding-message {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.onboarding-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.onboarding-text {
    font-size: 14px;
    line-height: 1.4;
}

.onboarding-text strong {
    font-weight: 600;
    margin-right: 4px;
}

.onboarding-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.onboarding-indicator .btn-complete {
    background: var(--bg-surface);
    color: var(--link);
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.onboarding-indicator .btn-complete:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.onboarding-indicator .btn-hide {
    background: transparent;
    color: var(--text-on-accent);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.onboarding-indicator .btn-hide:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Adjust page content when indicator is visible */
body.has-onboarding-indicator {
    padding-top: 50px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .onboarding-content {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
        text-align: center;
    }
    
    .onboarding-message {
        justify-content: center;
    }
    
    .onboarding-text {
        font-size: 13px;
    }
    
    .onboarding-actions {
        width: 100%;
        justify-content: center;
    }
    
    .onboarding-indicator .btn-complete,
    .onboarding-indicator .btn-hide {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* Dark theme support */
[data-theme="dark"] .onboarding-indicator {
    background: linear-gradient(90deg, #4c5fd5 0%, #5a4ba2 100%);
}

[data-theme="dark"] .onboarding-indicator .btn-complete {
    background: #1f2937;
    color: #a5b4fc;
}

[data-theme="dark"] .onboarding-indicator .btn-complete:hover {
    background: #111827;
}

[data-theme="dark"] .onboarding-indicator .btn-hide {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .onboarding-indicator .btn-hide:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}/* Dashboard Feature */
/* From dashboard.css */
/* Dashboard Specific Styles */

/* Privacy Quick Status */
.privacy-quick-status {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.privacy-quick-status h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.privacy-summary-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.privacy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.privacy-item:last-of-type {
    border-bottom: none;
}

.privacy-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.privacy-value {
    color: var(--text-primary);
    font-weight: 600;
}

.privacy-summary-card .btn {
    margin-top: 1rem;
    text-align: center;
}

/* Navigation Bar */
.navbar {
    background-color: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--link);
    margin: 0;
}

/* Simple nav brand styling */
.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--link);
    margin: 0;
}

.nav-brand .tenant-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--link);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease-in-out;
}

.nav-link:hover {
    color: var(--link);
    text-decoration: none;
}

.nav-link.active {
    color: var(--link);
    border-bottom-color: var(--link);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme toggle positioning */
#theme-toggle-container {
    display: inline-flex;
    align-items: center;
}

/* Help button styles removed - using contextual help system instead */

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: " ▼";
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-lg);
    border-radius: 0.375rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.dropdown-menu.show {
    pointer-events: auto;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.active .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-primary);
    font-weight: 400;
    transition: background-color 0.15s ease-in-out;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    text-decoration: none;
    color: var(--link);
}

.nav-actions .language-selector {
    position: static;
}

.nav-actions .lang-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Dashboard Main */
.dashboard-main {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    background-color: var(--bg-surface);
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 2rem;
}

.welcome-section h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.welcome-section h2 span {
    color: var(--primary);
}

.welcome-section p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1rem;
}

.welcome-section p span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Alert */
.alert-info {
    background-color: var(--bg-card);
    color: var(--link);
    border: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-info a {
    color: var(--link);
    text-decoration: underline;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

/* Clickable stat cards */
a.stat-card,
.stat-card.clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.stat-card:hover,
.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-hover);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    margin: 0;
    color: var(--link);
}

.stat-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Recent Contributions */
.recent-contributions {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.recent-contributions h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contribution-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contribution-item {
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.contribution-item:hover {
    background-color: var(--bg-surface);
    box-shadow: var(--shadow);
}

.contribution-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contribution-item p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.content-preview {
    margin: 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.contribution-type {
    font-size: 0.75rem;
    text-transform: capitalize;
}

.view-document {
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.contribution-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Quick Actions */
.quick-actions {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    background-color: var(--link);
    color: var(--white);
    transform: translateX(4px);
}

.action-icon {
    font-size: 1.25rem;
}

/* Email Contributions Section */
.email-contributions-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.email-contribution-widget {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.email-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 6px;
}

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

.email-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.email-stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.email-quick-guide {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 6px;
    border-left: 4px solid var(--link);
}

.email-quick-guide p {
    margin: 0 0 0.75rem 0;
    color: var(--link);
}

.email-address-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.email-address-display code {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.email-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--link);
    text-decoration: none;
    font-size: 0.875rem;
}

.email-guide-link:hover {
    text-decoration: underline;
}

.recent-email-list {
    max-height: 200px;
    overflow-y: auto;
}

.email-contribution-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.email-contribution-info {
    flex: 1;
}

.email-subject {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.email-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.email-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.email-status.processed {
    background: var(--success);
    color: var(--text-on-accent);
}

.email-status.processing {
    background: var(--warning);
    color: var(--text-on-accent);
}

.email-status.failed {
    background: var(--error);
    color: var(--text-on-accent);
}

/* Activity Feed */
.activity-feed {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

/* Activity Tabs - More Prominent */
.activity-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-surface);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.activity-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.activity-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.activity-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Email tab special styling */
.activity-tab[data-tab="email"] {
    position: relative;
}

.activity-tab[data-tab="email"]::after {
    content: "✨ New!";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--success);
    color: var(--text-on-accent);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

/* Tab icons */
.activity-tab i {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

/* Email CTA Section */
.email-cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-on-accent);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.email-cta-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.email-cta-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.email-cta-info {
    flex: 1;
}

.email-cta-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: inherit;
}

.email-cta-info p {
    margin: 0 0 1rem 0;
    opacity: 0.95;
    color: inherit;
}

.email-cta-address {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white-alpha-20);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    width: fit-content;
}

.email-cta-address code {
    font-size: 1.125rem;
    font-weight: 600;
    background: none;
    color: inherit;
    padding: 0;
}

.email-cta-address .btn-primary {
    background: var(--bg-card);
    color: var(--primary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.email-cta-address .btn-primary:hover {
    background: var(--bg-surface);
    transform: translateY(-1px);
}

.email-cta-action .btn-secondary {
    background: var(--white-alpha-20);
    color: var(--text-on-accent);
    border: 2px solid var(--text-on-accent);
}

.email-cta-action .btn-secondary:hover {
    background: var(--white-alpha-30);
    transform: translateY(-1px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .email-cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .email-cta-address {
        margin: 0 auto;
        flex-direction: column;
        width: 100%;
    }
    
    .email-cta-address code {
        font-size: 1rem;
    }
    
    .activity-tab {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .activity-tab i {
        display: block;
        margin: 0 0 0.25rem 0;
    }
}

/* Activity Panels */
.activity-content {
    position: relative;
}

.activity-panel {
    display: none;
}

.activity-panel.active {
    display: block;
}

.activity-feed h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.activity-icon {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.activity-content {
    flex: 1;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* No Data */
.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    margin: 0;
}

/* Utility class for hidden elements */
.hidden {
    display: none !important;
}

/* Email processing widget positioning */
.email-processing-widget-fixed {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

/* Mobile-friendly email processing widget */
@media (max-width: 768px) {
    .email-processing-widget-fixed {
        position: fixed;
        top: auto;
        bottom: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }
}

/* Footer Styles */
.site-footer {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    color: var(--text-secondary);
}

/* Family Members Section */
.family-members-section {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.family-members-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.family-members-actions {
    margin-bottom: 1.5rem;
}

.family-members-list {
    display: grid;
    gap: 1rem;
}

.family-member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.family-member-item:hover {
    background-color: var(--bg-hover);
    transform: translateX(2px);
}

.family-member-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.family-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--link);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.family-member-details h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.family-member-details p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.family-member-actions {
    display: flex;
    gap: 0.5rem;
}

.family-member-actions .btn-icon {
    padding: 0.5rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.family-member-actions .btn-icon i {
    pointer-events: none;
}

.family-member-actions .btn-icon:hover {
    background-color: var(--link);
    color: var(--white);
    border-color: var(--link);
}

/* Responsive */
@media (max-width: 968px) {
    .nav-menu {
        display: none;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-brand {
        flex: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
}

    background-color: var(--hover-overlay);
}
/* Theme-aware Navbar Styles */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-default);
    box-shadow: var(--shadow);
}

.navbar .nav-brand h1,
.navbar .nav-brand .tenant-name,
.navbar .nav-brand .nav-title,
.navbar .nav-brand-link {
    color: var(--text-primary);
}

.navbar .nav-link {
    color: var(--text-primary);
    opacity: 0.9;
    transition: all 0.2s ease;
}

.navbar .nav-link:hover {
    color: var(--link);
    opacity: 1;
    text-decoration: none;
    background-color: var(--bg-hover);
}

.navbar .nav-link.active {
    color: var(--link);
    border-bottom-color: var(--link);
    opacity: 1;
}

.navbar .nav-link i {
    color: inherit;
}

/* Language selector in navbar */
.navbar .language-selector .lang-btn {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.navbar .language-selector .lang-btn:hover,
.navbar .language-selector .lang-btn.active {
    background-color: var(--hover-color);
    color: var(--link);
}

/* Admin badge in navbar */
.navbar .admin-badge {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

/* User avatar in navbar */
.navbar .user-avatar-btn {
    background-color: transparent;
}

.navbar .user-avatar-btn:hover {
    background-color: var(--hover-overlay);
}

.navbar .user-avatar {
    border-color: var(--border-default);
}

.navbar .user-avatar-chevron {
    color: var(--text-secondary);
}

/* Logout button in navbar */
.navbar #logout-btn {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.navbar #logout-btn:hover {
    background-color: var(--hover-color);
    color: var(--link);
}
/* From dashboard-mobile.css */
/**
 * Dashboard Mobile Responsive Styles
 * Optimizes the dashboard experience for mobile devices
 */

/* Mobile Dashboard Layout */
@media (max-width: 968px) {
    /* Main dashboard container */
    .dashboard-container {
        padding: 0;
        margin: 0;
    }
    
    .dashboard-content {
        padding: 15px;
    }
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Widget carousel for mobile */
    .main-widget-carousel-container {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .carousel-section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* Single column layout for widgets */
    .main-widget-carousel {
        display: block;
    }
    
    .widget-slide {
        margin-bottom: 20px;
    }
    
    /* Compact stats grid */
    .compact-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 20px 0;
    }
    
    .compact-stat-card {
        padding: 15px;
    }
    
    .compact-stat-value {
        font-size: 24px;
    }
    
    .compact-stat-label {
        font-size: 12px;
    }
    
    /* Activity sections */
    .activity-sections {
        margin: 0 -15px;
    }
    
    .activity-section {
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    .activity-section-header {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    /* Timeline items */
    .timeline-item {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .timeline-date {
        font-size: 12px;
    }
    
    .timeline-content h4 {
        font-size: 16px;
    }
    
    /* Contribution cards */
    .contribution-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .contribution-title {
        font-size: 16px;
    }
    
    /* Action buttons */
    .dashboard-actions {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 100;
    }
    
    .floating-action-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-lg);
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .compact-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-content {
        padding: 10px;
    }
    
    .widget {
        border-radius: 12px;
    }
    
    /* Stack all dashboard sections vertically */
    .dashboard-grid,
    .dashboard-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
}

/* Touch-friendly interactions */
@media (max-width: 968px) {
    /* Larger touch targets */
    .dashboard-btn,
    .widget-action,
    .view-all-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Better spacing for lists */
    .dashboard-list-item {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .dashboard-list-item:last-child {
        border-bottom: none;
    }
    
    /* Swipeable carousel indicators */
    .carousel-indicators {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 15px;
        padding: 10px 0;
    }
    
    .carousel-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--text-muted);
        transition: all 0.3s ease;
    }
    
    .carousel-indicator.active {
        width: 24px;
        border-radius: 4px;
        background: var(--primary);
    }
}

/* Landscape mobile */
@media (max-width: 968px) and (orientation: landscape) {
    .dashboard-content {
        padding: 10px 20px;
    }
    
    .compact-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .main-widget-carousel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 968px) {
    /* Reduce animations on mobile */
    * {
        animation-duration: 0.2s !important;
    }
    
    /* Optimize images */
    .widget-image,
    .dashboard-image {
        loading: lazy;
    }
    
    /* Remove hover effects on touch devices */
    @media (hover: none) {
        .widget:hover,
        .dashboard-card:hover {
            transform: none;
            box-shadow: var(--shadow);
        }
    }
}/* From dashboard-modern.css */
/* Modern Dashboard Styles */

/* Dashboard Container */
.dashboard-modern {
    --widget-spacing: 1.5rem;
    --animation-duration: 0.3s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget Hover Effects */
.widget {
    position: relative;
    overflow: hidden;
    transition: all var(--animation-duration) var(--animation-timing);
}

.widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    transform: translateX(-100%);
    transition: transform var(--animation-duration) var(--animation-timing);
}

.widget:hover::before {
    transform: translateX(0);
}

/* Loading States */
.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-secondary);
}

.widget-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty States */
.widget-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.widget-empty-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.widget-empty-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Widget Actions */
.widget-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.widget-action-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: var(--text-on-accent);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--animation-duration);
    text-decoration: none;
    display: inline-block;
}

.widget-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.widget-action-btn.secondary:hover {
    background: var(--bg-hover);
}

/* Progress Indicators */
.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 3px;
    transition: width var(--animation-duration) var(--animation-timing);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

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

/* Interactive Elements */
.interactive-card {
    cursor: pointer;
    transition: all var(--animation-duration);
    position: relative;
}

.interactive-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.interactive-card:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Notification Badges */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--error);
    color: var(--text-on-accent);
    font-size: 0.75rem;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 2px 16px rgba(244, 67, 54, 0.4); }
    100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
}

/* Mini Charts */
.mini-chart {
    height: 60px;
    margin: 1rem 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.chart-bar {
    flex: 1;
    background: var(--primary);
    opacity: 0.3;
    border-radius: 2px 2px 0 0;
    transition: all var(--animation-duration);
}

.chart-bar:hover {
    opacity: 1;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-indicator.active .status-dot {
    background: var(--success);
    animation: blink 2s infinite;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
    .widget {
        margin-bottom: 1rem;
    }
    
    .widget-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .widget-title {
        font-size: 1rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-tile {
        padding: 1rem;
    }
    
    .action-icon {
        font-size: 1.5rem;
    }
    
    .action-label {
        font-size: 0.8rem;
    }
}

/* Dark Mode Adjustments */
.theme-dark .widget {
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-dark .widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.theme-dark .action-tile {
    background: var(--bg-primary);
    border-color: var(--border-subtle);
}

.theme-dark .action-tile:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.theme-dark .progress-bar {
    background: var(--bg-primary);
}

.theme-dark .status-indicator {
    background: var(--bg-primary);
}

/* Print Styles */
@media print {
    .fab,
    .widget-action,
    .action-tile {
        display: none !important;
    }
    
    .widget {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-subtle);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.widget:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.action-tile:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .widget {
        border: 2px solid var(--text-primary);
    }
    
    .action-tile {
        border: 2px solid var(--text-primary);
    }
    
    .progress-fill {
        background: var(--text-primary);
    }
}/* Profile Feature */
/* Profile Page Styles */

/* Account for fixed navbar - MORE SPECIFIC */
body {
    padding-top: 70px !important; /* Ensure navbar doesn't overlap content */
    margin: 0;
    background: var(--bg-surface, #f5f5f5);
}

/* Profile container with proper spacing */
.profile-container {
    min-height: calc(100vh - 70px);
    background: var(--bg-surface, #f5f5f5);
    padding: 0;
}

/* Profile header with help button */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    background: var(--bg-primary, #fff);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    margin-bottom: 2rem;
}

.profile-header h1 {
    margin: 0;
    color: var(--text-primary, #333);
    font-size: 2rem;
}

/* Help button styling */
.page-help-button {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary, #f0f0f0);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary, #333);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.page-help-button:hover {
    background: var(--bg-hover, #e0e0e0);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive header */
@media (max-width: 768px) {
    .profile-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .profile-header h1 {
        font-size: 1.5rem;
    }
    
    .page-help-button {
        width: 100%;
        justify-content: center;
    }
}

/* Location fields styling */
.location-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .location-fields {
        grid-template-columns: 2fr 2fr 1fr;
    }
}

.location-fields .form-control {
    width: 100%;
}

/* Remove duplicate profile-header styles since we defined them above */

.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Fix form input styling */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #333);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary, #4CAF50);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Profile Sections */
.profile-section {
    background: var(--bg-primary, #fff);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

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

.section-header h3 {
    color: var(--text-primary);
    margin: 0;
}

/* Profile Info */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
}

.info-value {
    color: var(--text-secondary);
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.checkbox-label span {
    color: var(--text-primary);
}

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

.stat-card {
    background-color: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 0.375rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

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

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

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-loading {
    text-align: center;
    padding: 2rem;
}

.activity-loading .spinner {
    margin: 0 auto 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease-in-out;
}

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

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1rem;
}

.activity-content {
    flex: 1;
}

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

.activity-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Empty State */
.activity-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.activity-empty p {
    margin-bottom: 1rem;
}

/* Success/Error Messages */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background-color: var(--success);
    color: var(--text-on-accent);
    border: 1px solid var(--success-border);
}

.alert-error {
    background-color: var(--error);
    color: var(--text-on-accent);
    border: 1px solid var(--error-border);
}

.alert-info {
    background-color: var(--link);
    color: var(--text-on-accent);
    border: 1px solid var(--primary-border);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease-in-out;
}

.password-strength-bar.weak {
    width: 33%;
    background-color: var(--error);
}

.password-strength-bar.medium {
    width: 66%;
    background-color: var(--warning);
}

.password-strength-bar.strong {
    width: 100%;
    background-color: var(--success);
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.password-strength-text.weak {
    color: var(--error);
}

.password-strength-text.medium {
    color: var(--warning);
}

.password-strength-text.strong {
    color: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-content {
        padding: 0 1rem;
    }
    
    .profile-section {
        padding: 1.5rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-label {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .activity-icon {
        margin-bottom: 0.5rem;
    }
}

/* Security Section */
.security-subsection {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-default);
}

.security-subsection:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.security-subsection h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.twofa-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
}

.twofa-status.enabled .status-icon {
    color: var(--success);
}

.twofa-status.enabled .status-text {
    color: var(--success);
}

.twofa-status.disabled .status-icon {
    color: var(--error);
}

.twofa-status.disabled .status-text {
    color: var(--text-secondary);
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Button Styles with Theme Support */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--color-primary, #4CAF50);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background: var(--color-primary-dark, #45a049);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary, #6c757d);
    color: var(--text-on-accent);
}

.btn-secondary:hover {
    background: var(--bg-secondary-dark, #5a6268);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger, #dc3545);
    color: var(--text-on-accent);
}

.btn-danger:hover {
    background: var(--color-danger-dark, #c82333);
    transform: translateY(-1px);
}

/* Stats Grid for contribution counts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-surface, #f8f9fa);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color, #e0e0e0);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary, #4CAF50);
}

.stat-label {
    color: var(--text-secondary, #666);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-surface, #f8f9fa);
    border-radius: 6px;
    border-left: 3px solid var(--color-primary, #4CAF50);
}

.activity-icon {
    font-size: 1.5rem;
}

.activity-details {
    flex: 1;
}

.activity-description {
    color: var(--text-primary, #333);
    margin-bottom: 0.25rem;
}

.activity-time {
    color: var(--text-secondary, #666);
    font-size: 0.875rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .account-actions {
        flex-direction: column;
    }
    
    .account-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Dark Theme Support */
.theme-dark .profile-container {
    background: var(--bg-surface, #1a1a1a);
}

.theme-dark .profile-section {
    background: var(--bg-primary, #2d2d2d);
}

.theme-dark .stat-card {
    background: var(--bg-surface, #2d2d2d);
    border-color: var(--border-color, #444);
}

.theme-dark .activity-item {
    background: var(--bg-surface, #2d2d2d);
}

/* High Contrast Mode Support */
.high-contrast .btn {
    border: 2px solid currentColor;
}

.high-contrast .profile-section {
    border: 2px solid var(--text-primary);
}

.high-contrast .stat-card {
    border: 2px solid var(--text-primary);
}

/* Account Actions Base Style */
.account-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Fix checkbox alignment */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* Improve form spacing */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 0; /* Remove default margin since we use gap */
}

/* Fix alert styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--color-success, #4CAF50);
    border: 1px solid var(--color-success, #4CAF50);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--color-warning, #FFC107);
    border: 1px solid var(--color-warning, #FFC107);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--color-danger, #dc3545);
    border: 1px solid var(--color-danger, #dc3545);
}/* User Avatar Dropdown Styles */

/* Avatar Container */
.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Avatar Button */
.user-avatar-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50px;
    transition: background-color 0.2s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

.user-avatar-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Avatar Image/Icon */
.user-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: var(--primary-color, #4CAF50);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-on-accent);
    position: relative;
    overflow: hidden;
    visibility: visible !important;
    opacity: 1 !important;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-initials {
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* Online Indicator */
.user-avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: var(--success);
    border: 2px solid white;
    border-radius: 50%;
}

/* Notification Badge */
.user-avatar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--error);
    color: var(--text-on-accent);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Dropdown Chevron */
.user-avatar-chevron {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.user-avatar-btn.active .user-avatar-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--bg-surface);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10001;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Header */
.user-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.user-dropdown-email {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
}

.user-dropdown-role {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* Dropdown Menu Items */
.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

.user-dropdown-item:focus {
    background-color: #e5e7eb;
    outline: none;
}

.user-dropdown-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.user-dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 8px 0;
}

/* Language indicator */
.user-dropdown-item .current-language {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    background: var(--bg-secondary, #f0f0f0);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* Ensure language button displays properly */
.user-dropdown-item[data-action="language"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 12px 16px;
}

@media (max-width: 768px) {
    .user-dropdown-item .current-language {
        font-size: 0.875rem;
        padding: 0.25rem 0.75rem;
    }
}

/* Sign Out Item - Different Color */
.user-dropdown-item.signout {
    color: var(--error);
}

.user-dropdown-item.signout:hover {
    background-color: #fee2e2;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .user-dropdown.active {
        transform: translateY(0);
    }
    
    .user-dropdown-header {
        padding: 20px;
        position: relative;
    }
    
    /* Mobile drag handle */
    .user-dropdown-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background-color: #d1d5db;
        border-radius: 2px;
    }
    
    .user-dropdown-item {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .user-dropdown-item-icon {
        font-size: 18px;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .user-dropdown {
        background-color: var(--text-primary);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    .user-dropdown-header {
        border-bottom-color: #374151;
    }
    
    .user-dropdown-name {
        color: #f9fafb;
    }
    
    .user-dropdown-email {
        color: #d1d5db;
    }
    
    .user-dropdown-role {
        color: var(--text-muted);
    }
    
    .user-dropdown-item {
        color: #e5e7eb;
    }
    
    .user-dropdown-item:hover {
        background-color: #374151;
    }
    
    .user-dropdown-divider {
        background-color: #374151;
    }
}

/* Loading State */
.user-avatar.loading {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Accessibility - Focus Visible */
.user-dropdown-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Backdrop for mobile */
.user-dropdown-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.user-dropdown-backdrop.active {
    display: block;
}

@media (max-width: 768px) {
    .user-dropdown-backdrop {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease;
    }
    
    .user-dropdown-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
}/* Chat Feature */
/* Chat Unified Styles */
/* Generated: Sat 16 Aug 2025 10:21:29 NZST */
/**
 * Chat Professional - Clean Consolidated CSS
 * Date: 2025-08-13
 * 
 * Following best practices:
 * - No !important rules (except absolutely necessary)
 * - Proper CSS reset
 * - Flexbox layout
 * - Component isolation
 * - Mobile-last responsive design
 */

/* ========================================
   1. CSS RESET
   ======================================== */
.chat-professional-page,
.chat-professional-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.chat-professional-page button {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

.chat-professional-page a {
    text-decoration: none;
    color: inherit;
}

.chat-professional-page img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   2. CSS VARIABLES
   ======================================== */
.chat-professional-page {
    /* Light mode colors */
    --chat-bg: #f9fafb;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --message-bg: #ffffff;
    --border-color: var(--border-subtle);
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent-color: var(--link);
    --accent-hover: #2563eb;
    --success-color: var(--success);
    --danger-color: var(--error);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Dark mode variables */
[data-theme="dark"] .chat-professional-page {
    --chat-bg: #111827;
    --header-bg: #1f2937;
    --input-bg: #1f2937;
    --message-bg: #1f2937;
    --border-color: var(--border-default);
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
}

/* ========================================
   3. BASE LAYOUT - Flexbox Structure
   ======================================== */
body.chat-professional-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--chat-bg);
    height: 100vh;
    overflow: hidden;
}

/* Hide the navbar on chat page */
.chat-professional-page .navbar {
    display: none;
}

/* Main container - Full height flex column */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: var(--chat-bg);
}

/* ========================================
   4. CHAT HEADER - Fixed height
   ======================================== */
.chat-header {
    flex: 0 0 auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--chat-bg);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

/* Chat title */
.chat-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.online-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.online-count .fa-circle {
    font-size: 8px;
    color: var(--success-color);
}

/* Icon buttons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

/* Language flag */
.language-flag {
    font-size: 20px;
    line-height: 1;
}

/* ========================================
   5. USER STATUS DROPDOWN
   ======================================== */
.user-status-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    background: var(--chat-bg);
    border-color: var(--text-secondary);
}

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

.dropdown-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform 0.2s ease;
}

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

/* Dropdown content */
.status-dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 480px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.status-dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Dropdown header */
.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.dropdown-close:hover {
    background: var(--chat-bg);
}

/* Filter buttons */
.dropdown-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.filter-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: var(--header-bg);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--chat-bg);
}

.filter-btn.active {
    background: var(--accent-color);
    color: var(--text-on-accent);
    border-color: var(--accent-color);
}

/* Users list */
.users-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-item:hover {
    background: var(--chat-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-message {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown footer */
.dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.dropdown-footer .btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: var(--chat-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* ========================================
   6. MESSAGES CONTAINER - Flexible height
   ======================================== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chat-bg);
    position: relative;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 40px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 24px;
}

/* ========================================
   7. CHAT INPUT BAR - Fixed height
   ======================================== */
.chat-input-bar {
    flex: 0 0 auto;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    background: var(--input-bg);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.input-wrapper {
    flex: 1;
    display: flex;
}

.message-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 16px;
    background: var(--chat-bg);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.message-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Input buttons */
.input-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--chat-bg);
    border-radius: 50%;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

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

.send-btn {
    background: var(--accent-color);
    color: var(--text-on-accent);
}

.send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

/* ========================================
   8. ONBOARDING BANNER
   ======================================== */
.onboarding-banner {
    padding: 20px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: var(--text-on-accent);
}

.banner-content h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.step-indicator {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-indicator p {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.onboarding-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* Hide onboarding for admins */
[data-user-role="admin"] .onboarding-banner,
[data-user-role="owner"] .onboarding-banner,
[data-tenant-role="admin"] .onboarding-banner,
[data-tenant-role="owner"] .onboarding-banner {
    display: none;
}

/* ========================================
   9. LOADING OVERLAY
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(17, 24, 39, 0.95);
}

.loading-overlay.hidden {
    display: none;
}

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

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================================
   10. MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .chat-header {
        padding: 12px;
        min-height: 56px;
    }
    
    .chat-title h1 {
        font-size: 16px;
    }
    
    .online-count {
        font-size: 11px;
    }
    
    .dropdown-toggle span {
        display: none;
    }
    
    .dropdown-toggle i:not(.fa-chevron-down) {
        font-size: 18px;
    }
    
    /* Mobile dropdown as bottom sheet */
    .status-dropdown-content {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .chat-input-bar {
        padding: 12px;
        min-height: 64px;
    }
    
    .input-btn:not(.send-btn) {
        width: 36px;
        height: 36px;
    }
}

/* ========================================
   11. UTILITY CLASSES
   ======================================== */
.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

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

.hidden {
    display: none;
}

.show {
    display: block;
}

/* ========================================
   12. TRANSITIONS & ANIMATIONS
   ======================================== */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: 200ms;
    transition-timing-function: ease;
}

/* Disable transitions on theme change */
.theme-transitioning * {
    transition: none;
}/* Professional Chat System - Mobile-First Design */

/* CSS Variables for theming */
:root {
  /* Primary Colors */
  --chat-primary: #2563eb;
  --chat-primary-dark: #1e40af;
  --chat-primary-light: #3b82f6;
  
  /* Neutral Grays */
  --chat-gray-50: #f9fafb;
  --chat-gray-100: #f3f4f6;
  --chat-gray-200: #e5e7eb;
  --chat-gray-300: #d1d5db;
  --chat-gray-400: #9ca3af;
  --chat-gray-500: #6b7280;
  --chat-gray-600: #4b5563;
  --chat-gray-700: #374151;
  --chat-gray-800: #1f2937;
  --chat-gray-900: #111827;
  
  /* Status Colors */
  --status-online: #10b981;
  --status-away: #f59e0b;
  --status-busy: #ef4444;
  --status-dnd: #3b82f6;
  --status-holiday: #8b5cf6;
  --status-offline: #6b7280;
  
  /* Message Colors */
  --msg-sent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --msg-sent-text: #ffffff;
  --msg-received: #ffffff;
  --msg-received-text: #1f2937;
  --msg-system: #f3f4f6;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Z-Index */
  --z-message: 1;
  --z-input: 100;
  --z-dropdown: 200;
  --z-modal: 1000;
  --z-notification: 1100;
}

/* Dark Theme */
[data-theme="dark"] {
  --chat-gray-50: #111827;
  --chat-gray-100: #1f2937;
  --chat-gray-200: #374151;
  --chat-gray-300: #4b5563;
  --chat-gray-400: #6b7280;
  --chat-gray-500: #9ca3af;
  --chat-gray-600: #d1d5db;
  --chat-gray-700: #e5e7eb;
  --chat-gray-800: #f3f4f6;
  --chat-gray-900: #f9fafb;
  
  --msg-received: #374151;
  --msg-received-text: #f9fafb;
  --msg-system: #1f2937;
}

/* Base Layout */
.chat-professional-page {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--chat-gray-50);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--chat-gray-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-notification);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--chat-gray-200);
  border-top-color: var(--chat-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: var(--chat-gray-100);
  border-bottom: 1px solid var(--chat-gray-200);
  box-shadow: var(--shadow-sm);
  z-index: var(--z-dropdown);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.back-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--chat-gray-600);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--chat-gray-200);
  color: var(--chat-gray-800);
}

.chat-title h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--chat-gray-900);
}

.online-count {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
  color: var(--chat-gray-500);
}

.online-count .fa-circle {
  font-size: 0.5rem;
  color: var(--status-online);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--chat-gray-600);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--chat-gray-200);
  color: var(--chat-gray-800);
}

.language-flag {
  font-size: 1.25rem;
}

/* User Status Dropdown */
.user-status-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--chat-gray-100);
  border: 1px solid var(--chat-gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  color: var(--chat-gray-700);
}

.dropdown-toggle:hover {
  background: var(--chat-gray-200);
  border-color: var(--chat-gray-300);
}

.dropdown-toggle[aria-expanded="true"] {
  background: var(--chat-gray-200);
  border-color: var(--chat-primary);
}

/* Status Dropdown Content */
.status-dropdown-content {
  position: absolute;
  top: calc(100% + var(--spacing-sm));
  right: 0;
  width: 320px;
  max-height: 480px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--chat-gray-200);
}

.dropdown-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--chat-gray-900);
}

.dropdown-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--chat-gray-500);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.dropdown-filters {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--chat-gray-100);
}

.filter-btn {
  flex: 1;
  padding: var(--spacing-sm);
  border: 1px solid var(--chat-gray-200);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  color: var(--chat-gray-600);
}

.filter-btn:hover {
  background: var(--chat-gray-50);
}

.filter-btn.active {
  background: var(--chat-primary);
  color: var(--text-on-accent);
  border-color: var(--chat-primary);
}

.users-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm);
}

.user-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.user-item:hover {
  background: var(--chat-gray-50);
}

.user-status-icon {
  font-size: 0.75rem;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 500;
  color: var(--chat-gray-900);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-message {
  font-size: 0.75rem;
  color: var(--chat-gray-500);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.return-date {
  font-size: 0.75rem;
  color: var(--chat-gray-400);
  font-style: italic;
}

.status-label {
  font-size: 0.75rem;
  color: var(--chat-gray-500);
  white-space: nowrap;
}

.dropdown-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--chat-gray-200);
}

/* Onboarding Banner */
.onboarding-banner {
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
  color: var(--text-on-accent);
  padding: var(--spacing-lg);
  margin: var(--spacing-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.banner-content h2 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.25rem;
}

.banner-content p {
  margin: 0 0 var(--spacing-md) 0;
  opacity: 0.95;
  line-height: 1.5;
}

#share-introduction-btn {
  background: var(--bg-surface);
  color: var(--chat-primary);
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

#share-introduction-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Thread Navigation */
.thread-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--chat-gray-100);
  border-bottom: 1px solid var(--chat-gray-200);
}

.thread-back-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: 1px solid var(--chat-gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--chat-gray-600);
}

.thread-info {
  flex: 1;
}

.thread-title {
  font-weight: 600;
  color: var(--chat-gray-900);
  display: block;
}

.thread-count {
  font-size: 0.875rem;
  color: var(--chat-gray-500);
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  padding-bottom: 100px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-height: 100%;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl);
  min-height: 400px;
  color: var(--chat-gray-600);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary-light), var(--chat-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-lg);
}

.empty-state-icon i {
  font-size: 2rem;
  color: var(--text-on-accent);
}

.empty-state h3 {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--chat-gray-800);
  font-size: 1.5rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--chat-gray-600);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 400px;
}

.onboarding-hint {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  color: var(--chat-primary);
  font-size: 0.9rem;
}

.onboarding-hint i {
  font-size: 1.1rem;
}

/* Message Card */
.message-card {
  display: flex;
  gap: var(--spacing-md);
  animation: slideInUp 0.3s ease-out;
}

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

.message-card.sent {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.message-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.875rem;
}

.sender-name {
  font-weight: 500;
  color: var(--chat-gray-700);
}

.message-time {
  color: var(--chat-gray-400);
  font-size: 0.75rem;
}

.message-bubble {
  background: var(--msg-received);
  color: var(--msg-received-text);
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  word-wrap: break-word;
}

.message-card.sent .message-bubble {
  background: var(--msg-sent);
  color: var(--msg-sent-text);
}

.message-text {
  line-height: 1.5;
}

.message-translation {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-style: italic;
  opacity: 0.9;
  font-size: 0.875rem;
}

.translation-notice {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: var(--spacing-xs);
}

/* Thread Indicator */
.thread-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--chat-gray-100);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--chat-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.thread-indicator:hover {
  background: var(--chat-gray-200);
}

/* Reactions */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 2px var(--spacing-sm);
  background: var(--chat-gray-100);
  border: 1px solid var(--chat-gray-200);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reaction-pill:hover {
  background: var(--chat-gray-200);
  transform: scale(1.05);
}

.reaction-pill.selected {
  background: var(--chat-primary);
  color: var(--text-on-accent);
  border-color: var(--chat-primary);
}

/* Attachments */
.message-attachment {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--chat-gray-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  cursor: pointer;
  transition: all 0.2s;
}

.message-attachment:hover {
  background: var(--chat-gray-100);
}

.attachment-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chat-gray-200);
  border-radius: var(--radius-md);
  color: var(--chat-gray-600);
}

.attachment-info {
  flex: 1;
  min-width: 0;
}

.attachment-name {
  font-weight: 500;
  color: var(--chat-gray-900);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--chat-gray-500);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  color: var(--chat-gray-500);
  font-size: 0.875rem;
  font-style: italic;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--chat-gray-400);
  border-radius: var(--radius-full);
  animation: typing-bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Input Bar */
.chat-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--chat-gray-200);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  z-index: var(--z-input);
  padding-bottom: env(safe-area-inset-bottom);
}

.reply-preview {
  padding: var(--spacing-md);
  background: var(--chat-gray-50);
  border-bottom: 1px solid var(--chat-gray-200);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

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

.reply-label {
  font-size: 0.75rem;
  color: var(--chat-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reply-name {
  font-weight: 600;
  color: var(--chat-primary);
  margin-left: var(--spacing-xs);
}

.reply-text {
  margin: var(--spacing-xs) 0 0 0;
  font-size: 0.875rem;
  color: var(--chat-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-cancel {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--chat-gray-400);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.translation-notice {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--chat-primary);
  color: var(--text-on-accent);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.input-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
}

.input-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--chat-gray-500);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.input-btn:hover {
  background: var(--chat-gray-100);
  color: var(--chat-gray-700);
}

.voice-btn {
  background: var(--chat-primary);
  color: var(--text-on-accent);
}

.voice-btn:hover {
  background: var(--chat-primary-dark);
}

.voice-btn.recording {
  background: var(--status-busy);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.message-input {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--chat-gray-300);
  border-radius: var(--radius-lg);
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: all 0.2s;
}

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

.send-btn {
  background: var(--chat-primary);
  color: var(--text-on-accent);
}

.send-btn:hover:not(:disabled) {
  background: var(--chat-primary-dark);
  transform: scale(1.05);
}

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

/* Video Call Modal */
.video-call-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--chat-gray-900);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
}

.video-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-video {
  position: absolute;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 120px;
  height: 160px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-xl);
  border: 2px solid white;
}

.call-info {
  position: absolute;
  top: var(--spacing-lg);
  left: var(--spacing-lg);
  color: var(--text-on-accent);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.caller-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.call-duration {
  font-size: 1rem;
  opacity: 0.9;
}

.call-quality {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
  opacity: 0.8;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-lg);
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
}

.control-btn {
  width: 56px;
  height: 56px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-on-accent);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.control-btn.danger {
  background: var(--status-busy);
}

.control-btn.muted {
  background: var(--chat-gray-600);
}

/* Incoming Call Modal */
.incoming-call-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.incoming-call-modal .modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.caller-info {
  margin-bottom: var(--spacing-lg);
}

.caller-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  margin-bottom: var(--spacing-md);
}

.caller-info h2 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.5rem;
  color: var(--chat-gray-900);
}

.caller-info p {
  margin: 0;
  color: var(--chat-gray-600);
}

.call-actions {
  display: flex;
  gap: var(--spacing-md);
}

.call-actions .btn {
  flex: 1;
  padding: var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.btn-danger {
  background: var(--status-busy);
  color: var(--text-on-accent);
}

.btn-success {
  background: var(--status-online);
  color: var(--text-on-accent);
}

/* Attachment Modal */
.attachment-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.attachment-modal.show {
  transform: translateY(0);
}

.attachment-modal h3 {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 1.25rem;
  color: var(--chat-gray-900);
}

.attachment-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}

.attachment-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--chat-gray-50);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.attachment-option:hover {
  background: var(--chat-gray-100);
  transform: scale(1.05);
}

.attachment-option i {
  font-size: 1.5rem;
  color: var(--chat-primary);
}

.attachment-option span {
  font-size: 0.875rem;
  color: var(--chat-gray-700);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .chat-header {
    padding: var(--spacing-sm);
  }
  
  .chat-title h1 {
    font-size: 1.125rem;
  }
  
  .header-right span:not(.language-flag) {
    display: none;
  }
  
  .status-dropdown-content {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .local-video {
    width: 80px;
    height: 120px;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
  }
  
  .attachment-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat-container {
    max-width: 768px;
    margin: 0 auto;
  }
  
  .message-content {
    max-width: 60%;
  }
}

/* Desktop Optimizations */
@media (min-width: 1025px) {
  .chat-container {
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: row;
  }
  
  /* Add sidebar for desktop */
  .chat-sidebar {
    width: 320px;
    background: var(--chat-gray-100);
    border-right: 1px solid var(--chat-gray-200);
    display: flex;
    flex-direction: column;
  }
  
  .chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .message-content {
    max-width: 50%;
  }
}

/* Utilities */
.text-success { color: var(--status-online); }
.text-warning { color: var(--status-away); }
.text-danger { color: var(--status-busy); }
.text-info { color: var(--status-dnd); }
.text-muted { color: var(--chat-gray-500); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

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

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--chat-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}/* From chat-emoji-picker.css */
/**
 * Emoji Picker Styles
 * Styling for the emoji selection interface
 */

.emoji-picker {
    position: fixed !important;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 320px;
    max-height: 400px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.emoji-picker.show {
    display: flex !important;
}

/* Header */
.emoji-picker-header {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.emoji-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.emoji-search:focus {
    border-color: var(--border-default);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.emoji-picker-close {
    margin-left: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.emoji-picker-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Categories */
.emoji-categories {
    display: flex;
    padding: 8px;
    gap: 4px;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.emoji-category-btn {
    padding: 8px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    min-width: 36px;
    transition: background 0.2s;
}

.emoji-category-btn:hover {
    background: var(--bg-hover);
}

.emoji-category-btn.active {
    background: #eff6ff;
    box-shadow: 0 0 0 2px #2563eb;
}

/* Emoji Grid */
.emoji-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-btn {
    padding: 8px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

.emoji-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Footer */
.emoji-picker-footer {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid #e5e7eb;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
}

.emoji-preview {
    font-size: 1.5rem;
    margin-right: 12px;
}

.emoji-name {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Scrollbar styling */
.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .emoji-picker {
        width: 90vw;
        max-width: 320px;
        bottom: 60px !important;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    .emoji-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}/* From chat-hero.css */
/* Chat Hero Section Styles */

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.breadcrumb a {
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary, #2563eb);
}

.breadcrumb-separator {
    color: var(--text-tertiary, #9ca3af);
}

.breadcrumb-current {
    color: var(--text-primary, #111827);
    font-weight: 500;
}

/* Chat Hero Section */
.chat-hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    margin-bottom: 24px;
    background: var(--bg-primary, #ffffff);
}

.hero-content h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0 0 8px 0;
}

.hero-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

.hero-subtitle .text-success {
    color: var(--status-online, #10b981);
    font-size: 8px;
    vertical-align: middle;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Page Help Button */
.page-help-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary, #f3f4f6);
    border: 1px solid var(--border-default, #e5e7eb);
    border-radius: 8px;
    color: var(--text-primary, #111827);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.page-help-button:hover {
    background: var(--bg-tertiary, #e5e7eb);
    border-color: var(--border-hover, #d1d5db);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-secondary {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-primary, #111827);
    border-color: var(--border-default, #e5e7eb);
}

.btn-secondary:hover {
    background: var(--bg-tertiary, #e5e7eb);
}

/* Status Dropdown */
.user-status-dropdown {
    position: relative;
}

.user-status-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary, #f3f4f6);
    border: 1px solid var(--border-default, #e5e7eb);
    border-radius: 8px;
    color: var(--text-primary, #111827);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.user-status-dropdown .dropdown-toggle:hover {
    background: var(--bg-tertiary, #e5e7eb);
}

/* Chat Container Adjustments */
#chat-container {
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    min-height: 0;
}

/* Chat Input Bar */
.chat-input-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary, #ffffff);
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    padding: 16px 0;
    margin-top: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-hero-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 0;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .hero-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    #chat-container {
        padding: 0 16px;
    }
}/* From chat-thread-modal.css */
/**
 * Chat Thread Modal Styles
 * Styling for thread list modal and thread UI components
 */

/* Thread List Modal */
.thread-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
}

.thread-list-modal.show {
    display: block;
}

.thread-list-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.thread-list-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease forwards;
}

.thread-list-modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.thread-list-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.thread-list-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.thread-list-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.thread-list-modal .modal-close:hover {
    color: var(--text-primary);
}

/* Modal Body */
.thread-list-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Thread Filters */
.thread-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.thread-filters .filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.thread-filters .filter-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-default);
}

.thread-filters .filter-btn.active {
    background: var(--link);
    color: var(--text-on-accent);
    border-color: var(--border-default);
}

.thread-filters .filter-btn i {
    font-size: 0.85rem;
}

/* Thread List */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Thread Item */
.thread-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.thread-item:hover {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.thread-icon {
    width: 40px;
    height: 40px;
    background: #e0e7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    flex-shrink: 0;
}

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

.thread-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.thread-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-badge {
    background: var(--link);
    color: var(--text-on-accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.thread-description {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.thread-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.thread-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-meta i {
    font-size: 0.75rem;
}

/* Empty State */
.thread-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.thread-empty-state i {
    margin-bottom: 16px;
    opacity: 0.5;
}

.thread-empty-state p {
    margin: 8px 0;
}

.thread-empty-state .text-muted {
    font-size: 0.9rem;
}

/* Modal Footer */
.thread-list-modal .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

/* Thread Creation Modal (from ThreadManager) */
.thread-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.thread-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.thread-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.thread-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.thread-modal.show .modal-content {
    transform: scale(1);
}

.thread-modal .form-group {
    margin-bottom: 20px;
}

.thread-modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.thread-modal input[type="text"],
.thread-modal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.thread-modal input[type="text"]:focus,
.thread-modal textarea:focus {
    outline: none;
    border-color: var(--border-default);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.thread-modal textarea {
    resize: vertical;
    min-height: 80px;
}

/* Thread Type Options */
.thread-type-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thread-type-options label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-type-options label:hover {
    background: var(--bg-card);
}

.thread-type-options input[type="radio"] {
    margin-right: 10px;
}

.thread-type-options input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--link);
}

/* Thread Navigation in Chat */
.thread-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-hover);
    border-bottom: 1px solid #e5e7eb;
}

.thread-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

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

.thread-info {
    flex: 1;
}

.thread-info .thread-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.thread-info .thread-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Thread Indicator on Messages */
.thread-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 8px;
    background: #eff6ff;
    border-radius: 4px;
    color: var(--link);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.thread-indicator:hover {
    background: #dbeafe;
}

/* Parent Message Display */
.thread-parent-message {
    margin: 16px 20px;
    padding: 12px;
    background: var(--bg-card);
    border-left: 3px solid #2563eb;
    border-radius: 6px;
}

.parent-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.parent-content {
    color: #374151;
}

.parent-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.parent-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.parent-author span {
    font-weight: 500;
}

.parent-time {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.parent-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

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

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Message Actions (hover menu) */
.message-actions {
    position: absolute;
    top: -30px;
    right: 10px;
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-surface);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.message-card:hover .message-actions {
    opacity: 1;
    visibility: visible;
}

.message-actions .action-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.message-actions .action-btn:hover {
    background: var(--bg-hover);
    color: var(--link);
}

/* Message card needs relative positioning for actions */
.message-card {
    position: relative;
}

/* Mobile Styles */
@media (max-width: 640px) {
    .thread-list-modal .modal-content {
        width: 95%;
        max-height: 90vh;
        top: 5vh;
        transform: translateX(-50%);
    }
    
    .thread-list-modal.show .modal-content {
        transform: translateX(-50%);
    }
    
    .thread-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .thread-item {
        padding: 10px;
    }
    
    .thread-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .thread-modal .modal-content {
        width: 95%;
    }
}/* Stories Feature */
/* Stories Page Styles */

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
    background-color: var(--white);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-control:disabled {
    background-color: var(--bg-color);
    color: var(--text-light);
    cursor: not-allowed;
}

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

/* Page Header */
.stories-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.stories-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.stories-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filter Controls */
.filter-controls {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.filter-controls h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-group.search-group {
    grid-column: 1 / -1;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-clear {
    background: var(--white);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: var(--bg-color);
    border-color: var(--text-light);
}

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

/* Story Card */
.story-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: visible;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    word-break: break-word;
    overflow-wrap: break-word;
}

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

.story-card.expanded {
    transform: none;
}

.story-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.story-header-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.story-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.privacy-badge,
.like-badge,
.comment-badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: var(--border-light);
    border-radius: 20px;
    white-space: nowrap;
}

.story-header:hover {
    background: var(--secondary-color);
}

.story-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    padding-right: 2rem;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.story-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.expand-icon {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.story-card.expanded .expand-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* Story Content */
.story-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.story-content.expanded {
    max-height: none;
    padding: 2rem;
}

.story-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 100%;
}

/* Story People */
.story-people {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.story-people h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.person-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.person-link:hover {
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Story Tags */
.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.story-tags h4 {
    width: 100%;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.tag {
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Story Actions */
.story-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-sm:hover {
    transform: translateY(-1px);
}

.btn-sm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-extract:hover:not(:disabled) {
    background: var(--primary-color);
}

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

.btn-extract.error {
    background: var(--error-color);
}

/* Story action buttons */
.btn-like,
.btn-comment,
.btn-edit,
.btn-share,
.btn-delete {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-like:hover,
.btn-comment:hover,
.btn-edit:hover,
.btn-share:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-like.liked {
    background: var(--error-bg-light);
    border-color: var(--error-color);
    color: var(--error-color);
}

.btn-delete {
    color: var(--error-color);
    border-color: var(--error-color);
}

.btn-delete:hover {
    background: var(--error-color);
    color: var(--white);
}

/* Empty State */
.no-stories {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.no-stories h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-stories p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.no-stories .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

/* Error State */
.error-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.error-message h3 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-message p {
    margin-bottom: 2rem;
    color: var(--text-light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem;
}

.pagination button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stories-container {
        padding: 1rem;
    }
    
    .stories-header h1 {
        font-size: 2rem;
    }
    
    .filter-controls {
        padding: 1.5rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-group.search-group {
        grid-column: 1;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .story-meta {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .story-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-sm {
        justify-content: center;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stories-container {
        padding: 0.5rem;
    }
    
    .story-header {
        padding: 1rem;
    }
    
    .story-content.expanded {
        padding: 1.5rem;
    }
    
    .story-header h3 {
        font-size: 1.1rem;
    }
    
    .people-list {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .person-link {
        justify-content: center;
    }
}

/* Inline edit form styles */
.story-edit-form {
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    margin-top: 1rem;
}

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

.story-edit-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.story-edit-form .form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 0.25rem;
    font-size: 1rem;
}

.story-edit-form textarea.form-input {
    resize: vertical;
    min-height: 150px;
}

.story-edit-form .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.story-content.editing {
    background-color: var(--warning-bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
}/* Story Collector Styles */
:root {
    --collector-bg: var(--bg-surface);
    --card-hover: var(--bg-hover);
    --voice-recording: var(--error);
    --voice-active: var(--success);
    --progress-bg: var(--bg-hover);
    --progress-fill: var(--success);
    --border-light: rgba(0, 0, 0, 0.08);
    --text-lighter: #9ca3af;
    --primary-rgb: 59, 130, 246;
    --error-shadow: rgba(239, 68, 68, 0.4);
    
    /* Map missing variables to theme system */
    --text-color: var(--text-primary);
    --text-light: var(--text-secondary);
    --primary-color: var(--link);
}

.story-collector-main {
    min-height: calc(100vh - 80px);
    background-color: var(--bg-surface, #FFFFFF);
    padding: 2rem 0;
}

/* Header */
.collector-header {
    margin-bottom: 3rem;
}

.collector-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.collector-header .header-content > div {
    flex: 1;
    text-align: center;
}

.collector-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.collector-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-default);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mode-btn:hover {
    background: var(--card-hover);
}

.mode-btn.active {
    background: var(--primary-color);
    color: var(--text-on-accent);
    border-color: var(--primary-color);
}

/* Mode Select Buttons (Freeform Screen) */
.input-mode-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.mode-select-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-default);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.mode-select-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-select-btn.active {
    background: var(--primary-color);
    color: var(--text-on-accent);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

/* Progress Bar */
.story-progress {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.progress-bar {
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--progress-fill);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Collection Screens */
.story-collection-area {
    max-width: 900px;
    margin: 0 auto;
}

.collection-screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.collection-screen.active {
    display: block;
}

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

/* Welcome Screen */
.welcome-content {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.welcome-content h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.welcome-content > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.story-options h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.option-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.option-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.option-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

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

/* Life Phases Screen */
.life-phases-screen {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.life-phases-screen h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.life-phases-screen > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.phase-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.phase-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.phase-card:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.phase-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.phase-card h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.phase-card p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Topics Screen */
.topics-screen {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.topics-screen h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.topics-screen > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.topic-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.topic-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.topic-card:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.topic-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.topic-card h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.topic-card p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* People Screen */
.people-screen {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.people-screen h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.people-screen > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.people-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.people-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.people-card:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.people-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.people-card h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.people-card p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Prompts Screen */
/* Prompts Screen - Modern Professional Style */
.prompts-screen {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.4s ease;
    max-width: 900px;
    margin: 0 auto;
}

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

.prompt-header,
.prompts-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.back-to-phases {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-light);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-to-phases:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateX(-2px);
}

#current-phase-title {
    flex: 1;
    text-align: center;
    margin: 0;
}

/* Prompt Card - Modern Card Design */
.prompt-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.prompt-container {
    max-width: 700px;
    margin: 0 auto;
}

.prompt-question {
    margin-bottom: 2rem;
}

.prompt-question h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.prompt-helper {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

#prompt-helper {
    color: var(--text-light);
    font-style: italic;
}

/* Input Areas */
.input-area {
    display: none;
    margin-bottom: 2rem;
}

.input-area.active {
    display: block;
}

/* Typing Mode - Modern Input Style */
.story-textarea,
#story-input {
    width: 100%;
    min-height: 200px;
    padding: 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--bg-surface);
    color: var(--text-color);
}

.story-textarea:focus,
#story-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    background: var(--bg-card);
}

.story-textarea::placeholder,
#story-input::placeholder {
    color: var(--text-lighter);
    font-style: italic;
}

.input-helpers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.word-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Voice Mode */
.voice-controls {
    text-align: center;
    padding: 3rem;
}

.voice-input-area {
    text-align: center;
    padding: 3rem 1rem;
}

.record-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

.record-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.record-btn.recording {
    background: var(--voice-recording);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--error-shadow); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.recording-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: var(--voice-recording);
    border-radius: 50%;
    animation: blink 1s infinite;
}

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

.recording-time {
    font-family: monospace;
    font-size: 1.125rem;
}

.voice-transcript {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.voice-transcript h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.transcript-text {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Prompt Actions */
/* Prompt Actions - Modern Button Styles */
.prompt-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.prompt-actions .btn {
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-actions .btn-secondary {
    background: var(--bg-hover);
    color: var(--text-color);
    border: 1px solid var(--border-light);
}

.prompt-actions .btn-secondary:hover {
    background: var(--bg-surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.prompt-actions .btn-primary {
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
}

.prompt-actions .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.prompt-actions .btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: none;
}

.prompt-actions .btn-ghost:hover {
    color: var(--text-color);
    background: var(--bg-hover);
}

/* Prompt Navigation */
.prompt-navigation {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.prompt-dots {
    display: flex;
    gap: 0.5rem;
}

.prompt-dot {
    width: 8px;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.prompt-dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

.prompt-dot.completed {
    background: var(--voice-active);
}

/* Review Screen */
.review-screen {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.story-review {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.review-section {
    margin-bottom: 2rem;
}

.review-section:last-child {
    margin-bottom: 0;
}

.review-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.review-section p {
    line-height: 1.6;
}

.story-metadata {
    margin-bottom: 2rem;
}

.story-metadata h3 {
    margin-bottom: 1.5rem;
}

/* Success Screen */
.success-content {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-content h2 {
    margin-bottom: 1rem;
}

.success-content p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Adaptive Tips */
.adaptive-tips {
    margin-top: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tip-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--info-bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
}

.tip-card i {
    color: var(--info-color);
    font-size: 1.25rem;
}

.tip-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--info-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
    .option-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .phase-cards,
    .topic-cards,
    .people-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .prompt-actions {
        flex-direction: column;
    }
    
    .success-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .success-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .collector-header h1 {
        font-size: 2rem;
    }
    
    .option-cards {
        grid-template-columns: 1fr;
    }
    
    .phase-cards,
    .topic-cards,
    .people-cards {
        grid-template-columns: 1fr;
    }
    
    .mode-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Audio Preview Section */
.audio-preview-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    text-align: center;
    border: 1px solid var(--border-default);
}

.audio-preview-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.audio-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

#re-record-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#save-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Enhanced Transcription Section */
.transcription-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--text-light);
}

.transcription-status .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-subtle);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.transcript-content {
    padding: 1rem;
}

.transcript-textarea {
    width: 100%;
    padding: 1rem;
    background: var(--collector-bg);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    margin: 1rem 0;
    line-height: 1.6;
    min-height: 150px;
    font-family: inherit;
    resize: vertical;
    font-size: 1rem;
}

.transcript-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--link-bg-alpha);
}

.transcript-actions {
    text-align: right;
    margin-top: 1rem;
}

#use-transcript-btn {
    color: var(--primary-color);
    font-weight: 500;
}

/* Free Writing Screen */
.freeform-screen {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.freeform-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.freeform-header h2 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

.freeform-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.freeform-input-area {
    margin-bottom: 2rem;
}

.freeform-container {
    position: relative;
}

.freeform-container .story-textarea {
    width: 100%;
    min-height: 300px;
    font-size: 1.125rem;
    line-height: 1.8;
}

.freeform-container .voice-controls {
    text-align: center;
    padding: 3rem 1rem;
}

.freeform-word-count {
    display: block;
    text-align: right;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.freeform-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-default);
}

#freeform-save-story {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

/* Responsive adjustments for freeform */
@media (max-width: 768px) {
    .freeform-screen {
        padding: 1.5rem;
    }
    
    .freeform-container .story-textarea {
        min-height: 200px;
        font-size: 1rem;
    }
    
    .freeform-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .freeform-actions button {
        width: 100%;
    }
}/* Story Connections Styles */

/* Navigation Bar */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

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

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-brand-multiline {
  display: flex;
  flex-direction: column;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.2;
}

.tenant-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
}

.brand-line-2,
.brand-line-3 {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 400;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  font-size: 0.95rem;
  white-space: nowrap;
}

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

.nav-link.active {
  background: var(--primary-color);
  color: var(--text-on-accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Responsive navigation */
@media (max-width: 1200px) {
  .nav-menu {
    gap: 1rem;
  }
  
  .nav-link {
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
  }
}

.main-content {
  background: var(--bg-color);
  min-height: 100vh;
  padding: 2rem 0;
}

.page-header {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title i {
  color: var(--primary-color);
}

.page-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0.5rem 0 0 0;
  max-width: 600px;
}

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

/* Loading, Error, and Empty States */
.loading-container,
.error-container,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  padding: 2rem;
  text-align: center;
}

.loading-spinner {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.loading-spinner i {
  animation: spin 2s linear infinite;
}

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

.loading-text {
  font-size: 1.1rem;
  color: var(--text-light);
}

.error-message,
.empty-content {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 500px;
  box-shadow: var(--shadow);
}

.error-message i,
.empty-content i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.error-message h3,
.empty-content h3 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.error-message p,
.empty-content p {
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Story Connections Container */
.story-connections-container {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

/* Story Connections UI Styles */
.pattern-discovery-ui {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  min-height: 400px;
}

.discovery-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.discovery-header h2 {
  color: var(--text-color);
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--white);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
}

.tab-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-on-accent);
  box-shadow: var(--shadow);
}

.discovery-content {
  min-height: 300px;
  position: relative;
}

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Connections List */
.connections-summary,
.story-groups {
  margin-bottom: 2rem;
}

.connections-summary h3,
.story-groups h3 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.connections-list,
.groups-list {
  display: grid;
  gap: 1rem;
}

.connection-item,
.story-group {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.connection-stories {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.story-title {
  font-weight: 600;
  color: var(--text-color);
}

.connection-type {
  background: var(--primary-color);
  color: var(--text-on-accent);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.no-connections,
.no-groups {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  padding: 2rem;
}

/* Suggestions */
.suggestions-list {
  display: grid;
  gap: 1rem;
}

.suggestion-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.suggestion-icon {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.suggestion-content h4 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.suggestion-content p {
  color: var(--text-light);
  margin: 0;
  font-size: 0.9rem;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-on-accent);
}

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

.btn-secondary {
  background: var(--white);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

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

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  z-index: 1000;
}

.modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  max-width: 600px;
  margin: 5% auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.modal-close:hover {
  color: var(--text-color);
}

.help-section {
  margin-bottom: 2rem;
}

.help-section h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-section ul {
  margin-left: 1.5rem;
  color: var(--text-light);
}

.help-section li {
  margin-bottom: 0.5rem;
}

/* Navigation Dropdown Fixes - Only keep necessary overrides */
.nav-actions {
  position: relative;
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background-color: var(--bg-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 10001;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 0.5rem;
  margin-right: 1rem;
}

.lang-btn {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.lang-btn:hover {
  background: var(--primary-color);
  color: var(--text-on-accent);
}

/* Story Connections UI Styles */
.story-connections-ui {
  min-height: 500px;
}

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

.view-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
}

.view-btn.active {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-color: var(--primary-color);
}

.view-btn i {
  font-size: 1rem;
}

.connection-stats {
  display: flex;
  gap: 2rem;
}

.connection-stats .stat {
  text-align: center;
}

.connection-stats .stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-color);
}

.connection-stats .stat-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Connection Actions */
.connections-actions {
  margin-bottom: 1rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  color: var(--primary-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.action-btn i {
  font-size: 1rem;
}

/* Filters */
.connections-filters {
  background: var(--bg-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-group label {
  font-weight: 500;
  color: var(--text-color);
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--white);
  min-width: 150px;
}

.filter-range {
  width: 150px;
}

.range-value {
  font-weight: 500;
  color: var(--primary-color);
  min-width: 40px;
}

.filter-chips {
  display: flex;
  gap: 0.5rem;
}

.filter-chip {
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
}

.filter-chip.active {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-color: var(--primary-color);
}

/* Connections View */
.connections-grid {
  display: grid;
  gap: 1.5rem;
}

.connection-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

.connection-card.highlighted {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-bg-light);
}

.connection-stories {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.story-preview {
  cursor: pointer;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}

.story-preview:hover {
  background: var(--primary-color);
  color: var(--text-on-accent);
}

.story-preview h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.story-meta {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.8;
}

.connection-indicator {
  text-align: center;
  padding: 0 1rem;
}

.connection-type {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.connection-strength {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.connection-indicator i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.connection-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.shared-element,
.connection-reason {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-color);
  border-radius: 20px;
  color: var(--text-color);
}

.shared-element i,
.connection-reason i {
  font-size: 0.875rem;
  color: var(--primary-color);
}

/* Clusters View */
.clusters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.cluster-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

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

.cluster-header i {
  font-size: 2rem;
  color: var(--primary-color);
}

.cluster-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-color);
}

.cluster-description {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.cluster-stories {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.story-thumbnail {
  width: 40px;
  height: 40px;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.25rem;
}

.more-stories {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.cluster-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

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

.person-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

.person-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.person-avatar {
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.person-info h3 {
  margin: 0 0 0.25rem 0;
  color: var(--text-color);
}

.person-info p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.875rem;
}

.person-connections {
  margin-bottom: 1rem;
}

.connections-label {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.connected-people {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.person-chip {
  padding: 0.25rem 0.75rem;
  background: var(--bg-color);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-color);
}

.more-people {
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Timeline View */
.timeline-view {
  position: relative;
}

.timeline-decade {
  margin-bottom: 2rem;
  position: relative;
  padding-left: 2rem;
}

.timeline-decade::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.decade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: var(--border-radius);
}

.decade-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.story-count {
  color: var(--text-light);
  font-size: 0.875rem;
}

.decade-stories {
  display: grid;
  gap: 1rem;
}

.timeline-story {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeline-story:hover {
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.story-year {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.125rem;
}

.story-content h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-color);
}

.story-people {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

.decade-connections {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: var(--border-radius);
}

.connections-summary {
  margin: 0;
  color: var(--text-color);
  font-size: 0.875rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.empty-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .connections-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-selector {
    order: 2;
  }
  
  .connection-stats {
    order: 1;
    justify-content: space-around;
    margin-bottom: 1rem;
  }
  
  .connections-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .connection-stories {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .connection-indicator {
    order: -1;
    margin-bottom: 0.5rem;
  }
  
  .clusters-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline-decade {
    padding-left: 1rem;
  }
  
  .timeline-story {
    grid-template-columns: 60px 1fr;
  }
}

/* Export Modal Styles */
.export-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.export-modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.export-modal-content h3 {
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.export-modal-content p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.export-format-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.export-format-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-format-btn:hover {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-color: var(--primary-color);
}

.export-format-btn i {
  font-size: 2rem;
}

.export-format-btn span {
  font-size: 0.875rem;
  font-weight: 500;
}

.export-cancel-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-cancel-btn:hover {
  background: var(--bg-color);
}

/* Export Notification */
.export-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--success);
  color: var(--text-on-accent);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  animation: slideInUp 0.3s ease-out;
  z-index: 1001;
}

.export-notification i {
  font-size: 1.25rem;
}

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

@media (max-width: 768px) {
  .export-format-options {
    grid-template-columns: 1fr;
  }
  
  .export-notification {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
}
/* Enhanced Story Viewer Styles */

.enhanced-story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    z-index: 1000;
    display: none;
    overflow-y: auto;
}

body.story-viewer-open {
    overflow: hidden;
}

.story-viewer-header {
    background: var(--gradient-primary);
    color: var(--text-on-accent);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--hover-overlay);
}

.btn-close {
    background: var(--white-alpha-20);
    border: none;
    color: var(--text-on-accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--white-alpha-30);
    transform: scale(1.1);
}

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

.btn-action {
    background: var(--white-alpha-20);
    border: none;
    color: var(--text-on-accent);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action:hover {
    background: var(--white-alpha-30);
    transform: translateY(-1px);
}

.story-content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.story-main-content {
    max-width: none;
}

.story-header-info {
    margin-bottom: 2rem;
}

.story-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.story-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
}

.story-date::before {
    content: "📅 ";
    margin-right: 0.3rem;
}

.story-author::before {
    content: "✍️ ";
    margin-right: 0.3rem;
}

.story-people {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.person-tag {
    background: var(--gradient-primary);
    color: var(--text-on-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.person-tag:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.story-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.story-content p {
    margin-bottom: 1.5rem;
}

.story-content p:first-of-type::first-letter {
    font-size: 3rem;
    float: left;
    line-height: 1;
    margin: 0.1rem 0.5rem 0 0;
    color: var(--primary-color);
    font-weight: bold;
}

.story-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.media-item {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface);
}

.media-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-item img:hover {
    transform: scale(1.05);
}

.media-item audio {
    width: 100%;
    margin: 1rem 0;
}

.media-caption {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.document-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.document-link:hover {
    background: var(--info-bg-light);
}

.story-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.story-tag {
    background: var(--info-bg-light);
    color: var(--info-hover);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
}

.story-tag:hover {
    background: var(--info-hover);
    color: var(--text-on-accent);
}

/* Sidebar */
.story-sidebar {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.timeline-events-mini,
.related-stories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.timeline-event-mini,
.related-story-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-event-mini:hover,
.related-story-item:hover {
    box-shadow: 0 2px 8px var(--hover-overlay);
    transform: translateY(-1px);
}

.event-date-mini {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.event-title-mini,
.related-story-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.event-type-mini {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.related-story-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.related-story-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.story-context {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 1rem;
}

.context-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.context-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.context-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
    min-width: 70px;
}

.context-value {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: right;
    flex: 1;
}

/* Footer */
.story-viewer-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-navigation {
    display: flex;
    gap: 1rem;
}

.btn-nav {
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-nav:disabled {
    background: var(--border-default);
    cursor: not-allowed;
    transform: none;
}

.story-interactions {
    display: flex;
    gap: 1rem;
}

.btn-interaction {
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-interaction:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-interaction.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-accent);
}

/* Loading and Empty States */
.loading-placeholder,
.empty-state,
.error-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.loading-placeholder::before {
    content: "⏳ ";
    margin-right: 0.5rem;
}

.empty-state::before {
    content: "📝 ";
    margin-right: 0.5rem;
}

.error-state {
    color: var(--error);
}

.error-state::before {
    content: "⚠️ ";
    margin-right: 0.5rem;
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-darker);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--text-on-accent);
    font-size: 2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: var(--text-on-accent);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    z-index: 3000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .story-content-area {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .story-sidebar {
        order: -1;
        background: none;
        padding: 0;
    }
    
    .sidebar-section {
        background: var(--bg-surface);
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .enhanced-story-viewer {
        font-size: 0.9rem;
    }
    
    .story-viewer-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .story-actions {
        width: 100%;
        justify-content: space-around;
    }
    
    .btn-action {
        flex: 1;
        justify-content: center;
        font-size: 0.8rem;
    }
    
    .story-content-area {
        padding: 1rem;
    }
    
    .story-title {
        font-size: 2rem;
    }
    
    .story-metadata {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .story-viewer-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .story-navigation,
    .story-interactions {
        width: 100%;
        justify-content: space-around;
    }
    
    .btn-nav,
    .btn-interaction {
        flex: 1;
        justify-content: center;
    }
}

/* Scrollbar Styling */
.timeline-events-mini::-webkit-scrollbar,
.related-stories::-webkit-scrollbar {
    width: 4px;
}

.timeline-events-mini::-webkit-scrollbar-track,
.related-stories::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 2px;
}

.timeline-events-mini::-webkit-scrollbar-thumb,
.related-stories::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* Animation for smooth appearance */
.enhanced-story-viewer {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}/* Timeline Feature */
/* From timeline-compare.css */
/* Timeline Comparison Styles */

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

.compare-header h1 {
    margin: 0;
    color: var(--primary-color);
}

/* Member Selection */
.member-selection {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.selection-controls {
    margin-top: 1rem;
}

#treeSelector {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
}

.member-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 4px;
}

.member-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.member-checkbox:hover {
    background: var(--bg-hover);
}

.member-checkbox input {
    margin-right: 0.5rem;
}

.member-checkbox.selected {
    background: var(--info-bg-light);
}

/* Comparison Options */
.comparison-options {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.option-group {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#zoomSlider {
    width: 200px;
}

/* Timeline Comparison Container */
.comparison-container {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    position: relative;
}

.timeline-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
    border-bottom: 2px solid var(--border-default);
}

.year-scale {
    display: flex;
    height: 40px;
    position: relative;
    background: var(--bg-surface);
}

.year-marker {
    position: absolute;
    padding: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-default);
}

.decade-marker {
    font-size: 1.1rem;
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Individual Timelines */
.timelines-wrapper {
    position: relative;
    min-height: 200px;
}

.member-timeline {
    position: relative;
    height: 80px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
}

.member-timeline:last-child {
    border-bottom: none;
}

.member-info {
    position: sticky;
    left: 0;
    width: 200px;
    padding: 1rem;
    background: var(--bg-card);
    border-right: 2px solid var(--border-default);
    z-index: 5;
}

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

.member-dates {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.phases-track {
    position: relative;
    flex: 1;
    height: 100%;
}

/* Phase Blocks */
.phase-block {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.9rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.phase-block:hover {
    transform: translateY(-50%) scale(1.05);
    z-index: 2;
    box-shadow: var(--shadow-lg);
}

/* Phase type colors */
.phase-block.education {
    background: var(--primary-bg-light);
    border: 1px solid var(--primary-color);
    color: var(--primary-hover);
}

.phase-block.career {
    background: var(--info-bg-light);
    border: 1px solid var(--info-color);
    color: var(--info-hover);
}

.phase-block.family {
    background: var(--success-bg-light);
    border: 1px solid var(--success-dark);
    color: var(--success-dark);
}

.phase-block.transition {
    background: var(--warning-bg-light);
    border: 1px solid var(--warning);
    color: var(--warning-dark);
}

/* Pattern Analysis */
.pattern-analysis {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 8px;
}

.pattern-card {
    background: var(--bg-card);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.pattern-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--info-bg-light);
    color: var(--info-hover);
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.pattern-description {
    color: var(--text-primary);
    line-height: 1.6;
}

.affected-members {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Legend */
.timeline-legend {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.education {
    background: var(--primary-bg-light);
    border: 1px solid var(--primary-color);
}

.legend-color.career {
    background: var(--info-bg-light);
    border: 1px solid var(--info-color);
}

.legend-color.family {
    background: var(--success-bg-light);
    border: 1px solid var(--success-dark);
}

.legend-color.transition {
    background: var(--warning-bg-light);
    border: 1px solid var(--warning);
}

/* Tooltip */
.phase-tooltip {
    position: absolute;
    background: var(--overlay-darker);
    color: var(--text-on-accent);
    padding: 1rem;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
}

.tooltip-content h4 {
    margin: 0 0 0.5rem;
    color: var(--text-on-accent);
}

.tooltip-content p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .compare-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .member-info {
        width: 150px;
    }
    
    .timeline-legend {
        position: static;
        margin-top: 2rem;
    }
    
    .option-group {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Zoom effects */
.comparison-container[data-zoom="50"] {
    font-size: 0.8rem;
}

.comparison-container[data-zoom="50"] .phase-block {
    height: 30px;
}

.comparison-container[data-zoom="150"] {
    font-size: 1.1rem;
}

.comparison-container[data-zoom="150"] .phase-block {
    height: 50px;
}

.comparison-container[data-zoom="200"] {
    font-size: 1.2rem;
}

.comparison-container[data-zoom="200"] .phase-block {
    height: 60px;
}

/* Connection lines for patterns */
.pattern-connection {
    position: absolute;
    border-top: 2px dashed var(--warning);
    opacity: 0.6;
    pointer-events: none;
}

/* Highlight similar phases */
.phase-block.highlighted {
    box-shadow: 0 0 0 3px var(--warning-shadow);
}

/* Age indicator */
.age-indicator {
    position: absolute;
    bottom: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}/* From timeline.css */
/* Timeline Page Styles */

.timeline-main {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    background-color: var(--bg-color);
}

.timeline-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-header h2 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.timeline-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.timeline-header .header-actions {
    position: absolute;
    right: 0;
    top: 0;
}

@media (max-width: 768px) {
    .timeline-header .header-actions {
        position: static;
        margin-top: 1rem;
    }
}

/* Timeline Controls */
.timeline-controls {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Person links in timeline */
.person-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.person-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

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

.year-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.year-range input {
    flex: 1;
}

.view-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.view-btn {
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

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

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

/* Timeline View */
.timeline-container {
    position: relative;
    padding: 2rem 0;
    background-color: var(--bg-surface);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
    transform: translateX(-50%);
}

.timeline-events {
    position: relative;
    padding: 0 2rem;
}

/* Timeline Event */
.timeline-event {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: flex-start;
}

.timeline-event:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-event:nth-child(odd) .event-content {
    text-align: right;
}

.timeline-event:nth-child(odd) .event-date {
    text-align: left;
}

.event-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background-color: var(--bg-surface);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.event-marker.birth { border-color: var(--success-color); }
.event-marker.death { border-color: var(--text-secondary); }
.event-marker.marriage { border-color: var(--accent-color); }
.event-marker.migration { border-color: var(--info-color); }
.event-marker.achievement { border-color: var(--warning-color); }

.event-content {
    flex: 1;
    padding: 0 2rem;
    cursor: pointer;
    transition: transform 0.15s ease-in-out;
}

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

.event-card {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.timeline-event:nth-child(odd) .event-card {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.event-card.birth { border-color: var(--success-color); }
.event-card.death { border-color: var(--text-secondary); }
.event-card.marriage { border-color: var(--accent-color); }
.event-card.migration { border-color: var(--info-color); }
.event-card.achievement { border-color: var(--warning-color); }

.event-date {
    flex: 1;
    padding: 0 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    padding-top: 0.5rem;
}

.event-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.event-description {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.event-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-light);
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Life Phases Enhancement */
.timeline-enhanced-life-phases {
    position: absolute;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.timeline-enhanced-phase-band {
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0.1;
    border-radius: 8px;
    margin: 0 20px;
}

.timeline-enhanced-phase-band.childhood {
    background-color: var(--success-color);
}

.timeline-enhanced-phase-band.adolescence {
    background-color: var(--info-color);
}

.timeline-enhanced-phase-band.young-adult {
    background-color: var(--warning-color);
}

.timeline-enhanced-phase-band.middle-age {
    background-color: var(--accent-color);
}

.timeline-enhanced-phase-band.senior {
    background-color: var(--primary-color);
}

.timeline-enhanced-phase-label {
    position: absolute;
    top: 5px;
    left: 25px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    opacity: 0.7;
}

/* Quick Filters Enhancement */
.timeline-enhanced-quick-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.timeline-enhanced-decade-btn {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-enhanced-decade-btn:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
}

.timeline-enhanced-decade-btn.active {
    background-color: var(--primary-color);
    color: var(--text-on-accent);
    border-color: var(--primary-color);
}

/* Event Density Indicator */
.timeline-enhanced-density {
    position: absolute;
    left: 48%;
    width: 4%;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--primary-bg-light) 20%, 
        var(--primary-bg-medium) 50%, 
        var(--primary-bg-light) 80%, 
        transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Person Timeline Enhancement */
.person-timeline-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
}

.person-timeline-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
    font-size: 2rem;
    font-weight: 600;
}

.person-timeline-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.person-timeline-stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.person-timeline-stat {
    font-size: 0.875rem;
    color: var(--text-light);
}

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

/* Mobile Enhancements */
@media (max-width: 768px) {
    .timeline-enhanced-quick-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .timeline-enhanced-decade-btn {
        flex-shrink: 0;
    }
    
    .person-timeline-header {
        flex-direction: column;
        text-align: center;
    }
    
    .person-timeline-stats {
        justify-content: center;
    }
}

/* List View */
.list-container {
    background-color: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.event-table {
    width: 100%;
    border-collapse: collapse;
}

.event-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
}

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

.event-table tr:hover {
    background-color: var(--bg-color);
    cursor: pointer;
}

.event-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.event-type-badge.birth { background-color: var(--success-bg-light); color: var(--success-color); }
.event-type-badge.death { background-color: var(--bg-hover); color: var(--text-primary); }
.event-type-badge.marriage { background-color: var(--accent-bg-light); color: var(--accent-color); }
.event-type-badge.migration { background-color: var(--info-bg-light); color: var(--info-color); }
.event-type-badge.achievement { background-color: var(--warning-bg-light); color: var(--warning-color); }
.event-type-badge.other { background-color: var(--bg-hover); color: var(--text-secondary); }

/* Loading State */
.timeline-loading {
    text-align: center;
    padding: 4rem;
}

.timeline-loading .spinner {
    margin: 0 auto 1rem;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--overlay-dark);
}

.modal-content {
    background-color: var(--bg-surface);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-color);
}

#event-details h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

#event-details .detail-row {
    display: flex;
    margin-bottom: 0.75rem;
}

#event-details .detail-label {
    font-weight: 600;
    color: var(--text-color);
    min-width: 120px;
}

#event-details .detail-value {
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }
    
    .timeline-event {
        flex-direction: column !important;
        margin-left: 40px;
    }
    
    .timeline-event:nth-child(odd) {
        flex-direction: column !important;
    }
    
    .timeline-event:nth-child(odd) .event-content,
    .timeline-event:nth-child(odd) .event-date {
        text-align: left !important;
    }
    
    .timeline-event:nth-child(odd) .event-card {
        border-right: none;
        border-left: 4px solid var(--primary-color);
    }
    
    .event-marker {
        left: 20px !important;
    }
    
    .event-content,
    .event-date {
        padding: 0 0 0 2rem !important;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .view-controls {
        flex-direction: column;
    }
    
    .view-btn {
        width: 100%;
    }
}/* From timeline-navigation.css */
/* Timeline Navigation Component Styles */

.timeline-navigation {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.nav-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-default);
}

.nav-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.nav-section h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-section h4::before {
    content: "";
    width: 3px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* View Mode Buttons */
.view-mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.view-mode-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.view-mode-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-bg-light);
    color: var(--primary-color);
}

.view-mode-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: var(--text-on-accent);
    box-shadow: 0 2px 6px var(--primary-bg-medium);
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.member-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

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

.member-card.selected {
    background: var(--gradient-primary);
    color: var(--text-on-accent);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--primary-bg-medium);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    background: var(--gradient-primary);
    color: var(--text-on-accent);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.member-dates,
.member-generation {
    font-size: 0.8rem;
    opacity: 0.8;
}

.member-card.selected .member-dates,
.member-card.selected .member-generation {
    opacity: 0.9;
}

/* Time Controls */
.time-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.time-preset-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    text-align: center;
}

.time-preset-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-bg-light);
    color: var(--primary-color);
}

.time-preset-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-accent);
}

.custom-range {
    background: var(--bg-surface);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-default);
}

.custom-range label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-size: 0.9rem;
}

.range-inputs span {
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-apply {
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-apply:hover {
    background: var(--primary-hover);
}

/* Generation Tree */
.generation-tree {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.generation-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.generation-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    background: var(--info-bg-light);
    border-radius: 4px;
    text-align: center;
}

.generation-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}

.generation-member {
    cursor: pointer;
    transition: all 0.2s;
}

.member-mini-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.generation-member:hover .member-mini-avatar {
    background: var(--primary-color);
    color: var(--text-on-accent);
    transform: scale(1.1);
}

.generation-member.selected .member-mini-avatar {
    background: var(--gradient-primary);
    color: var(--text-on-accent);
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px var(--primary-bg-medium);
}

/* Timeline Tools */
.timeline-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.tool-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.tool-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-bg-light);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.tool-btn i {
    font-size: 0.9rem;
}

/* Filters */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filter-group {
    display: flex;
    align-items: center;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.filter-checkbox:hover {
    color: var(--primary-color);
}

/* Loading and Empty States */
.loading-placeholder,
.empty-state,
.error-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.loading-placeholder::before {
    content: "⏳ ";
    margin-right: 0.5rem;
}

.empty-state::before {
    content: "👥 ";
    margin-right: 0.5rem;
}

.error-state {
    color: var(--error);
}

.error-state::before {
    content: "⚠️ ";
    margin-right: 0.5rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: var(--text-on-accent);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    z-index: 1500;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-navigation {
        padding: 1rem;
    }
    
    .nav-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .view-mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .member-grid {
        grid-template-columns: 1fr;
        max-height: 200px;
    }
    
    .member-card {
        padding: 0.8rem;
    }
    
    .member-avatar {
        width: 40px;
        height: 40px;
    }
    
    .time-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .range-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .range-inputs span {
        display: none;
    }
    
    .timeline-tools {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .generation-members {
        justify-content: flex-start;
    }
    
    .filter-options {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .view-mode-btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
    
    .time-presets {
        grid-template-columns: 1fr;
    }
    
    .timeline-tools {
        grid-template-columns: 1fr;
    }
    
    .tool-btn {
        font-size: 0.7rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Custom Scrollbar */
.member-grid::-webkit-scrollbar,
.generation-tree::-webkit-scrollbar {
    width: 6px;
}

.member-grid::-webkit-scrollbar-track,
.generation-tree::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 3px;
}

.member-grid::-webkit-scrollbar-thumb,
.generation-tree::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.member-grid::-webkit-scrollbar-thumb:hover,
.generation-tree::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Animation */
.timeline-navigation {
    animation: fadeInUp 0.4s ease-out;
}

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

.member-card,
.generation-member {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}/* From timeline-story-integration.css */
/* Timeline-Story Integration Component Styles */

.timeline-story-integration {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.integration-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-on-accent);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.integration-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-on-accent);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.integration-content {
    min-height: 400px;
    position: relative;
}

.integration-panel {
    display: none;
    padding: 1.5rem;
}

.integration-panel.active {
    display: block;
}

/* Timeline Events */
.timeline-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-event-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: #fafbfc;
    transition: all 0.2s;
}

.timeline-event-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.event-date {
    background: var(--link);
    color: var(--text-on-accent);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.event-content {
    flex: 1;
}

.event-content h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.event-content p {
    margin: 0 0 0.5rem 0;
    color: #5a6c7d;
    line-height: 1.4;
}

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

.event-type {
    background: #e8f4f8;
    color: #2980b9;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.verified-badge {
    background: #d5edda;
    color: #155724;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.event-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.story-card {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    transition: all 0.2s;
}

.story-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.story-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.story-header h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.story-content {
    padding: 1rem;
}

.story-content p {
    margin: 0;
    color: #5a6c7d;
    line-height: 1.5;
}

.story-people {
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.person-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.story-actions {
    padding: 1rem;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 0.5rem;
}

/* Connections */
.connections-graph {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.connection-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: #fafbfc;
}

.connection-source,
.connection-target {
    text-align: center;
}

.connection-type {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.connection-source h5,
.connection-target h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.connection-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.connection-strength {
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s;
}

.connection-label {
    font-size: 0.8rem;
    color: var(--link);
    font-weight: 600;
    text-transform: capitalize;
}

/* Actions */
.integration-actions {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-small {
    background: var(--link);
    color: var(--text-on-accent);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Loading and Empty States */
.loading-placeholder,
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    font-style: italic;
}

.loading-placeholder::before {
    content: "⏳ ";
    margin-right: 0.5rem;
}

.empty-state::before {
    content: "📝 ";
    margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .integration-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .toggle-btn {
        flex: 1;
    }
    
    .timeline-event-card {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .event-date {
        align-self: flex-start;
        min-width: auto;
    }
    
    .stories-list {
        grid-template-columns: 1fr;
    }
    
    .connection-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .connection-link {
        order: -1;
        min-width: auto;
        width: 100%;
    }
    
    .integration-actions {
        flex-direction: column;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.integration-panel.active {
    animation: fadeIn 0.3s ease-out;
}

.timeline-event-card,
.story-card,
.connection-item {
    animation: fadeIn 0.3s ease-out;
}

/* Custom scrollbar for long lists */
.timeline-events-list::-webkit-scrollbar,
.stories-list::-webkit-scrollbar {
    width: 6px;
}

.timeline-events-list::-webkit-scrollbar-track,
.stories-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.timeline-events-list::-webkit-scrollbar-thumb,
.stories-list::-webkit-scrollbar-thumb {
    background: var(--link);
    border-radius: 3px;
}

.timeline-events-list::-webkit-scrollbar-thumb:hover,
.stories-list::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}/* From member-timeline.css */
/* Member Timeline Styles */

.member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

.member-info {
    flex: 1;
    text-align: center;
}

.member-info h1 {
    margin: 0;
    font-size: 2.5rem;
    color: var(--primary-color);
}

.member-dates {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.member-dates span {
    margin: 0 1rem;
}

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

/* Timeline Container */
.timeline-container {
    margin: 2rem 0;
}

.timeline-controls {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
}

.timeline-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Timeline Display */
.timeline-display {
    position: relative;
    padding: 2rem 0;
    min-height: 400px;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-default);
    transform: translateX(-50%);
}

/* Phase Cards */
.phases-container {
    position: relative;
}

.phase-card {
    position: relative;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    width: calc(50% - 3rem);
    overflow: hidden;
}

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

.phase-card.expanded {
    width: calc(60% - 3rem);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

/* Phase card hover effect */
.phase-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.phase-card:hover::before,
.phase-card.expanded::before {
    transform: scaleX(1);
}

.phase-card.left {
    margin-right: auto;
    margin-left: 0;
    text-align: right;
}

.phase-card.right {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
}

/* Phase connector line */
.phase-connector {
    position: absolute;
    top: 50%;
    width: 2rem;
    height: 2px;
    background: var(--border-default);
}

.phase-card.left .phase-connector {
    right: -2rem;
}

.phase-card.right .phase-connector {
    left: -2rem;
}

/* Phase marker */
.phase-card::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
}

.phase-card.left::after {
    right: -2.75rem;
}

.phase-card.right::after {
    left: -2.75rem;
}

/* Phase content */
.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.phase-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.phase-dates {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.phase-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--info-bg-light);
    color: var(--info-hover);
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.phase-description {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0.5rem 0;
}

.phase-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.phase-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.verified-badge {
    color: var(--success);
    font-weight: 600;
}

.auto-generated-badge {
    color: var(--warning);
    font-size: 0.8rem;
}

/* Expandable details */
.phase-expanded-content {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    animation: slideDown 0.3s ease;
}

.phase-card.expanded .phase-expanded-content {
    display: block;
}

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

.phase-milestone-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.phase-milestone-item {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.phase-milestone-item::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Interactive timeline elements */
.timeline-year-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    z-index: 5;
}

/* Phase type badges with icons */
.phase-type-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
}


/* CV Upload Styles */
.cv-upload-area {
    padding: 1rem 0;
}

.upload-zone {
    border: 2px dashed var(--border-default);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-surface);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--bg-card);
}

.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--info-bg-light);
}

.upload-zone p {
    margin: 1rem 0 0;
    color: var(--text-secondary);
}

.upload-zone .file-types {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 4px;
    margin: 1rem 0;
}

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

.file-preview span {
    flex: 1;
    font-weight: 500;
}

/* CV Analysis Results */
.cv-results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.cv-results h3 {
    margin-bottom: 1rem;
}

.analysis-phase {
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--bg-card);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.analysis-phase h4 {
    margin: 0 0 0.5rem;
    color: var(--primary-color);
}

.analysis-phase .dates {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.analysis-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--info-bg-light);
    border-radius: 4px;
}

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

.analysis-stat .number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.analysis-stat .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.loading-content {
    text-align: center;
}

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

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

.loading-message {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success {
    border-left: 4px solid var(--success);
}

.toast-notification.error {
    border-left: 4px solid var(--error);
}

.toast-notification i {
    font-size: 20px;
}

.toast-notification.success i {
    color: var(--success);
}

.toast-notification.error i {
    color: var(--error);
}

.toast-action {
    margin-left: 10px;
    padding: 5px 10px;
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.toast-action:hover {
    background: var(--primary-dark);
}

/* Modal Error Messages */
.modal-error {
    background: var(--error-bg-light);
    color: var(--error-dark);
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Career and Education Details */
.career-details,
.education-details {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--bg-surface);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.career-position,
.education-degree {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.career-company,
.education-institution {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.career-location,
.education-field {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.career-achievements {
    margin: 0.5rem 0 0 1rem;
    padding-left: 1rem;
    font-size: 0.9rem;
}

.career-achievements li {
    margin: 0.25rem 0;
}

.education-honors {
    margin-top: 0.5rem;
    color: var(--warning-dark);
    font-weight: 500;
}

/* CV Source Badge */
.cv-source-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 8px;
    background: var(--info-bg-light);
    color: var(--info-hover);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    vertical-align: middle;
}

/* Auto-generated badge styling */
.auto-generated-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 8px;
    background: var(--warning-bg-light);
    color: var(--warning-dark);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    vertical-align: middle;
}

/* Phase Type Colors - kept as fallback values */
:root {
  --phase-early-childhood-bg: #ffebee;
  --phase-early-childhood-color: #c62828;
  --phase-childhood-bg: #fce4ec;
  --phase-childhood-color: #ad1457;
  --phase-adolescence-bg: #f3e5f5;
  --phase-adolescence-color: #6a1b9a;
  --phase-young-adult-bg: #ede7f6;
  --phase-young-adult-color: #4527a0;
  --phase-education-bg: #e8eaf6;
  --phase-education-color: #283593;
  --phase-career-bg: #e3f2fd;
  --phase-career-color: #1565c0;
  --phase-family-bg: #e0f2f1;
  --phase-family-color: #00695c;
  --phase-transitions-bg: #f9fbe7;
  --phase-transitions-color: #827717;
  --phase-later-life-bg: #fff3e0;
  --phase-later-life-color: #e65100;
  --phase-custom-color: var(--text-primary);
}

.phase-type.early_childhood { background-color: var(--phase-early-childhood-bg); color: var(--phase-early-childhood-color); }
.phase-type.childhood { background-color: var(--phase-childhood-bg); color: var(--phase-childhood-color); }
.phase-type.adolescence { background-color: var(--phase-adolescence-bg); color: var(--phase-adolescence-color); }
.phase-type.young_adult { background-color: var(--phase-young-adult-bg); color: var(--phase-young-adult-color); }
.phase-type.education_journey { background-color: var(--phase-education-bg); color: var(--phase-education-color); }
.phase-type.career_progression { background-color: var(--phase-career-bg); color: var(--phase-career-color); }
.phase-type.family_formation { background-color: var(--phase-family-bg); color: var(--phase-family-color); }
.phase-type.life_transitions { background-color: var(--phase-transitions-bg); color: var(--phase-transitions-color); }
.phase-type.later_life { background-color: var(--phase-later-life-bg); color: var(--phase-later-life-color); }
.phase-type.custom { background-color: var(--bg-card); color: var(--phase-custom-color); }
/* Gallery Feature */
/* Gallery Page Styles */

.gallery-main {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    background-color: var(--bg-color);
}

.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-header h2 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.gallery-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

/* Gallery Controls */
.gallery-controls {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Media Filter Cards */
.media-filter-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--primary-color);
    opacity: 0.1;
    transition: width 0.3s ease;
}

.filter-card:hover::before {
    width: 100%;
}

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

.filter-card.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.filter-card.active .card-icon {
    color: var(--white);
}

.filter-card.active .count {
    background-color: var(--border-light);
    color: var(--white);
}

.card-icon {
    font-size: 2rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.card-content {
    flex: 1;
}

.card-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.filter-card .count {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range input {
    flex: 1;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* View Options */
.view-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

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

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

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

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

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-weight: 500;
    color: var(--text-color);
}

/* Gallery Stats */
.gallery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

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

/* Grid View */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeIn 0.5s ease-in-out;
}

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

.gallery-item {
    background-color: var(--white);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 60%, var(--shadow-color-lighter) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item-media {
    position: relative;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background-color: var(--bg-color);
}

.gallery-item-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-media .media-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--text-light);
}

.media-type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--overlay-dark);
    color: var(--white);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Gallery action buttons container */
.gallery-action-buttons {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-action-buttons {
    opacity: 1;
}

/* Report button */
.gallery-item-media .report-btn {
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background-color: var(--bg-card-alpha);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

/* Small button styles */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Danger button */
.btn-danger {
    background-color: var(--error-color);
    color: var(--white);
    border-color: var(--error-color);
}

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

/* Outline danger button */
.btn-outline-danger {
    background-color: transparent;
    color: var(--error-color);
    border-color: var(--error-color);
}

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


.gallery-item-media .report-btn:hover {
    background-color: var(--error-color);
    color: var(--text-on-accent);
}

.gallery-item-content {
    padding: 1rem;
}

.gallery-item-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* List View */
.gallery-list {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 3rem;
}

.gallery-table {
    width: 100%;
    border-collapse: collapse;
}

.gallery-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.gallery-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.table-preview {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.table-preview-icon {
    width: 60px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border-radius: 0.25rem;
    font-size: 1.5rem;
    color: var(--text-light);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

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

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 4rem;
}

.gallery-loading .spinner {
    margin: 0 auto 1rem;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.gallery-empty p {
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-btn {
    min-width: 40px;
}

.pagination .page-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .page-info {
    padding: 0 1rem;
    color: var(--text-light);
}

/* Document Viewer Styles */
.pdf-viewer,
.docx-viewer {
    background-color: var(--bg-hover);
    padding: 1rem;
    border-radius: 0.5rem;
}

.document-preview {
    text-align: center;
    padding: 2rem;
}

.document-icon-large {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.file-extension {
    position: absolute;
    bottom: 0;
    right: -10px;
    background-color: var(--primary-color);
    color: var(--text-on-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: bold;
}

.document-content-preview {
    background-color: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.document-content-preview h5 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-text {
    color: var(--text-light);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Audio Player Styles */
.audio-player {
    text-align: center;
    padding: 2rem;
}

.audio-header {
    margin-bottom: 1.5rem;
}

.audio-header h4 {
    color: var(--text-color);
    margin-top: 1rem;
}

.transcription-section {
    background-color: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.transcription-section h5 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confidence-badge {
    background-color: var(--success-color);
    color: var(--text-on-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: normal;
    margin-left: auto;
}

.transcription-text {
    color: var(--text-light);
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.transcription-placeholder {
    background-color: var(--bg-hover);
    border: 2px dashed var(--border-default);
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
}

.audio-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Face Recognition Styles */
.face-recognition-section {
    padding: 1.5rem;
    background-color: var(--border-light);
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.face-recognition-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.face-recognition-status {
    padding: 1rem;
    background-color: var(--overlay-light);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.face-recognition-status .status-message {
    color: var(--text-on-dark);
    margin: 0;
}

.face-recognition-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.face-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

.detected-faces-list {
    display: grid;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.face-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--border-light);
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.face-item:hover {
    background-color: var(--border-light);
}

.face-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.face-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-light);
}

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

.face-details h5 {
    color: var(--white);
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
}

.face-confidence {
    color: var(--text-on-dark);
    font-size: 0.8rem;
}

.face-actions {
    display: flex;
    gap: 0.5rem;
}

.face-actions .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Lightbox */
@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--overlay-darker);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: lightboxFadeIn 0.3s ease-out;
}

.lightbox-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1200px;
}

.lightbox-close {
    position: absolute;
    right: 2rem;
    top: 1rem;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--white);
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

.lightbox-header {
    background-color: var(--border-light);
    padding: 1rem 2rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.lightbox-header h3 {
    color: var(--white);
    margin: 0;
}

.lightbox-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    background-color: var(--border-light);
    padding: 2rem;
    border-radius: 0 0 0.5rem 0.5rem;
}

.lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-media .audio-player {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 400px;
}

.lightbox-media .document-preview {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
}

.lightbox-details {
    background-color: var(--border-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
    color: var(--white);
}

.lightbox-details .detail-row {
    margin-bottom: 1rem;
}

.lightbox-details .detail-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.lightbox-details .detail-value {
    color: var(--text-on-dark);
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.lightbox-navigation button {
    background-color: var(--overlay-dark);
    border: none;
    color: var(--white);
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.15s ease-in-out;
}

.lightbox-navigation button:hover {
    background-color: var(--overlay-darker);
}

.lightbox-navigation button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 968px) {
    .lightbox-body {
        grid-template-columns: 1fr;
    }
    
    .lightbox-details {
        order: 2;
    }
    
    .media-filter-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .view-options {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .gallery-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lightbox-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .lightbox-navigation {
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-table {
        font-size: 0.875rem;
    }
    
    .gallery-table th,
    .gallery-table td {
        padding: 0.5rem;
    }
    
    .table-preview {
        width: 40px;
        height: 30px;
    }
    
    .media-filter-cards {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .filter-card {
        padding: 1rem;
    }
    
    .card-icon {
        font-size: 1.5rem;
    }
}/* Carousel Component Styles with Theme Support */

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-wrapper {
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: var(--carousel-gap, 20px);
}

.carousel-item {
    flex: 0 0 auto;
    width: 100%;
    min-height: 100px;
}

/* Carousel Navigation Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 2px solid var(--border-default);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.9;
    z-index: 2;
    box-shadow: var(--shadow);
}

.carousel-arrow:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-arrow:disabled:hover {
    background-color: var(--bg-card);
    color: var(--text-primary);
    transform: translateY(-50%);
}

.carousel-arrow-prev {
    left: 10px;
}

.carousel-arrow-next {
    right: 10px;
}

.carousel-arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.carousel-dot:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

.carousel-dot.active {
    background-color: var(--primary);
    opacity: 1;
    width: 24px;
    border-radius: 4px;
}

/* Email Tips Carousel Specific */
.email-tips-carousel {
    position: relative;
    padding: 0 3rem;
}

.email-tips-carousel .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--text-on-accent);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.email-tips-carousel .carousel-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    background: var(--primary-dark);
}

.email-tips-carousel .carousel-nav.prev {
    left: 0.5rem;
}

.email-tips-carousel .carousel-nav.next {
    right: 0.5rem;
}

/* Tips Carousel Inner */
.tips-carousel-inner {
    overflow: hidden;
    position: relative;
}

.tip-slide {
    text-align: center;
    padding: 1rem;
}

.tip-slide i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.tip-slide p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .carousel-arrow {
        width: 32px;
        height: 32px;
    }
    
    .carousel-arrow svg {
        width: 16px;
        height: 16px;
    }
    
    .carousel-arrow-prev {
        left: 5px;
    }
    
    .carousel-arrow-next {
        right: 5px;
    }
    
    .carousel-dots {
        bottom: 10px;
    }
    
    .email-tips-carousel {
        padding: 0 2.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: none;
    }
    
    .carousel-arrow,
    .carousel-dot {
        transition: none;
    }
}/* Media Enhancement Comparison Styles */

.media-enhancement-comparison {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-surface);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.comparison-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
}

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

/* View Mode Selector */
.view-mode-selector {
  display: flex;
  background: var(--bg-surface);
  border-radius: 6px;
  padding: 2px;
}

.view-mode-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

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

.view-mode-btn.active {
  background: var(--link);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-sm);
}

/* Zoom Controls */
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 2px;
}

.zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.zoom-btn[data-action="fit"] {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  gap: 0.25rem;
}

.zoom-level {
  min-width: 45px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Content Area */
.comparison-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.comparison-viewer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.comparison-sidebar {
  width: 320px;
  background: var(--bg-card);
  border-left: 1px solid var(--bg-hover);
  overflow-y: auto;
  padding: 1.5rem;
}

/* No Media Message */
.no-media-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.no-media-message i {
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Image Comparison */
.image-comparison {
  display: flex;
  width: 100%;
  height: 100%;
}

.image-comparison.side-by-side {
  flex-direction: row;
}

.comparison-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.panel-header {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--overlay-dark);
  color: var(--text-on-accent);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10;
}

.image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.comparison-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.1s ease;
  cursor: grab;
}

.comparison-image:active {
  cursor: grabbing;
}

/* Split View */
.split-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.split-image-container {
  width: 100%;
  height: calc(100% - 40px);
  position: relative;
  overflow: hidden;
}

.split-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.enhanced-split {
  clip-path: inset(0 50% 0 0);
}

.split-line {
  position: absolute;
  top: 0;
  bottom: 40px;
  width: 2px;
  background: var(--link);
  cursor: ew-resize;
  z-index: 20;
}

.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--link);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-accent);
  box-shadow: var(--shadow);
}

.split-labels {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-overlay);
  border-top: 1px solid var(--bg-hover);
}

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

/* Overlay View */
.overlay-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.overlay-image-container {
  width: 100%;
  height: calc(100% - 60px);
  position: relative;
  overflow: hidden;
}

.overlay-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.overlay-image-top {
  transition: opacity 0.2s ease;
}

.overlay-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-overlay);
  border-top: 1px solid var(--bg-hover);
}

.overlay-controls label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.overlay-controls input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-hover);
  outline: none;
  -webkit-appearance: none;
}

.overlay-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--link);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* Audio Comparison */
.audio-comparison {
  flex-direction: column;
  padding: 2rem;
  gap: 2rem;
  overflow-y: auto;
}

.audio-panel {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.audio-player {
  width: 100%;
  margin: 1rem 0;
}

.waveform-container {
  height: 100px;
  background: var(--bg-surface);
  border-radius: 4px;
  position: relative;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
}

.transcription-content {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 4px;
  border-left: 4px solid var(--link);
  font-family: 'Georgia', serif;
  line-height: 1.6;
}

/* Document Comparison */
.document-comparison {
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
}

.document-panel {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.document-viewer {
  height: 400px;
  border: 1px solid var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.pdf-viewer {
  width: 100%;
  height: 100%;
  border: none;
}

.document-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.document-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg-surface);
}

.document-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--link);
  color: var(--text-on-accent);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.document-link:hover {
  background: var(--link-hover);
  color: var(--text-on-accent);
}

.extracted-text-content {
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--bg-hover);
}

.extracted-text-content pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Sidebar */
.enhancement-info,
.technical-details {
  margin-bottom: 2rem;
}

.enhancement-info h4,
.technical-details h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--link);
  padding-bottom: 0.5rem;
}

/* Enhancement List */
.enhancement-item {
  background: var(--bg-surface);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--text-secondary);
}

.enhancement-item.completed {
  border-left-color: var(--success);
}

.enhancement-item.processing {
  border-left-color: var(--warning);
}

.enhancement-item.failed {
  border-left-color: var(--error);
}

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

.enhancement-header h5 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.enhancement-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 600;
}

.enhancement-status.completed {
  background: var(--success-bg-light);
  color: var(--success-dark);
}

.enhancement-status.processing {
  background: var(--warning-bg-light);
  color: var(--warning-dark);
}

.enhancement-status.failed {
  background: var(--error-bg-light);
  color: var(--error-dark);
}

.enhancement-details {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.enhancement-details p {
  margin: 0.25rem 0;
}

.error-message {
  color: var(--error);
}

/* Technical Details */
.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

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

.detail-value {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: right;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--link);
  color: var(--text-on-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--link-hover);
}

.btn-success {
  background: var(--success);
  color: var(--text-on-accent);
}

.btn-success:hover:not(:disabled) {
  background: var(--success-dark);
}

.btn-info {
  background: var(--info-color);
  color: var(--text-on-accent);
}

.btn-info:hover:not(:disabled) {
  background: var(--info-dark);
}

/* Footer */
.comparison-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--bg-hover);
}

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

/* No Enhancement Message */
.no-enhancement-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
}

.no-enhancement-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.no-enhancement-message i {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-enhancement-message p {
  margin: 0;
  font-size: 1rem;
}

/* Error Message */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--error);
  padding: 2rem;
  text-align: center;
}

.error-message i {
  margin-bottom: 1rem;
  opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .comparison-content {
    flex-direction: column;
  }
  
  .comparison-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--bg-hover);
    max-height: 300px;
  }
  
  .comparison-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .comparison-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .view-mode-selector {
    justify-content: center;
  }
  
  .view-mode-btn {
    flex: 1;
    justify-content: center;
  }
  
  .audio-comparison,
  .document-comparison {
    padding: 1rem;
  }
  
  .split-labels {
    font-size: 0.75rem;
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .comparison-header {
    padding: 1rem;
  }
  
  .comparison-sidebar {
    padding: 1rem;
  }
  
  .view-mode-btn {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  
  .view-mode-btn i {
    display: none;
  }
  
  .zoom-controls {
    flex-wrap: wrap;
  }
  
  .panel-header {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}/* Family Tree Feature */
/* Family Tree Viewer Styles */
.family-tree-viewer {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  min-height: 600px;
  background: var(--bg-hover);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#family-tree-viewer {
  height: 100%;
}

/* Toolbar */
.family-tree-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
  gap: 1rem;
}

.view-controls,
.zoom-controls,
.tree-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-controls .btn {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.view-controls .btn.active {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border-color: var(--primary-color);
}

.zoom-controls {
  background: var(--bg-hover);
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
}

.zoom-controls .btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.zoom-level {
  min-width: 50px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Canvas Container */
.family-tree-canvas-container {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--bg-hover);
  background-image: 
    linear-gradient(0deg, transparent 24%, var(--overlay-light) 25%, var(--overlay-light) 26%, transparent 27%, transparent 74%, var(--overlay-light) 75%, var(--overlay-light) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, var(--overlay-light) 25%, var(--overlay-light) 26%, transparent 27%, transparent 74%, var(--overlay-light) 75%, var(--overlay-light) 76%, transparent 77%, transparent);
  background-size: 50px 50px;
  height: 600px;
  max-height: calc(100vh - 200px);
}

#family-tree-canvas {
  cursor: grab;
  min-width: 100%;
  min-height: 100%;
}

#family-tree-canvas:active {
  cursor: grabbing;
}

/* Member Details Panel */
.family-tree-details {
  position: absolute;
  right: 1rem;
  top: 5rem;
  width: 350px;
  max-height: calc(100% - 6rem);
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 10;
}

.member-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--primary-color);
  color: var(--text-on-accent);
}

.member-details-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.member-details-header .btn {
  background: transparent;
  border: none;
  color: var(--text-on-accent);
  font-size: 1.25rem;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.member-details-header .btn:hover {
  background: var(--bg-hover-alpha);
}

.member-details-content {
  padding: 1rem;
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
}

.member-photo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-hover);
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-info p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.member-info strong {
  color: var(--text-primary);
}

.member-biography {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-default);
}

.member-biography h4 {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.member-biography p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.member-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-default);
  flex-wrap: wrap;
}

.member-actions .btn {
  flex: 1;
  min-width: 100px;
}

/* Family Tree List View */
.family-tree-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.family-tree-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

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

.family-tree-card h3 {
  margin: 0 0 0.5rem;
  color: var(--primary-color);
}

.family-tree-card .tree-stats {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.family-tree-card .tree-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.family-tree-card .tree-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Import/Export Modal */
.gedcom-import-modal {
  max-width: 500px;
}

.gedcom-dropzone {
  border: 2px dashed var(--border-default);
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--bg-surface);
}

.gedcom-dropzone:hover {
  border-color: var(--primary-color);
  background: var(--bg-hover);
}

.gedcom-dropzone.dragover {
  border-color: var(--primary-color);
  background: var(--primary-bg-light);
}

.gedcom-dropzone i {
  font-size: 3rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.gedcom-dropzone p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.gedcom-dropzone .file-info {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 4px;
  display: none;
}

.gedcom-dropzone.has-file .file-info {
  display: block;
}

/* Relationship Modal */
.relationship-form {
  display: grid;
  gap: 1rem;
}

.relationship-form .form-group {
  display: grid;
  gap: 0.5rem;
}

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

.relationship-form select,
.relationship-form input {
  padding: 0.5rem;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 1rem;
}

.relationship-type-specific {
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: 4px;
  margin-top: 1rem;
}

/* Member Form */
.member-form {
  display: grid;
  gap: 1.5rem;
}

.member-form-section {
  padding: 1.5rem;
  background: var(--bg-surface);
  border-radius: 8px;
}

.member-form-section h4 {
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-size: 1.1rem;
}

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

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

/* Search Modal */
.family-tree-search {
  min-height: 400px;
}

.search-results {
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  padding: 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.search-result-item:hover {
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.search-result-item .member-name {
  font-weight: 500;
  color: var(--text-primary);
}

.search-result-item .member-dates {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .family-tree-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-controls,
  .zoom-controls,
  .tree-actions {
    justify-content: center;
  }
  
  .family-tree-details {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}/* Modern Family Tree Styles */

/* Page container - account for navbar */
.family-tree-page {
    padding-top: 70px; /* Account for fixed navbar */
    min-height: 100vh;
    background: var(--bg-primary, #f8f9fa);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--color-primary, #667eea) 0%, var(--color-primary-dark, #5a67d8) 100%);
    color: var(--text-on-accent);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Main Container */
.tree-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Tree Controls */
.tree-controls {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.view-btn {
    background: none;
    border: 1px solid var(--color-border, #e2e8f0);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.view-btn:hover {
    background: var(--color-surface, #f7fafc);
    border-color: var(--color-primary, #667eea);
}

.view-btn.active {
    background: var(--color-primary, #667eea);
    color: var(--text-on-accent);
    border-color: var(--color-primary, #667eea);
}

.tree-search {
    position: relative;
    flex: 0 1 300px;
}

.tree-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-secondary, #718096);
}

.tree-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.875rem;
}

.tree-search input:focus {
    outline: none;
    border-color: var(--color-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.page-help-button {
    background: none;
    border: 1px solid var(--color-border, #e2e8f0);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.page-help-button:hover {
    background: var(--color-surface, #f7fafc);
    border-color: var(--color-primary, #667eea);
}

/* Tree visualization container - full width */
.tree-visualization {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
    min-height: 600px; /* Base height, will expand dynamically */
    position: relative;
    overflow: visible; /* Allow scrolling instead of hiding */
}

/* Search highlighting */
.member-card {
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.member-card.search-match {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px var(--color-primary);
}


/* Export Modal */
.export-modal .export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.export-modal .export-option {
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-modal .export-option:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.export-modal .export-option i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    display: block;
}

.export-modal .export-option h3 {
    margin: 0.5rem 0;
    color: var(--color-text);
}

.export-modal .export-option p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Tree viewport - the visible area */
.tree-viewport {
    width: 100%;
    min-height: 600px; /* Base height */
    height: auto; /* Allow it to grow */
    overflow: auto; /* Enable scrolling */
    position: relative;
    cursor: grab;
}

/* Tree canvas - the scrollable/zoomable area */
.tree-canvas {
    position: relative; /* Changed from absolute for natural flow */
    transform-origin: center;
    padding: 200px; /* Padding around content */
    transition: transform 0.1s ease-out;
    min-width: 100%;
    width: max-content; /* Grow to fit content */
    height: auto; /* Grow with content */
    margin: 0 auto; /* Center horizontally */
}

/* Generation levels */
.generation {
    display: flex;
    justify-content: center;
    margin-bottom: 150px; /* Increased spacing between generations */
    position: relative;
}

.generation-groups {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping for large families */
    max-width: 1600px; /* Prevent too wide spreading */
}

/* Large sibling groups */
.sibling-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 800px; /* Limit width to force wrapping */
}

.sibling-group.large {
    /* For 5+ siblings, use tighter spacing */
    gap: 0.5rem;
}

.sibling-group.large .member-card {
    width: 140px; /* Slightly smaller cards */
}

/* Marriage groups */
.marriage-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
}

/* Multiple marriages container */
.multiple-marriages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Central person in multiple marriages */
.central-person {
    margin-bottom: 2rem;
    position: relative;
}

.central-person::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 1.5rem;
    background: var(--color-text-secondary);
}

/* Row of spouses */
.spouse-row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px;
}

.marriage-set {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.marriage-info {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 0.25rem;
    font-weight: 500;
}

.divorced-indicator {
    font-size: 0.65rem;
    color: #e53e3e;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.marriage-timeline {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 0.25rem;
}

.marriage-status {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    padding: 0 0.5rem;
    font-size: 0.65rem;
    color: var(--color-text-secondary);
}

.marriage-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #999;
    z-index: 0;
}

.marriage-line.divorced {
    background: #e53e3e;
    background-image: repeating-linear-gradient(
        90deg,
        #e53e3e,
        #e53e3e 5px,
        transparent 5px,
        transparent 10px
    );
}

.single-group {
    display: flex;
    gap: 2rem;
}

/* Member cards - Modern design with dates */
.member-card {
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 160px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* Complex person indicator */
.member-card.complex {
    border: 2px solid var(--color-primary);
}

.complexity-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--color-primary);
    color: var(--text-on-accent);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 3;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.member-card.selected {
    box-shadow: 0 8px 20px rgba(33,150,243,0.3);
    transform: translateY(-4px);
}

.member-card.male .member-header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.member-card.female .member-header {
    background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
}

.member-header {
    padding: 0.75rem;
    color: var(--text-on-accent);
    text-align: center;
}

.member-header i {
    font-size: 1.25rem;
}

.member-body {
    padding: 0.75rem;
    text-align: center;
}

.member-body h4 {
    margin: 0 0 0.25rem 0;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.member-body .dates {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

/* Connection lines */
.connections-overlay {
    z-index: 1;
    pointer-events: none;
}

.connections-overlay path {
    stroke: var(--color-text-secondary, #666);
    stroke-width: 2;
    fill: none;
    opacity: 0.8;
}

/* Dark mode fix for connection lines */
.theme-dark .connections-overlay path {
    stroke: var(--color-text-secondary, #9CA3AF);
}

/* Tree viewport and canvas - removed duplicate definitions that were breaking positioning */

/* Member Modal */
.member-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-white);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    position: relative;
    max-width: 450px;
    width: 90%;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0,0,0,0.1);
}

.modal-header {
    padding: 2rem;
    background: var(--color-background);
    text-align: center;
    position: relative;
}

.modal-header .gender-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-header .gender-icon.male {
    color: #2196F3;
}

.modal-header .gender-icon.female {
    color: #E91E63;
}

.modal-header h2 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 1.75rem;
}

.modal-body {
    padding: 2rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.detail-row i {
    width: 20px;
    text-align: center;
    color: var(--color-primary);
}

.modal-actions {
    padding: 0 2rem 2rem;
    display: flex;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-white);
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.zoom-level {
    padding: 0 1rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    min-width: 60px;
    text-align: center;
}

/* Loading state */
.tree-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 600px;
}

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

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

.tree-loading p {
    margin-top: 1rem;
    color: var(--color-text-secondary);
}

/* Empty state */
.tree-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 600px;
    text-align: center;
    padding: 2rem;
}

.tree-empty i {
    font-size: 4rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.tree-empty h3 {
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

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

/* Mobile styles */
@media (max-width: 768px) {
    .tree-visualization {
        min-height: 500px;
        border-radius: 0;
    }
    
    .tree-viewport {
        height: 500px;
    }
    
    .tree-canvas {
        padding: 50px;
    }
    
    /* Smaller cards on mobile */
    .member-card {
        width: 120px;
    }
    
    .member-header {
        padding: 0.5rem;
    }
    
    .member-header i {
        font-size: 1rem;
    }
    
    .member-body {
        padding: 0.5rem;
    }
    
    .member-body h4 {
        font-size: 0.8rem;
    }
    
    .member-body .dates {
        font-size: 0.65rem;
    }
    
    /* Adjust spacing */
    .generation {
        margin-bottom: 50px;
    }
    
    .generation-groups {
        gap: 1.5rem;
    }
    
    .single-group {
        gap: 1rem;
    }
    
    /* Zoom controls repositioned */
    .zoom-controls {
        bottom: 1rem;
        right: 1rem;
        padding: 0.25rem;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
    }
    
    .zoom-level {
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-header .gender-icon {
        font-size: 2.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-actions {
        padding: 0 1.5rem 1.5rem;
        flex-direction: column;
    }
}

/* Even smaller screens */
@media (max-width: 480px) {
    .tree-viewport {
        height: 400px;
    }
    
    .member-card {
        width: 100px;
    }
    
    .member-body h4 {
        font-size: 0.75rem;
    }
    
    .generation-groups {
        gap: 1rem;
    }
    
    .marriage-group {
        gap: 0.25rem;
    }
}

/* Touch-specific adjustments */
@media (hover: none) and (pointer: coarse) {
    .member-card:hover {
        transform: none;
    }
    
    .zoom-btn:hover {
        background: var(--color-white);
        color: inherit;
        border-color: var(--color-border);
    }
    
    /* Larger touch targets */
    .member-card {
        min-height: 80px;
    }
    
    .zoom-btn {
        width: 40px;
        height: 40px;
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
    }
}

/* Complex Person Modal Styles */
.complex-person-view {
    padding: 1.5rem;
}

.person-summary {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.relationship-section {
    margin-bottom: 2rem;
}

.relationship-section h3 {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.spouse-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spouse-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.timeline-marker {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: var(--text-on-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.spouse-info {
    flex: 1;
}

.spouse-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.marriage-dates {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status.married {
    background: #c6f6d5;
    color: #22543d;
}

.status.divorced {
    background: #fed7d7;
    color: #742a2a;
}

.status.separated {
    background: #feebc8;
    color: #744210;
}

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

.child-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: 8px;
    text-align: center;
}

.child-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.child-card strong {
    display: block;
    margin-bottom: 0.25rem;
}

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

/* Print styles */
@media print {
    .tree-viewport {
        height: auto;
        overflow: visible;
    }
    
    .zoom-controls {
        display: none;
    }
    
    .member-card {
        break-inside: avoid;
    }
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--color-primary, #667eea);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background: var(--color-primary-dark, #5a67d8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--color-text, #2d3748);
    border: 1px solid var(--color-border, #e2e8f0);
}

.btn-secondary:hover {
    background: var(--color-surface, #f7fafc);
    border-color: var(--color-primary, #667eea);
    color: var(--color-primary, #667eea);
}

/* Link Members Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-secondary, #718096);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-text, #2d3748);
}

.modal-body {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text, #2d3748);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tree-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .view-controls {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .tree-search {
        width: 100%;
    }
    
    .view-btn span {
        display: none;
    }
    
    .page-help-button span {
        display: none;
    }
    
    .modal-content {
        margin: 1rem;
    }
}/* Simple Family Tree Styles */
.simple-family-tree {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px var(--shadow-color, rgba(0, 0, 0, 0.1));
  margin-top: 2rem;
}

.tree-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-default);
}

.tree-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
}

.tree-content {
  font-family: 'Courier New', monospace;
  line-height: 1.8;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 4px;
  overflow-x: auto;
  min-height: 200px;
}

.tree-member {
  margin: 0.25rem 0;
}

.member-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}

.tree-connector {
  color: var(--text-muted);
  font-weight: normal;
}

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

.member-lifespan {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.member-spouse {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9em;
}

.member-children {
  margin-top: 0.25rem;
}

.marriage-info {
  color: var(--text-secondary);
  font-style: italic;
  margin: 0.25rem 0;
}

.marriage-marker {
  color: var(--text-muted);
}

.member-reference {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9em;
}

.tree-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
  .simple-family-tree {
    padding: 1rem;
  }
  
  .tree-content {
    font-size: 0.9rem;
    padding: 0.5rem;
  }
  
  .tree-actions {
    flex-direction: column;
  }
}

/* Print styles */
@media print {
  .simple-family-tree {
    box-shadow: none;
    border: 1px solid var(--border-subtle);
  }
  
  .tree-actions {
    display: none;
  }
  
  .tree-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }
}/* Admin Feature */
/* Admin Interface Styles */

/* CSS Variables for admin interface */
:root {
    --primary-color: var(--primary-color);
    --white: var(--white);
    --text-color: var(--text-primary);
    --text-light: var(--text-secondary);
    --shadow: var(--shadow);
}

/* Navbar base styles */
.navbar {
    background-color: var(--navbar-bg);
    padding: 0;
    box-shadow: var(--shadow);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    min-height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    margin: 0 2rem;
}

.nav-link {
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Admin-specific navbar styles */
.admin-navbar {
    background-color: var(--navbar-bg);
    border-bottom: 3px solid var(--primary-color);
}

.admin-navbar .nav-brand h1 {
    color: var(--navbar-text);
}

.admin-navbar .nav-link {
    color: var(--navbar-text);
    opacity: 0.8;
}

.admin-navbar .nav-link:hover,
.admin-navbar .nav-link.active {
    color: var(--navbar-text);
    opacity: 1;
    background-color: var(--navbar-hover);
}

.admin-badge {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 1rem;
}

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

/* Responsive navbar */
@media (max-width: 1024px) {
    .nav-menu {
        flex-wrap: wrap;
        margin: 0 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .admin-badge {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 0.5rem;
    }
    
    .nav-brand h1 {
        font-size: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        order: 3;
        margin: 0.5rem 0 0 0;
        gap: 2px;
    }
    
    .nav-actions {
        order: 2;
    }
}

/* Tenant Switcher */
.tenant-switcher {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.tenant-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tenant-selector label {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.tenant-dropdown {
    padding: 6px 12px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background-color: var(--text-primary);
    color: var(--text-on-dark);
    font-size: 14px;
    min-width: 200px;
}

.tenant-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background-color: var(--success-dark);
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: var(--text-on-accent);
}

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

.btn-danger {
    background-color: var(--error);
    color: var(--text-on-accent);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.admin-main {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    background-color: var(--bg-surface);
}

.admin-header {
    margin-bottom: 2rem;
}

.admin-header h2 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.admin-header p {
    color: var(--text-light);
}

/* Admin Sections */
.admin-section {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.section-header h3 {
    color: var(--text-color);
    margin: 0;
}

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

.stat-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Worker Status */
.worker-status {
    display: grid;
    gap: 1rem;
}

.worker-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.worker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.worker-icon.ready {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.worker-icon.processing {
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
}

.worker-icon.error {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

.worker-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
}

.worker-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.worker-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

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

.worker-stat-value {
    display: block;
    font-weight: 600;
    color: var(--text-color);
}

.worker-stat-label {
    display: block;
    color: var(--text-light);
    font-size: 0.75rem;
}

.worker-actions {
    display: flex;
    gap: 0.5rem;
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.user {
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
}

.activity-icon.content {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.activity-icon.system {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.activity-description {
    font-size: 0.875rem;
    color: var(--text-light);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

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

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

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

.health-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-hover);
}

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

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

.status-indicator.error {
    background-color: var(--error);
}

/* Family Members Page Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.controls-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-controls select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-card);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

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

.member-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.member-name {
    font-weight: 500;
    color: var(--text-color);
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.role-badge.role-owner {
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
}

.role-badge.role-admin {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
}

.role-badge.role-contributor {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.role-badge.role-viewer {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-active {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.status-badge.status-pending {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
}

.status-badge.status-inactive {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-dark);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.success-message {
    text-align: center;
    padding: 2rem;
}

.success-message i {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.invitation-link-box {
    margin-top: 1.5rem;
}

.copy-link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.copy-link-container input {
    flex: 1;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.page-number {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.page-number:hover {
    background-color: var(--bg-color);
}

.page-number.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-light);
}

.page-info {
    margin-left: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

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

/* Invitations Page Styles */
.status-badge.status-consumed {
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
}

.status-badge.status-expired {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.status-badge.status-revoked {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

.token-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.token-cell code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background-color: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.invitation-details {
    padding: 1rem 0;
}

.detail-row {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.detail-row strong {
    display: inline-block;
    min-width: 120px;
    color: var(--text-color);
}

.message-box {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
    white-space: pre-wrap;
}

.used-by-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.used-by-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.used-by-list li:last-child {
    border-bottom: none;
}

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

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

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

.btn-danger:hover {
    background-color: var(--error-dark);
}

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

.text-muted {
    color: var(--text-light);
    font-style: italic;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-card:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.action-icon {
    font-size: 2rem;
}

.action-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* User Management Styles */
.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th {
    text-align: left;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
}

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-status.active {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.user-status.inactive {
    background-color: var(--bg-hover);
    color: var(--text-secondary);
}

.user-status.locked {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

/* Content Management */
.content-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading .spinner {
    margin: 0 auto 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .worker-item {
        grid-template-columns: auto 1fr;
        gap: 0.5rem;
    }
    
    .worker-stats,
    .worker-actions {
        grid-column: 1 / -1;
    }
    
    .health-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-filters {
        flex-direction: column;
    }
}

/* Health indicators for system page */
.health-indicator {
    font-size: 20px;
    line-height: 1;
}

.health-indicator.healthy {
    color: var(--success-color);
}

.health-indicator.warning {
    color: var(--warning-color);
}

.health-indicator.error {
    color: var(--error);
}

/* Health cards */
.health-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 1.5rem;
}

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

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

.health-details {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Backup management styles */
.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tenant Privacy Defaults Styles */
.tenant-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.tenant-info h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.tenant-name {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0.5rem 0;
    font-weight: 600;
}

.tenant-stats {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tenant-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Privacy Settings Controls */
.setting-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.override-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.override-toggle input[type="checkbox"] {
    cursor: pointer;
}

.override-toggle:hover {
    color: var(--text-primary);
}

/* Badge styles for platform settings */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--text-primary);
}

.badge-info {
    background-color: var(--info-color);
    color: var(--text-on-accent);
}

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

.privacy-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
}

.privacy-stat-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.privacy-stat-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.privacy-stat-content {
    flex: 1;
}

.privacy-stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.privacy-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.privacy-stat-detail {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Floating alerts */
.floating-alert {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    z-index: 1000;
    max-width: 400px;
}

.floating-alert.alert-success {
    background: var(--success-color);
    color: var(--text-on-accent);
}

.floating-alert.alert-danger {
    background: var(--error);
    color: var(--text-on-accent);
}

.floating-alert.alert-warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

.floating-alert.alert-info {
    background: var(--info-color);
    color: var(--text-on-accent);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.backup-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.status-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.status-card p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.status-card code {
    font-size: 0.75rem;
    background: var(--bg-hover);
    padding: 2px 4px;
    border-radius: 3px;
}

.backup-operations {
    margin-top: 2rem;
}

.log-viewer {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.875rem;
}

.alert-warning {
    background-color: var(--warning-bg-light);
    border: 1px solid var(--warning-border);
    color: var(--warning-dark);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-dark);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-surface);
    padding: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal h3 {
    padding: 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.modal form {
    padding: 1.5rem;
}

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

.modal .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal .form-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}/* Retention Policies Admin Styles */

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

.stat-item {
    background: var(--bg-surface);
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.stat-item.warning {
    background: var(--warning-bg-light);
    border: 1px solid var(--warning-border);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.alert {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.alert-warning {
    background-color: var(--warning-bg-light);
    border: 1px solid var(--warning-border);
    color: var(--warning-dark);
}

.alert ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.policy-item {
    border: 1px solid var(--border-default);
    padding: 1rem;
    border-radius: 4px;
    background: var(--bg-card);
}

.policy-item label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.policy-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.policy-controls input[type="number"] {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
}

.policy-controls input[type="number"]:disabled {
    background-color: var(--bg-hover);
    cursor: not-allowed;
}

.policy-controls select {
    flex: 1;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background-color: var(--bg-card);
}

.policy-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.automation-settings {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.automation-settings h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.automation-settings label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.automation-settings input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--link);
    color: var(--text-on-accent);
}

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

.btn-secondary {
    background-color: var(--text-secondary);
    color: var(--text-on-accent);
}

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

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

.report-section {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 4px;
}

.report-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--link);
    padding-bottom: 0.5rem;
}

.report-section p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--error-border);
}

#tenantSelect {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--bg-card);
}/* Privacy Feature */
/* Privacy Unified Styles */
/* Generated: Sat 16 Aug 2025 10:21:29 NZST */
/* Privacy Dashboard Styles */
.privacy-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.privacy-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.privacy-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-default);
    padding-bottom: 0.5rem;
}

/* Privacy Summary */
.privacy-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.summary-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.summary-card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--bg-surface);
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Privacy Select */
.privacy-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--bg-surface);
}

/* Privacy Rules */
.privacy-rules-list {
    margin-top: 1rem;
}

.privacy-rule {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rule-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.rule-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.rule-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    color: var(--text-on-accent);
}

.badge.allow {
    background-color: var(--success-color);
}

.badge.deny {
    background-color: var(--error);
}

.badge.conditional {
    background-color: var(--warning-color);
    color: var(--text-primary);
}

.rule-actions {
    display: flex;
    gap: 0.5rem;
}

/* Privacy Groups */
.privacy-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.group-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 1.5rem;
}

.group-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.user-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.user-item {
    padding: 0.5rem;
    background: var(--bg-surface);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Visibility Settings */
.visibility-settings {
    margin-top: 1rem;
}

.visibility-settings h3 {
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.visibility-grid {
    display: grid;
    gap: 1rem;
}

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

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

/* Audit Logs */
.audit-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.audit-filters input,
.audit-filters select {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
}

.audit-logs {
    max-height: 400px;
    overflow-y: auto;
}

.audit-entry {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.audit-entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.audit-entry-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.audit-entry-details {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.audit-allowed {
    color: var(--success-color);
}

.audit-denied {
    color: var(--error);
}

/* GDPR Tools */
.gdpr-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.tool-card.danger {
    border-color: var(--error);
    background-color: var(--error-bg-light);
}

.tool-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-card p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Advanced Settings */
.advanced-settings {
    margin-top: 1rem;
}

.setting-row {
    padding: 1rem;
    border-bottom: 1px solid var(--border-default);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.setting-row input[type="checkbox"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
}

/* Activity Summary */
.activity-summary {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 20px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

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

.summary-note {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

/* Security Events */
.security-list {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 15px;
    min-height: 100px;
}

.security-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-event {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-default);
}

.security-event:last-child {
    border-bottom: none;
}

.security-event.login {
    border-left: 3px solid var(--success-color);
}

.security-event.settings_change {
    border-left: 3px solid var(--info-color);
}

.security-event.password_change,
.security-event.2fa_enabled {
    border-left: 3px solid var(--warning-color);
}

.security-event.failed_login,
.security-event.suspicious_activity {
    border-left: 3px solid var(--error);
}

.event-content {
    display: flex;
    align-items: flex-start;
    padding-left: 10px;
}

.event-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.event-details {
    flex: 1;
}

.event-description {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.event-meta {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.event-time {
    color: var(--text-muted);
}

.event-ip,
.event-location {
    color: var(--text-secondary);
}

/* Privacy Help Text */
.setting-help {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-left: 1.5rem;
}

/* Save Section */
.save-section {
    text-align: center;
    padding: 2rem;
}

/* Privacy Help Text */
.privacy-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Section Help Text */
.section-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Notification Settings */
.notification-settings {
    margin-top: 1rem;
}

/* Data Tools */
.data-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Save Status */
.save-status {
    margin-left: 1rem;
    font-size: 0.9rem;
}

/* Download Settings */
.download-settings {
    margin-top: 1rem;
}

.download-stat-summary {
    background: var(--primary-bg-light);
    border: 1px solid var(--primary-border);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.download-stat-summary p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.download-stat-summary strong {
    color: var(--text-primary);
    font-size: 1.2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-dark);
}

.modal-content {
    background-color: var(--bg-surface);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.modal-content.danger {
    border: 2px solid var(--error);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close:hover {
    color: var(--text-primary);
}

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

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-size: 1rem;
}

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

.warning-message {
    background: var(--error-bg-light);
    border: 1px solid var(--error-border);
    color: var(--error-dark);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--link);
    color: var(--text-on-accent);
}

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

.btn-danger {
    background-color: var(--error);
    color: var(--text-on-accent);
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .privacy-summary {
        grid-template-columns: 1fr;
    }
    
    .privacy-groups {
        grid-template-columns: 1fr;
    }
    
    .visibility-row {
        grid-template-columns: 1fr;
    }
    
    .audit-filters {
        flex-direction: column;
    }
    
    .gdpr-tools {
        grid-template-columns: 1fr;
    }
}/* Privacy Center Styles */

.privacy-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.privacy-status-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.status-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
}

.status-icon.status-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-icon.status-warning {
    background: var(--warning-bg);
    color: #856404;
}

.status-icon.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.status-content p {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: #0056b3;
}

/* Consent Management */
.consent-intro {
    margin-bottom: 25px;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 8px;
}

.consent-form {
    max-width: 800px;
}

.consent-categories {
    margin-bottom: 30px;
}

.consent-category {
    padding: 20px;
    margin-bottom: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.consent-category:hover {
    border-color: var(--border-default);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.consent-category.required {
    background: #f0f8ff;
    border-color: var(--border-default);
}

.consent-header {
    margin-bottom: 10px;
}

.consent-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.consent-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.consent-checkbox:disabled {
    cursor: not-allowed;
}

.consent-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #2c3e50;
}

.badge {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-required {
    background: #007bff;
    color: var(--text-on-accent);
}

.consent-description {
    margin: 8px 0 8px 30px;
    color: #6c757d;
    font-size: 0.9rem;
}

.consent-legal-basis {
    margin: 0 0 0 30px;
    color: #868e96;
    font-size: 0.85rem;
    font-style: italic;
}

.consent-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Data Rights */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.right-item {
    padding: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.right-item h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.right-item p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.btn-outline {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #007bff;
    color: #007bff;
    background: var(--bg-surface);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #007bff;
    color: var(--text-on-accent);
}

.btn-outline.btn-danger {
    border-color: var(--border-default);
    color: #dc3545;
}

.btn-outline.btn-danger:hover {
    background: #dc3545;
    color: var(--text-on-accent);
}

/* Privacy Settings */
.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.setting-label span {
    color: #495057;
}

.form-select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: var(--bg-surface);
    color: #495057;
    font-size: 0.9rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle-label span {
    color: #495057;
}

.toggle-input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #ced4da;
    border-radius: 24px;
    transition: background 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-surface);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-input:checked + .toggle-switch {
    background: #28a745;
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(24px);
}

.settings-actions {
    margin-top: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: var(--text-on-accent);
}

.btn-secondary:hover {
    background: #545b62;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .privacy-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .rights-grid {
        grid-template-columns: 1fr;
    }
    
    .consent-actions {
        flex-direction: column;
    }
    
    .consent-actions button {
        width: 100%;
    }
    
    .setting-label {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toggle-label {
        margin-top: 10px;
    }
}/* Privacy Settings Styles */

.settings-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--info-bg-light);
    border: 1px solid var(--info-border);
    border-radius: 8px;
    margin-bottom: 30px;
}

.settings-info-banner i {
    font-size: 24px;
    color: var(--info-dark);
    flex-shrink: 0;
}

.settings-info-banner p {
    margin: 5px 0 0 0;
    color: var(--info-dark);
    font-size: 0.9rem;
}

/* Setting Groups */
.setting-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-default);
    transition: all 0.2s ease;
}

.setting-item:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow);
}

.setting-item.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.setting-item.disabled .form-select,
.setting-item.disabled input {
    pointer-events: none;
    opacity: 0.7;
}

/* Setting Info */
.setting-info {
    flex: 1;
    margin-right: 20px;
}

.setting-info label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 1.05rem;
}

.setting-description {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Inheritance Indicator */
.inheritance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 4px 10px;
    background: var(--primary-bg-light);
    color: var(--primary-dark);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.inheritance-indicator i {
    font-size: 14px;
}

.inheritance-indicator.platform {
    background: var(--secondary-bg-light);
    color: var(--secondary-color);
}

.inheritance-indicator.overridden {
    background: var(--success-bg-light);
    color: var(--success-dark);
}

/* Form Controls */
.form-select {
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 150px;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; /* Default gray for off state */
    transition: .3s;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Theme-specific toggle styles */
.theme-light .toggle-slider {
    background-color: #ccc;
    border-color: rgba(0, 0, 0, 0.15);
}

.theme-dark .toggle-slider {
    background-color: #4a4a4a;
    border-color: rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-surface);
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50; /* Green for on state */
    border-color: var(--border-default);
}

/* Theme-specific checked state */
.theme-light .toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
    border-color: var(--border-default);
}

.theme-dark .toggle-switch input:checked + .toggle-slider {
    background-color: #66BB6A;
    border-color: var(--border-default);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Settings Actions */
.settings-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.settings-actions .btn {
    min-width: 150px;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-dark);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

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

/* Success Message */
.success-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background: var(--success-color);
    color: var(--text-on-accent);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .setting-info {
        margin-right: 0;
        width: 100%;
    }
    
    .form-select {
        width: 100%;
    }
    
    .toggle-switch {
        align-self: flex-end;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .settings-actions .btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .settings-actions,
    .toggle-switch {
        display: none;
    }
    
    .setting-item {
        break-inside: avoid;
    }
}/* Privacy Dashboard Styles */

.privacy-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Dashboard Sections */
.dashboard-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.dashboard-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Consent Overview */
.consent-status-card {
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    width: 48px;
    height: 48px;
    background: var(--success-color);
    color: var(--text-on-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.status-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.consent-details p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.consent-details span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Processing Preferences */
.preference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.preference-item {
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

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

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

.preference-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.preference-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-surface);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* GDPR Rights */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.right-card {
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

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

.right-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.right-card h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.right-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Data Retention */
.retention-options {
    display: grid;
    gap: 1rem;
}

.retention-option {
    display: block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retention-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-content {
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.retention-option:hover .option-content {
    border-color: var(--primary-light);
}

.retention-option input:checked + .option-content {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.option-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Audit Log */
.audit-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.summary-card h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}

.summary-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Rights Requests */
.requests-list {
    display: grid;
    gap: 1rem;
}

.request-item {
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.request-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.request-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.request-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.status-processing {
    background: var(--info-light);
    color: var(--info-dark);
}

.status-completed {
    background: var(--success-light);
    color: var(--success-dark);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-primary);
}

#modalContent form,
#consentRenewalForm {
    margin-top: 1.5rem;
}

#modalContent textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
}

.consent-purpose {
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.consent-purpose label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.consent-purpose input[type="checkbox"] {
    margin-top: 0.25rem;
}

.consent-purpose h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.consent-purpose p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-on-accent);
}

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

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Responsive */
@media (max-width: 768px) {
    .privacy-dashboard {
        padding: 1rem;
    }
    
    .dashboard-section {
        padding: 1.5rem;
    }
    
    .preference-grid {
        grid-template-columns: 1fr;
    }
    
    .rights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .consent-status-card {
        flex-direction: column;
        text-align: center;
    }
}/* Face Recognition Privacy Modal Styles */

#face-privacy-modal .modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.privacy-notice {
    background-color: var(--info-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--info);
}

.privacy-notice h3 {
    margin-top: 0;
    color: var(--info-hover);
}

.privacy-notice ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.privacy-settings-form {
    margin-bottom: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: 0.375rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.toggle-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-text {
    user-select: none;
}

.setting-description {
    margin: 0.5rem 0 0 1.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.face-settings-details {
    border-left: 3px solid var(--link);
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.face-settings-details .setting-group {
    background-color: var(--bg-surface);
}

.setting-group h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.setting-group label[for="face-data-retention"] {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: 0.375rem;
    background-color: var(--bg-card);
    font-size: 0.95rem;
}

.biometric-consent {
    background-color: var(--warning-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--warning);
    margin-bottom: 1rem;
}

.biometric-consent h3 {
    margin-top: 0;
    color: var(--warning-hover);
}

.biometric-consent ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.consent-checkbox {
    display: flex;
    align-items: flex-start;
    margin-top: 1rem;
    font-weight: 500;
}

.consent-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#delete-face-data {
    margin-left: auto;
}

#delete-face-data:hover {
    background-color: var(--error);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #face-privacy-modal .modal-content {
        max-width: 95%;
        margin: 2% auto;
    }
    
    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #delete-face-data {
        margin-left: 0;
        width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
}/* Notifications Feature */
/**
 * Notification Center Styles
 */

/* Notification Bell */
.notification-bell-container {
  position: relative;
  display: inline-block;
}

.notification-bell {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.notification-bell:hover {
  color: var(--text-primary);
}

.notification-bell svg {
  width: 24px;
  height: 24px;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ff4444;
  color: var(--text-on-accent);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Notification Dropdown */
.notification-dropdown {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 380px;
  max-height: 600px;
  background: var(--bg-surface);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.notification-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Header */
.notification-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.notification-actions {
  display: flex;
  gap: 8px;
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--link);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.mark-all-read:hover {
  background: var(--bg-hover);
}

.notification-settings {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.notification-settings:hover {
  background: var(--bg-hover);
}

.notification-settings svg {
  width: 20px;
  height: 20px;
}

/* Notification List */
.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.notification-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.notification-empty p {
  margin: 0;
  font-size: 16px;
}

/* Notification Items */
.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.notification-item:hover {
  background: #f8f9fa;
}

.notification-item.unread {
  background: #f0f7ff;
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--link);
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
  flex-shrink: 0;
}

.notification-icon.success {
  background: #e8f5e9;
}

.notification-icon.warning {
  background: #fff3e0;
}

.notification-icon.info {
  background: #e3f2fd;
}

.notification-icon.default {
  background: var(--bg-card);
}

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

.notification-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 14px;
}

.notification-message {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  color: var(--text-muted);
  font-size: 12px;
}

.notification-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  margin-left: 12px;
  transition: all 0.2s;
}

.notification-action:hover {
  background: var(--link);
  color: var(--text-on-accent);
}

.notification-action svg {
  width: 16px;
  height: 16px;
}

/* Notification Footer */
.notification-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.view-all {
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.view-all:hover {
  text-decoration: underline;
}

/* Notification Page */
.notifications-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.notifications-page h1 {
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.notifications-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--border-default);
}

.filter-btn.active {
  background: var(--link);
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.notifications-list-page {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-card {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s;
}

.notification-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.notification-card.unread {
  background: #f0f7ff;
  border-left: 3px solid #667eea;
}

/* Vouch Request Modal */
.vouch-request-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.vouch-request-content {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
}

.vouch-request-content h2 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.voucher-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 1rem 0;
}

.voucher-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

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

.voucher-item.selected {
  background: #e3f2fd;
  border: 2px solid #667eea;
}

.voucher-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
  object-fit: cover;
}

.voucher-info {
  flex: 1;
}

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

.voucher-score {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.vouch-message {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  resize: vertical;
  min-height: 100px;
  margin: 1rem 0;
}

.vouch-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.vouch-actions button {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.vouch-cancel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.vouch-cancel:hover {
  background: var(--bg-hover);
}

.vouch-send {
  background: var(--link);
  border: none;
  color: var(--text-on-accent);
}

.vouch-send:hover {
  background: #5568d3;
}

.vouch-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .notification-dropdown {
    width: calc(100vw - 20px);
    right: 10px;
    left: 10px;
  }
  
  .notification-list {
    max-height: 60vh;
  }
}

/* Animation for new notifications */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideInRight 0.3s ease;
  z-index: 3000;
  max-width: 350px;
}

.notification-toast.success {
  border-left: 4px solid #4CAF50;
}

.notification-toast.error {
  border-left: 4px solid #f44336;
}

.notification-toast.info {
  border-left: 4px solid #2196F3;
}/* Notification Bell */
.notification-bell-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.notification-bell:hover {
  background: var(--bg-surface);
  transform: scale(1.05);
}

.notification-bell.active {
  background: var(--link);
  color: var(--text-on-accent);
  border-color: var(--link);
}

.notification-bell.has-notifications {
  animation: bell-shake 0.5s ease-in-out;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Notification Panel */
.notification-panel {
  position: fixed;
  width: 380px;
  max-height: 80vh;
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.notification-panel.top-right {
  top: 80px;
  right: 20px;
}

.notification-panel.top-left {
  top: 80px;
  left: 20px;
}

.notification-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.notification-actions {
  display: flex;
  gap: 8px;
}

.notification-actions button {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.notification-actions button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.notification-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.notification-empty p {
  margin: 0;
  font-size: 14px;
}

.notification-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  gap: 12px;
  position: relative;
}

.notification-item:hover {
  background: var(--bg-surface);
}

.notification-item.unread {
  background: var(--primary-bg-light);
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--link);
  flex-shrink: 0;
}

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

.notification-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 12px;
  color: var(--text-muted);
}

.notification-unread-dot {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 8px;
  height: 8px;
  background: var(--link);
  border-radius: 50%;
}

.notification-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  text-align: center;
}

.view-all-notifications {
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.view-all-notifications:hover {
  text-decoration: underline;
}

/* Notification Toasts */
.notification-toasts {
  position: fixed;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.notification-toasts.top-right {
  top: 20px;
  right: 20px;
}

.notification-toasts.top-left {
  top: 20px;
  left: 20px;
}

.notification-toasts.bottom-right {
  bottom: 20px;
  right: 20px;
}

.notification-toasts.bottom-left {
  bottom: 20px;
  left: 20px;
}

.notification-toast {
  background: var(--text-primary);
  color: var(--text-on-accent);
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s;
  cursor: pointer;
  pointer-events: all;
}

.notification-toasts.top-left .notification-toast,
.notification-toasts.bottom-left .notification-toast {
  transform: translateX(-100%);
}

.notification-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-hover-alpha);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-on-accent);
  opacity: 0.7;
  cursor: pointer;
  padding: 4px;
  margin: -4px;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

/* Notification type specific colors */
.notification-item[data-type="mention"] .notification-icon {
  background: var(--primary-bg-light);
  color: var(--link);
}

.notification-item[data-type="comment_added"] .notification-icon {
  background: var(--success-bg-light);
  color: var(--success-color);
}

.notification-item[data-type="comment_replied"] .notification-icon {
  background: var(--secondary-bg-light);
  color: var(--secondary-color);
}

.notification-item[data-type="user_joined"] .notification-icon {
  background: var(--warning-bg-light);
  color: var(--warning-color);
}

.notification-item[data-type="contribution_shared"] .notification-icon {
  background: var(--accent-bg-light);
  color: var(--accent-color);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .notification-panel {
    width: calc(100vw - 40px);
    left: 20px !important;
    right: 20px !important;
  }
  
  .notification-toast {
    min-width: auto;
    max-width: calc(100vw - 40px);
  }
}/* Auth Utilities */
/* Landing Page Styles */

/* Commercial Information Section */
.commercial-info-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.commercial-info-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.commercial-info-card h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.commercial-info-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
}

.pricing-philosophy {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
}

.pricing-philosophy h3 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

.philosophy-points {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.philosophy-point {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.point-icon {
    font-size: 2rem;
    min-width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.philosophy-point h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.philosophy-point p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.pricing-button-container {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(82, 121, 111, 0.2);
}

.pricing-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #52796F;
    color: var(--text-on-accent);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pricing-preview-btn:hover {
    background: #2E5266;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(82, 121, 111, 0.3);
}

.pricing-preview-btn .btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.pricing-preview-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.stay-informed {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.stay-informed .btn-primary {
    font-size: 1.1rem;
    padding: 0.875rem 2rem;
    margin-top: 0.5rem;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 2rem;
    background: var(--bg-surface);
    max-width: 900px;
    margin: 0 auto;
}

.faq-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--bg-hover);
}

.faq-arrow {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 3rem 1rem;
    }
    
    .faq-section h2 {
        font-size: 2rem;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 1.25rem;
    }
    
    .faq-answer p {
        padding: 0 1.25rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .commercial-info-container {
        padding: 1rem;
    }
    
    .commercial-info-card,
    .pricing-philosophy {
        padding: 2rem 1.5rem;
    }
    
    .commercial-info-card h3 {
        font-size: 1.4rem;
    }
    
    .commercial-info-card p {
        font-size: 1rem;
    }
    
    .philosophy-point {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .point-icon {
        margin-bottom: 0.5rem;
    }
    
    .stay-informed {
        padding: 2rem 1.5rem;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    padding: 100px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero-background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 20% 50%, var(--text-primary) 1px, transparent 1px),
        radial-gradient(circle at 80% 50%, var(--text-primary) 1px, transparent 1px),
        radial-gradient(circle at 50% 20%, var(--text-primary) 1px, transparent 1px),
        radial-gradient(circle at 50% 80%, var(--text-primary) 1px, transparent 1px);
    background-size: 200px 200px;
    animation: float 20s ease-in-out infinite;
}

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

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
    white-space: normal;
    word-wrap: break-word;
}

.hero-value-props {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.value-prop-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-subtle);
    transition: transform 0.3s ease;
}

.value-prop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.value-icon {
    font-size: 1.5rem;
}

.hero-cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.hero-cta {
    padding: 1rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.hero-cta-secondary {
    padding: 1rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid var(--link);
    cursor: pointer;
    color: var(--link);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.hero-cta-secondary:hover {
    background: var(--link);
    color: var(--text-on-accent);
    transform: translateY(-2px);
}

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

/* Language-specific adjustments */
html[lang="de"] .hero-title {
    font-size: 3rem; /* Smaller to fit German text on one line */
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 20px 40px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    html[lang="de"] .hero-title {
        font-size: 1.9rem; /* Even smaller on mobile for German */
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-value-props {
        gap: 1rem;
    }
    
    .value-prop-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .hero-cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-cta, .hero-cta-secondary {
        width: 100%;
        max-width: 300px;
    }
}

.value-propositions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.value-prop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

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

.value-prop .icon {
    font-size: 1.5rem;
}

.cta-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 40px;
}

.primary-cta {
    background: var(--link);
    color: var(--white);
    padding: 18px 36px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    transform: translateY(0);
    display: inline-block;
}

.primary-cta:hover {
    background: var(--link-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.primary-cta:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

.primary-cta:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.primary-cta:disabled:hover {
    transform: translateY(0);
    background: var(--text-secondary);
}

.info-cta {
    background: var(--warning);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.info-cta:hover {
    background: var(--warning-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.info-cta svg {
    flex-shrink: 0;
}

.secondary-cta {
    color: var(--link);
    padding: 14px 28px;
    border: 2px solid var(--link);
    border-radius: 8px;
    text-decoration: none;
    background: transparent;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.secondary-cta:hover {
    background: var(--hover-overlay);
    border-color: var(--link-hover);
    color: var(--link-hover);
}

.secondary-cta svg {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(4px);
    }
    60% {
        transform: translateY(2px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: var(--shadow-lg);
    }
    50% {
        box-shadow: var(--shadow-lg);
    }
    100% {
        box-shadow: var(--shadow-lg);
    }
}

.primary-cta.pulse {
    animation: pulse 1s ease-in-out 2;
}

/* Comparison Section */
.comparison-section {
    background: var(--bg-surface);
    padding: 40px 20px;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
}

.comparison-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
}

.comparison-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.comparison-item p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.traditional {
    background: var(--error-bg);
    border: 2px solid var(--error);
}

.our-solution {
    background: var(--success-bg);
    border: 2px solid var(--success);
}

.vs-divider {
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.comparison-icon {
    font-size: 2rem;
}

/* How It Works Section */
.how-it-works-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.how-it-works-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
}

.feature-group {
    margin-bottom: 3rem;
}

.feature-group h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.feature-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-item.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.feature-item h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Privacy Section */
.privacy-section {
    background: var(--info-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 2rem;
}

.privacy-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.privacy-section p {
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Security Section */
.security-section {
    background: var(--info-bg);
    padding: 40px 20px;
    text-align: center;
}

.security-content {
    max-width: 600px;
    margin: 0 auto;
}

.security-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.security-content h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.security-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.security-technical {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Existing Users Section */
.existing-users-section {
    background: var(--bg-surface);
    padding: 40px 20px;
    text-align: center;
}

.existing-users-content {
    max-width: 600px;
    margin: 0 auto;
}

.existing-users-content h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.existing-users-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.existing-users-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-separator {
    color: var(--text-light);
    font-style: italic;
}

.btn-secondary {
    padding: 12px 24px;
    border: 2px solid var(--link);
    color: var(--link);
    background: transparent;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--link);
    color: var(--white);
    transform: translateY(-1px);
}

/* Footer */
.site-footer {
    background: var(--text-primary);
    color: var(--white);
    padding: 40px 20px 20px;
    margin-top: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--link);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--link);
}

.footer-bottom {
    border-top: 1px solid var(--border-default);
    padding-top: 1rem;
    text-align: center;
}

.footer-tagline {
    color: var(--text-light);
    font-style: italic;
    margin: 0 0 0.5rem 0;
}

.footer-copyright {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-links-inline {
    margin-left: 1rem;
}

.footer-links-inline a {
    color: var(--text-light);
    text-decoration: none;
}

.footer-links-inline a:hover {
    color: var(--link);
}

/* Carousel Sections */
.features-carousel-section {
    padding: 60px 20px;
    background: var(--bg-surface);
}

.privacy-carousel-section {
    padding: 60px 20px;
    background: var(--bg-card);
}

.how-carousel-section {
    padding: 60px 20px;
    background: var(--bg-surface);
}

.features-carousel-section h2,
.privacy-carousel-section h2,
.how-carousel-section h2,
.create-portal-section h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.carousel-slide h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.carousel-slide .feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.carousel-slide p {
    margin: 0 auto 1.5rem;
    max-width: 90%;
    line-height: 1.6;
}

.carousel-slide ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 90%;
    text-align: left;
}

.carousel-slide ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.carousel-slide ul li:last-child {
    border-bottom: none;
}

/* Ensure carousel content stays within bounds */
.carousel-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.carousel-slide {
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

/* Pricing Section */
.create-portal-section {
    padding: 60px 20px;
    background: var(--bg-card);
}

.price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--link);
    margin: 1rem 0;
}

.price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.storage {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 1.5rem 0;
}

.pricing-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.pricing-card ul li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.pricing-card button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

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

.pricing-card .btn-primary:hover {
    background: var(--link-hover);
}

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

.pricing-card .btn-secondary:hover {
    background: var(--text-light);
}

/* Existing Users Section Update */
.existing-users-section {
    background: var(--bg-surface);
    padding: 60px 20px;
    text-align: center;
}

.existing-users-section h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.existing-users-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--link);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 2px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--link);
    color: var(--link);
}

/* Privacy Modal Styles */
.privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-backdrop);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.privacy-modal-content {
    background: var(--bg-surface);
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.privacy-modal-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.privacy-modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.privacy-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.privacy-section {
    margin-bottom: 30px;
}

.privacy-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.privacy-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.privacy-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.privacy-section li {
    padding: 8px 0 8px 30px;
    position: relative;
    color: var(--text-secondary);
}

.privacy-section li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.privacy-warning {
    background: var(--warning-bg);
    border: 2px solid var(--warning);
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.privacy-warning h4 {
    color: var(--warning-hover);
    margin-bottom: 10px;
}

.privacy-warning ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.privacy-warning li {
    padding: 5px 0 5px 25px;
    position: relative;
}

.privacy-warning li:before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--error);
    font-weight: bold;
}

.privacy-commitment-form {
    background: var(--bg-surface);
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
}

.checkbox-container {
    display: flex;
    align-items: start;
    cursor: pointer;
    margin-bottom: 20px;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-container span {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

#proceed-to-register {
    background: var(--link);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

#proceed-to-register:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

#proceed-to-register:not(:disabled):hover {
    background: var(--link-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.learn-more-link {
    color: var(--link);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.learn-more-link:hover {
    text-decoration: underline;
}

/* Language Selector Improvements */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-surface);
    border: 2px solid var(--border-default);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--link);
    color: var(--link);
}

.lang-btn.active {
    background: var(--link);
    color: var(--white);
    border-color: var(--link);
}

/* Responsive Design - Enhanced Mobile Support */
@media (max-width: 768px) {
    /* Hero Section Mobile Optimization */
    .hero-section {
        padding: 60px 16px 40px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    /* Value Propositions Mobile */
    .value-propositions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .value-prop {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .value-prop .icon {
        font-size: 1.25rem;
    }
    
    /* Mission Statement Mobile */
    .mission-statement {
        padding: 2.5rem 1.25rem;
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    /* Carousel Mobile Optimization */
    .carousel-container {
        margin: 0 -8px;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        width: calc(100% + 16px);
        max-width: none;
    }
    
    .carousel-slide {
        padding: 1.5rem 1rem 2.5rem;
        min-height: auto;
    }
    
    .carousel-slide h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .carousel-slide .feature-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .carousel-slide p {
        font-size: 0.9rem;
        max-width: 100%;
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    
    .carousel-slide ul {
        font-size: 0.85rem;
        padding: 0;
        max-width: 100%;
    }
    
    .carousel-slide ul li {
        padding: 0.35rem 1rem;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* Carousel Navigation Mobile */
    .carousel-nav {
        bottom: 1rem;
        gap: 0.75rem;
    }
    
    .carousel-dot {
        width: 12px;
        height: 12px;
        cursor: pointer;
    }
    
    .carousel-arrows {
        display: none;
    }
    
    /* Comparison Section Mobile */
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .comparison-item {
        padding: 1.25rem;
    }
    
    .comparison-item h3 {
        font-size: 1.1rem;
    }
    
    .comparison-item p {
        font-size: 0.95rem;
    }
    
    .vs-divider {
        order: 0;
        font-size: 1.25rem;
        margin: 0.5rem 0;
    }
    
    /* Feature Grid Mobile */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-item {
        padding: 1.25rem;
    }
    
    .feature-item h4 {
        font-size: 1.1rem;
    }
    
    .feature-item p {
        font-size: 0.95rem;
    }
    
    /* CTA Section Mobile */
    .cta-section {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
        padding: 0 1rem;
    }
    
    .primary-cta {
        width: 100%;
        padding: 16px 24px;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    .info-cta {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .secondary-cta {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    /* Pricing Section Mobile */
    .create-portal-section {
        padding: 3rem 1rem;
    }
    
    .create-portal-section h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .pricing-card {
        padding: 1.75rem;
        margin: 0 auto;
        max-width: 320px;
        width: 100%;
    }
    
    .pricing-card h3 {
        font-size: 1.25rem;
    }
    
    .price {
        font-size: 2rem;
    }
    
    .price span {
        font-size: 0.9rem;
    }
    
    .storage {
        font-size: 1rem;
    }
    
    .pricing-card ul {
        font-size: 0.95rem;
    }
    
    .pricing-card button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Existing Users Section Mobile */
    .existing-users-section {
        padding: 3rem 1rem;
    }
    
    .existing-users-section h2 {
        font-size: 1.75rem;
    }
    
    .existing-users-actions {
        gap: 1rem;
    }
    
    .existing-users-actions .btn-primary,
    .existing-users-actions .btn-secondary {
        width: 100%;
        max-width: 300px;
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
    }
    
    /* Footer Mobile */
    .site-footer {
        padding: 2rem 1rem 1rem;
    }
    
    .footer-sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-links a {
        font-size: 0.95rem;
    }
    
    .footer-bottom {
        text-align: center;
        padding-top: 1.5rem;
    }
    
    .footer-tagline {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-copyright {
        font-size: 0.85rem;
    }
    
    .footer-links-inline {
        display: block;
        margin: 0.75rem 0 0 0;
        line-height: 2;
    }
    
    /* Language Selector Mobile */
    .language-selector {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 1001;
        background: var(--modal-backdrop);
        padding: 4px;
        border-radius: 8px;
        box-shadow: var(--shadow);
    }
    
    .lang-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Privacy Modal Mobile */
    .privacy-modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
    
    .privacy-modal-header {
        padding: 20px;
    }
    
    .privacy-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
    }
    
    .privacy-modal-body {
        padding: 20px;
    }
    
    .privacy-section h3 {
        font-size: 1.15rem;
    }
    
    .privacy-section p,
    .privacy-section li {
        font-size: 0.95rem;
    }
    
    .checkbox-container span {
        font-size: 1rem;
    }
    
    #proceed-to-register {
        font-size: 1.05rem;
        padding: 14px 24px;
    }
}

/* Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
    /* Hero Section Small Mobile */
    .hero-section {
        padding: 50px 15px 35px;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.35;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.45;
    }
    
    /* Value Props Small Mobile */
    .value-prop {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Mission Statement Small Mobile */
    .mission-statement {
        padding: 2rem 1rem;
        font-size: 1rem;
        line-height: 1.65;
    }
    
    /* Section Headings */
    .features-carousel-section h2,
    .privacy-carousel-section h2,
    .how-carousel-section h2,
    .create-portal-section h2,
    .existing-users-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    /* Carousel Small Mobile */
    .carousel-slide {
        padding: 1.75rem 1.25rem 2.5rem;
    }
    
    .carousel-slide h3 {
        font-size: 1.15rem;
    }
    
    .carousel-slide .feature-icon {
        font-size: 2rem;
    }
    
    .carousel-slide ul {
        font-size: 0.9rem;
    }
    
    /* Touch-friendly carousel dots */
    .carousel-dot {
        width: 14px;
        height: 14px;
        margin: 0 4px;
    }
    
    /* Pricing Cards Small Mobile */
    .pricing-card {
        padding: 1.5rem;
    }
    
    .pricing-card h3 {
        font-size: 1.15rem;
    }
    
    .price {
        font-size: 1.75rem;
    }
    
    .pricing-card ul {
        font-size: 0.9rem;
    }
    
    .pricing-card ul li {
        padding: 0.4rem 0;
    }
    
    /* Buttons Small Mobile */
    .primary-cta,
    .info-cta,
    .secondary-cta {
        font-size: 1rem;
        padding: 14px 20px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    /* Language Selector Small Mobile */
    .language-selector {
        top: 8px;
        right: 8px;
    }
    
    .lang-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Footer Small Mobile */
    .footer-links-inline {
        font-size: 0.85rem;
    }
    
    .footer-links-inline a {
        display: block;
        padding: 0.25rem 0;
    }
}

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

/* Focus states for accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

/* Additional Mobile Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    /* Touch-specific styles */
    .carousel-dot,
    .lang-btn,
    .btn-primary,
    .btn-secondary,
    button {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Increase touch targets */
    .carousel-dot {
        width: 16px;
        height: 16px;
        margin: 0 6px;
    }
    
    /* Remove hover effects on touch devices */
    .value-prop:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    .feature-item:hover {
        transform: none;
    }
    
    .pricing-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 20px 30px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .carousel-slide {
        padding: 1.5rem 2rem 2rem;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .pricing-card {
        padding: 1.25rem;
    }
}

/* High-Resolution Mobile Displays */
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 768px),
       (min-resolution: 192dpi) and (max-width: 768px) {
    /* Sharper shadows for retina displays */
    .value-prop,
    .feature-item,
    .carousel-container,
    .pricing-card {
        box-shadow: var(--shadow-sm);
    }
    
    /* Thinner borders for clarity */
    .pricing-card {
        border-width: 1px;
    }
}

/* Safe Area Support for Notched Devices */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .hero-section {
            padding-top: max(60px, env(safe-area-inset-top) + 40px);
        }
        
        .language-selector {
            top: max(12px, env(safe-area-inset-top));
            right: max(12px, env(safe-area-inset-right));
        }
        
        .site-footer {
            padding-bottom: max(1rem, env(safe-area-inset-bottom));
        }
    }
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    /* Hero Section Dark Mode */
    .hero-section {
        background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
        border-bottom: 1px solid var(--border-subtle);
    }
    
    .hero-title {
        color: var(--text-primary);
    }
    
    .hero-subtitle {
        color: var(--text-secondary);
    }
    
    /* Value Props Dark Mode */
    .value-prop {
        background: #1e1e1e;
        color: #e0e0e0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        border: 1px solid #333;
    }
    
    .value-prop:hover {
        background: #252525;
        box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    }
    
    /* Mission Statement Dark Mode */
    .mission-statement {
        color: #d0d0d0;
        background: #1a1a1a;
    }
    
    /* Carousel Dark Mode */
    .carousel-container {
        background: #1e1e1e;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border: 1px solid #333;
    }
    
    .carousel-slide {
        color: #e0e0e0;
    }
    
    .carousel-slide h3 {
        color: var(--text-on-accent);
    }
    
    .carousel-slide ul li {
        border-bottom-color: var(--text-primary);
        color: #d0d0d0;
    }
    
    .carousel-arrow {
        background: rgba(50, 50, 50, 0.9);
        color: #e0e0e0;
        border: 1px solid #444;
    }
    
    .carousel-arrow:hover {
        background: #333;
        border-color: var(--text-secondary);
    }
    
    .carousel-dot {
        background: #444;
    }
    
    .carousel-dot.active {
        background: #4a9eff;
    }
    
    /* Sections Dark Mode */
    .features-carousel-section,
    .privacy-carousel-section,
    .how-carousel-section {
        background: #1a1a1a;
    }
    
    .features-carousel-section h2,
    .privacy-carousel-section h2,
    .how-carousel-section h2,
    .create-portal-section h2,
    .existing-users-section h2 {
        color: var(--text-on-accent);
    }
    
    .privacy-carousel-section {
        background: #121212;
    }
    
    .create-portal-section {
        background: #121212;
    }
    
    /* Comparison Section Dark Mode */
    .comparison-section {
        background: #1a1a1a;
    }
    
    .comparison-item {
        color: #e0e0e0;
    }
    
    .comparison-item h3 {
        color: var(--text-on-accent);
    }
    
    .traditional {
        background: #2a1a1a;
        border-color: var(--border-default);
    }
    
    .our-solution {
        background: #1a2a1a;
        border-color: var(--border-default);
    }
    
    .vs-divider {
        color: var(--text-light);
    }
    
    /* Feature Items Dark Mode */
    .feature-item {
        background: #1e1e1e;
        color: #e0e0e0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        border: 1px solid #333;
    }
    
    .feature-item h4 {
        color: var(--text-on-accent);
    }
    
    .feature-item p {
        color: #b0b0b0;
    }
    
    /* Pricing Cards Dark Mode */
    .pricing-card {
        background: #1e1e1e;
        border: 2px solid #333;
        color: #e0e0e0;
    }
    
    .pricing-card:hover {
        border-color: var(--border-default);
        box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    }
    
    .pricing-card.recommended {
        border-color: var(--border-default);
    }
    
    .pricing-card.recommended::before {
        background: #4a9eff;
    }
    
    .pricing-card h3 {
        color: var(--text-on-accent);
    }
    
    .price {
        color: #4a9eff;
    }
    
    .price span {
        color: var(--text-light);
    }
    
    .storage {
        color: #b0b0b0;
    }
    
    .pricing-card ul li {
        color: #d0d0d0;
    }
    
    /* Buttons Dark Mode */
    .primary-cta,
    .btn-primary {
        background: #4a9eff;
        color: var(--text-on-accent);
    }
    
    .primary-cta:hover,
    .btn-primary:hover {
        background: #357abd;
    }
    
    .secondary-cta,
    .btn-secondary {
        background: transparent;
        color: #4a9eff;
        border-color: var(--border-default);
    }
    
    .secondary-cta:hover,
    .btn-secondary:hover {
        background: rgba(74, 158, 255, 0.1);
        color: #6ab3ff;
        border-color: var(--border-default);
    }
    
    .info-cta {
        background: #ff9800;
        color: var(--text-on-accent);
    }
    
    .info-cta:hover {
        background: #e68900;
    }
    
    /* Existing Users Section Dark Mode */
    .existing-users-section {
        background: #1a1a1a;
    }
    
    .existing-users-content p {
        color: #b0b0b0;
    }
    
    /* Footer Dark Mode */
    .site-footer {
        background: #0a0a0a;
        border-top: 1px solid #333;
    }
    
    .footer-section h3 {
        color: #4a9eff;
    }
    
    .footer-links a {
        color: #b0b0b0;
    }
    
    .footer-links a:hover {
        color: #4a9eff;
    }
    
    .footer-tagline {
        color: var(--text-muted);
    }
    
    .footer-copyright {
        color: var(--text-secondary);
    }
    
    .footer-links-inline a {
        color: var(--text-light);
    }
    
    .footer-links-inline a:hover {
        color: #4a9eff;
    }
    
    /* Language Selector Dark Mode - Use theme variables */
    .lang-btn {
        background: var(--bg-card-dark);
        color: var(--text-primary-dark);
        border-color: var(--border-default-dark);
    }
    
    .lang-btn:hover {
        border-color: var(--link-dark);
        color: var(--link-dark);
    }
    
    .lang-btn.active {
        background: var(--link-dark);
        color: var(--white);
        border-color: var(--link-dark);
    }
    
    /* Privacy Section Dark Mode */
    .privacy-section {
        background: #1e1e1e;
        border: 1px solid #333;
    }
    
    .privacy-section h3 {
        color: var(--text-on-accent);
    }
    
    .privacy-section p {
        color: #b0b0b0;
    }
    
    /* Security Section Dark Mode */
    .security-section {
        background: #1e1e1e;
    }
    
    .security-content h3 {
        color: var(--text-on-accent);
    }
    
    .security-content p {
        color: #b0b0b0;
    }
    
    .security-technical {
        color: var(--text-light);
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
    /* Fix section spacing */
    .features-carousel-section,
    .privacy-carousel-section,
    .how-carousel-section {
        padding: 45px 16px;
    }
    
    .orbital-section {
        padding: 2.5rem 1rem;
        background: var(--bg-surface);
    }
    
    /* Improve carousel readability */
    .carousel-slide ul {
        padding-left: 20px;
        font-size: 0.9rem;
        text-align: left;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .carousel-slide ul li {
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
    
    /* Fix carousel nav dots */
    .carousel-nav {
        bottom: 1rem;
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    /* Improve CTA buttons */
    .cta-container {
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    /* Fix create portal section */
    .create-portal-section {
        padding: 45px 16px;
        background: var(--bg-surface);
    }
}

@media (max-width: 480px) {
    /* Ultra-compact mobile */
    .features-carousel-section,
    .privacy-carousel-section,
    .how-carousel-section {
        padding: 35px 12px;
    }
    
    .orbital-section {
        padding: 2rem 0.75rem;
    }
    
    .orbital-section p {
        padding: 0 0.5rem;
    }
    
    /* Carousel fine-tuning */
    .carousel-container {
        margin: 0;
        width: 100%;
        border-radius: 12px;
    }
    
    .carousel-slide {
        padding: 1.5rem 1rem 2rem;
    }
    
    .carousel-slide ul {
        font-size: 0.85rem;
        padding-left: 18px;
    }
    
    /* Section headings */
    section h2 {
        font-size: 1.4rem !important;
        margin-bottom: 1.25rem;
        padding: 0 0.5rem;
    }
    
    /* Fix existing users section */
    .existing-users-section {
        padding: 35px 12px;
    }
}

/* Print styles */
@media print {
    .language-selector,
    .cta-section,
    .site-footer {
        display: none;
    }
    
    .hero-section {
        background: var(--bg-surface);
        color: var(--text-primary);
    }
    
    .feature-item {
        box-shadow: none;
        border: 1px solid var(--border-default);
    }
}/* Legal Pages Styling */

.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    background: var(--bg-surface);
}

.legal-header {
    text-align: center;
    padding: 2rem 0 1.5rem;
    background: var(--bg-surface);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.legal-header h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.legal-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.back-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--link-hover);
}

/* Content Sections */
.legal-content {
    background: var(--bg-surface);
    padding: 1.5rem !important;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.legal-section {
    margin-bottom: 1.5rem !important;
}

.legal-section:last-child {
    margin-bottom: 0;
}

.legal-section h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.8rem !important;
    margin-top: 0 !important;
    border-bottom: 2px solid var(--border-default);
    padding-bottom: 0.3rem;
}

.legal-section h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem !important;
    margin-top: 0.8rem !important;
}

.legal-section p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.7rem !important;
}

.legal-section ul,
.legal-section ol {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem !important;
}

.legal-section li {
    margin-bottom: 0.4rem !important;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Highlight Box */
.highlight-box {
    background: var(--primary-bg-light);
    border-left: 4px solid var(--link);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.highlight-box p {
    margin: 0;
    color: var(--text-primary);
}

/* Role Grid */
.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

.role-box {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.role-box h3 {
    color: var(--link);
    margin-bottom: 1rem;
}

.role-box ul {
    margin: 0;
    padding-left: 1.2rem;
}

.role-box li {
    margin-bottom: 0.5rem;
}

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

.implication-item {
    background: var(--primary-bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.implication-item h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.implication-item p {
    margin: 0;
    font-size: 0.95rem;
}

/* Contact Box */
.contact-box {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    margin: 1rem 0;
}

.contact-box p {
    margin-bottom: 0.3rem;
}

/* Footer Info */
.last-updated,
.version {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.version {
    margin-top: 0.5rem;
}

/* Version Tracking */
.version-info {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--link);
    margin-bottom: 2rem;
}

.version-info p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.version-number {
    font-weight: 600;
}

.version-history {
    margin: 1.5rem 0;
}

.version-entry {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--border-default);
}

.version-entry h4 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.version-entry ul {
    margin: 0;
    padding-left: 1.5rem;
}

.version-entry li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .legal-container {
        padding: 15px;
    }
    
    .legal-content {
        padding: 2rem 1.5rem;
    }
    
    .legal-header h1 {
        font-size: 2rem;
    }
    
    .role-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .implications-grid {
        grid-template-columns: 1fr;
    }
    
    .legal-section h2 {
        font-size: 1.5rem;
    }
}

/* Language Selector for Legal Pages */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
}

/* Print Styles */
@media print {
    .language-selector,
    .back-link {
        display: none;
    }
    
    .legal-container {
        background: var(--bg-surface);
    }
    
    .legal-content {
        box-shadow: none;
        padding: 0;
    }
    
    .legal-header {
        box-shadow: none;
        padding: 0 0 2rem 0;
    }
}/* Nuclear override for legal pages - loaded last to ensure it wins */

/* Reset all paragraph margins in legal sections */
.legal-container p {
    margin-bottom: 1rem !important;
}

/* Then apply compact spacing to legal sections */
.legal-content .legal-section {
    margin-bottom: 1.5rem !important;
}

.legal-content .legal-section:last-child {
    margin-bottom: 0 !important;
}

.legal-content .legal-section h2 {
    font-size: 1.5rem !important;
    margin-bottom: 0.8rem !important;
    margin-top: 0 !important;
}

.legal-content .legal-section h3 {
    font-size: 1.2rem !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0.8rem !important;
}

.legal-content .legal-section p {
    margin-bottom: 0.7rem !important;
    line-height: 1.6 !important;
}

.legal-content .legal-section ul,
.legal-content .legal-section ol {
    margin-bottom: 0.8rem !important;
    margin-top: 0.3rem !important;
}

.legal-content .legal-section li {
    margin-bottom: 0.4rem !important;
    line-height: 1.5 !important;
}

/* Special cases */
.legal-content .highlight-box {
    margin: 1rem 0 !important;
    padding: 1rem !important;
}

.legal-content .contact-box {
    margin: 1rem 0 !important;
    padding: 1.5rem !important;
}

.legal-content .last-updated {
    margin-bottom: 0.8rem !important;
}

/* Debug - removed border that was causing issues *//* NUCLEAR OVERRIDE - Maximum specificity with !important on everything */

/* Global reset for all paragraphs in legal pages */
body .legal-container p,
body .legal-content p,
body .legal-section p,
.legal-container .legal-content .legal-section p,
html body div.legal-container main.legal-content section.legal-section p {
    margin: 0 !important;
    margin-bottom: 11px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
}

/* Specific overrides for different paragraph types */
.legal-section p:last-child {
    margin-bottom: 0 !important;
}

.legal-section > p:first-child {
    margin-top: 0 !important;
}

/* Section spacing */
body .legal-section,
.legal-container .legal-section,
.legal-content .legal-section {
    margin-bottom: 24px !important;
    margin-top: 0 !important;
    padding: 0 !important;
}

.legal-section:last-child {
    margin-bottom: 0 !important;
}

/* Headers */
.legal-section h2 {
    font-size: 1.5rem !important;
    margin: 0 !important;
    margin-bottom: 13px !important;
    padding: 0 !important;
}

.legal-section h3 {
    font-size: 1.2rem !important;
    margin: 0 !important;
    margin-bottom: 8px !important;
    margin-top: 13px !important;
    padding: 0 !important;
}

/* Lists */
.legal-section ul,
.legal-section ol {
    margin: 0 !important;
    margin-bottom: 13px !important;
    padding-left: 24px !important;
}

.legal-section li {
    margin: 0 !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

/* Special boxes */
.highlight-box {
    margin: 16px 0 !important;
    padding: 16px !important;
}

.contact-box {
    margin: 16px 0 !important;
    padding: 20px !important;
}

/* Debug - add visible border to see actual spacing */
/* Uncomment to debug: 
.legal-section { border: 1px solid red !important; }
.legal-section p { border: 1px solid blue !important; }
*//* Help Utilities */
/* Help Center Styles */

.help-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px; /* Add space for language selector */
    min-height: 100vh;
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-default);
    position: relative;
}

/* Override language selector position for help page */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.help-header h1 {
    color: var(--text-primary);
    margin: 0;
}

.back-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--link-hover);
}

/* Layout */
.help-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar */
.help-sidebar {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.help-sidebar h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-group {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.category-group h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-group h3:hover {
    color: var(--link);
}

.category-toggle {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.category-group.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.topic-list {
    margin-left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.category-group.collapsed .topic-list {
    display: none;
}

.topic-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.topic-link:hover {
    background: var(--primary-bg-light);
    color: var(--link);
}

.topic-link.active {
    background: var(--link);
    color: var(--text-on-accent);
}

/* Main Content */
.help-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.article-content {
    min-height: 400px;
}

.welcome-message {
    text-align: center;
    padding: 3rem 0;
}

.welcome-message h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.popular-topics {
    margin-top: 3rem;
}

.popular-topics h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.popular-topics ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.popular-topics a {
    color: var(--link);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: block;
    transition: all 0.3s;
}

.popular-topics a:hover {
    background: var(--primary-bg-light);
}

/* Article Styles */
.article-content h1 {
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-default);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.article-content h2 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

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

.article-content ul,
.article-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-content code {
    background: var(--bg-hover);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--bg-hover);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.article-content blockquote {
    border-left: 4px solid var(--link);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Feedback Section */
.feedback-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-default);
    text-align: center;
}

.feedback-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.feedback-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-default);
    background: var(--bg-card);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-btn:hover {
    border-color: var(--link);
    transform: translateY(-2px);
}

.feedback-btn.helpful:hover {
    background: var(--success-bg-light);
    border-color: var(--success-color);
}

.feedback-btn.not-helpful:hover {
    background: var(--error-bg-light);
    border-color: var(--error);
}

.feedback-message {
    margin-top: 1rem;
    color: var(--success-color);
    font-weight: 500;
}

/* Related Articles */
.related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-default);
}

.related-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#related-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#related-list a {
    color: var(--link);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    display: block;
    transition: all 0.3s;
}

#related-list a:hover {
    background: var(--primary-bg-light);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Error State */
.error-message {
    background: var(--error-bg-light);
    border: 1px solid var(--error-border);
    color: var(--error-dark);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .help-layout {
        grid-template-columns: 1fr;
    }
    
    .help-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    
    .help-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .feedback-buttons {
        flex-direction: column;
    }
    
    .popular-topics ul {
        max-width: 100%;
    }
}/* Email Contribution Guide Styles */

/* Guide Navigation */
.guide-nav {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--primary);
}

.nav-container h1 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0;
}

/* Guide Main */
.guide-main {
  background: var(--bg-surface);
  min-height: 100vh;
}

/* Hero Section */
.guide-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-on-accent);
  padding: 4rem 2rem;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-icon {
  font-size: 5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.guide-hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  opacity: 0.9;
  margin-bottom: 3rem;
}

.email-display-large {
  background: var(--white-alpha-10);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 12px;
  display: inline-block;
}

.email-display-large label {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  opacity: 0.9;
}

.email-copy-box {
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}

.family-email {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  font-family: monospace;
}

.copy-btn {
  background: var(--primary);
  color: var(--text-on-accent);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* How It Works */
.how-it-works {
  padding: 4rem 2rem;
  background: var(--bg-card);
}

.how-it-works h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.process-steps {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.process-step {
  flex: 1;
  text-align: center;
}

.step-number {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: var(--text-on-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.step-content h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.process-arrow {
  font-size: 2rem;
  color: var(--text-muted);
}

/* Content Types */
.content-types {
  padding: 4rem 2rem;
  background: var(--bg-surface);
}

.content-types h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.type-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.type-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
}

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

.type-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.type-icon i {
  font-size: 2rem;
  color: var(--primary);
}

.type-card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

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

.example-snippet {
  background: var(--bg-surface);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.example-snippet strong {
  color: var(--text-primary);
}

/* Email Examples */
.email-examples {
  padding: 4rem 2rem;
  background: var(--bg-card);
}

.email-examples h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.examples-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.email-example {
  border: 2px solid var(--bg-hover);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.email-example:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.example-header {
  background: var(--bg-surface);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--bg-hover);
}

.example-header i {
  color: var(--primary);
  font-size: 1.25rem;
}

.example-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.email-preview {
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.email-field {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.email-field strong {
  color: var(--text-primary);
  display: inline-block;
  width: 80px;
}

.email-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-hover);
  color: var(--text-primary);
  line-height: 1.6;
}

.email-body p {
  margin-bottom: 1rem;
}

.attachments {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.attachments i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.ai-extract {
  background: var(--primary-bg-light);
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-extract strong {
  color: var(--primary);
  margin-right: 0.5rem;
}

.tag {
  background: var(--bg-card);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary);
  border: 1px solid var(--primary-light);
}

/* Best Practices */
.best-practices {
  padding: 4rem 2rem;
  background: var(--bg-surface);
}

.best-practices h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.tips-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.tip-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.tip-card i {
  color: var(--primary);
  font-size: 1.5rem;
  margin-top: 0.25rem;
}

.tip-card h4 {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.tip-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Share Section */
.share-section {
  padding: 4rem 2rem;
  background: var(--bg-card);
  text-align: center;
}

.share-section h2 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.share-section > p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.share-options {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn.email {
  background: var(--primary);
  color: var(--text-on-accent);
}

.share-btn.email:hover {
  background: var(--primary-dark);
}

.share-btn.copy {
  background: var(--success);
  color: var(--text-on-accent);
}

.share-btn.copy:hover {
  background: var(--success-dark);
}

.share-btn.print {
  background: var(--text-secondary);
  color: var(--text-on-accent);
}

.share-btn.print:hover {
  background: var(--text-primary);
}

.instruction-template {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 12px;
  text-align: left;
}

.instruction-template h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.template-content {
  color: var(--text-secondary);
  line-height: 1.6;
}

.template-content code {
  background: var(--bg-card);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--primary);
  font-weight: 600;
}

.template-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

/* FAQ Section */
.faq-section {
  padding: 4rem 2rem;
  background: var(--bg-surface);
}

.faq-section h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Footer */
.guide-footer {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.guide-footer a {
  color: var(--primary-light);
  text-decoration: none;
}

.guide-footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .guide-hero h1 {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
  }
  
  .family-email {
    font-size: 1rem;
  }
  
  .process-steps {
    flex-direction: column;
  }
  
  .process-arrow {
    transform: rotate(90deg);
  }
  
  .examples-container {
    grid-template-columns: 1fr;
  }
  
  .share-options {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 2rem;
  }
  
  .share-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Print Styles */
@media print {
  .guide-nav,
  .guide-footer,
  .share-options,
  .back-link {
    display: none;
  }
  
  .guide-hero {
    background: none;
    color: var(--text-primary);
    padding: 2rem 0;
  }
  
  .hero-icon {
    display: none;
  }
  
  .email-copy-box {
    box-shadow: none;
    border: 2px solid var(--text-primary);
  }
  
  .copy-btn {
    display: none;
  }
}/* Family Setup Wizard Styles */

/* Wizard Container */
.wizard-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  background: var(--bg-surface);
}

/* Wizard Header */
.wizard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.wizard-header h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.wizard-header p {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  margin: 2rem 0 1rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
}

.step {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  position: relative;
}

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

.step.completed {
  color: var(--success);
}

/* Wizard Content */
.wizard-content {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: var(--shadow-md);
}

.wizard-step h2 {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.wizard-step > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Form Sections */
.form-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.photo-upload-area {
  text-align: center;
}

.photo-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid var(--bg-hover);
}

.photo-placeholder:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.photo-placeholder i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

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

.form-group {
  display: flex;
  flex-direction: column;
}

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

.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--bg-hover);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--link-bg-alpha);
}

.form-group small {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

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

/* Parents Grid */
.parents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.parent-card {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.parent-card:hover {
  border-color: var(--bg-hover);
}

.parent-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.parent-card h3 i {
  color: var(--primary-color);
}

/* Siblings Section */
.siblings-section {
  min-height: 300px;
}

.add-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.btn-add {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-add:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.siblings-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.sibling-card {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.sibling-card i {
  font-size: 2rem;
  color: var(--primary-color);
}

.sibling-info h4 {
  margin: 0;
  color: var(--text-primary);
}

.sibling-info p {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.sibling-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.sibling-actions button {
  background: var(--bg-surface);
  border: 1px solid var(--bg-hover);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sibling-actions button:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Extended Family */
.extended-family-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.family-category h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.btn-add-outline {
  background: var(--bg-surface);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-add-outline:hover {
  background: var(--primary-color);
  color: var(--text-on-accent);
}

.added-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-hover);
}

.member-chip {
  background: var(--primary-bg-light);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.member-chip button {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
}

/* Completion Screen */
.completion-celebration {
  text-align: center;
  margin-bottom: 3rem;
}

.celebration-icon {
  font-size: 5rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.celebration-icon i {
  animation: bounce 1s ease;
}

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

.member-count {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.member-count span {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.5rem;
}

.next-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.action-card {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

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

.action-card.highlight {
  background: linear-gradient(135deg, var(--primary-bg-light) 0%, var(--bg-surface) 100%);
  border: 2px solid var(--primary-light);
}

.action-card i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.action-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.action-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.email-display {
  background: var(--bg-surface);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
}

.email-display code {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
}

.btn-copy {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-copy:hover {
  background: var(--primary-dark);
}

/* Wizard Actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-hover);
}

.wizard-actions.final {
  justify-content: center;
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  color: var(--text-on-accent);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary.large {
  padding: 1rem 3rem;
  font-size: 1.125rem;
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--border-subtle);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

.modal-content h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .wizard-container {
    padding: 1rem;
  }
  
  .wizard-content {
    padding: 2rem 1.5rem;
  }
  
  .form-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .parents-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .wizard-actions {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .wizard-actions button {
    flex: 1;
    min-width: 150px;
  }
}/* Theme Utilities */
/**
 * Theme System - Unified theme management
 * This file provides the theme switching mechanism and component-agnostic styles
 */

/* Light theme (default and explicit) - MAXIMUM CONTRAST */
:root,
html.theme-light,
body.theme-light {
  /* Backgrounds */
  --bg-surface: #FFFFFF;
  --bg-card: #FAFAFA;      /* Lighter card bg for better text contrast */
  --bg-input: #FFFFFF;
  --bg-hover: #F0F0F0;
  
  /* Text Colors - MAXIMUM CONTRAST */
  --text-primary: #000000;   /* Pure black = 21:1 contrast */
  --text-secondary: #2C2C2C; /* Very dark gray = 13.7:1 contrast */
  --text-muted: #4A4A4A;     /* Dark gray = 8.6:1 contrast (was 3.5:1) */
  --text-on-accent: #FFFFFF;
  
  /* Borders - VISIBLE CONTRAST */
  --border-default: #595959;  /* Dark border = 7.5:1 contrast */
  --border-subtle: #B0B0B0;   /* Medium gray = 2.7:1 (was 1.2:1) */
  --border-focus: #0038A8;    /* Dark blue = 8.6:1 contrast */
  
  /* Interactive Colors - HIGH CONTRAST */
  --link: #0038A8;          /* Dark blue = 8.6:1 contrast */
  --link-hover: #002670;    /* Darker blue = 12.6:1 contrast */
  --error: #B71C1C;         /* Dark red = 6.1:1 contrast */
  --success: #1B5E20;       /* Dark green = 7.0:1 contrast */
  --warning: #E65100;       /* Dark orange = 5.4:1 contrast */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  
  /* Additional light theme colors */
  --hover-overlay: rgba(0, 0, 0, 0.05);
  --border-light: rgba(255, 255, 255, 0.2);
  --hover-color: var(--bg-hover);
  --focus-color: #e5e7eb;
  --danger-bg-light: #fee2e2;
  --overlay-dark: rgba(0, 0, 0, 0.5);
  --skeleton-base: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  --white: #FFFFFF;
  --background-color: var(--bg-surface);
  --text-color: var(--text-primary);        /* Pure black for max contrast */
  --border-color: var(--border-default);       /* Darker border */
  
  /* Legacy support - HIGH CONTRAST */
  --primary-color: #0038A8;
  --success-color: #1B5E20;
  --danger-color: var(--error);
  --warning-color: #E65100;
  --info-color: #0038A8;
}

/* Base styles */
html,
body {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme class override - MAXIMUM CONTRAST */
:root.theme-dark,
html.theme-dark,
body.theme-dark {
  /* Backgrounds - PURE BLACK FOR MAX CONTRAST */
  --bg-surface: #000000;     /* Pure black background */
  --bg-card: #0A0A0A;        /* Nearly black for cards */
  --bg-input: #141414;       /* Slightly lighter for inputs */
  --bg-hover: #1F1F1F;       /* Visible hover state */
  
  /* Text Colors - MAXIMUM CONTRAST ON BLACK */
  --text-primary: #FFFFFF;   /* Pure white = 21:1 contrast */
  --text-secondary: #E0E0E0; /* Light gray = 15.3:1 contrast */
  --text-muted: #B0B0B0;     /* Medium gray = 9.1:1 contrast (was 4.0:1) */
  --text-on-accent: #000000; /* Black on light accents */
  
  /* Borders - VISIBLE ON BLACK */
  --border-default: #808080;  /* Medium gray = 5.3:1 contrast */
  --border-subtle: #404040;   /* Dark gray = 2.8:1 contrast */
  --border-focus: #4A90E2;    /* Bright blue = 7.1:1 contrast */
  
  /* Interactive Colors - HIGH CONTRAST ON BLACK */
  --link: #4A90E2;          /* Bright blue = 7.1:1 on black */
  --link-hover: #6DB3F2;    /* Lighter blue = 10.6:1 on black */
  --error: #FF5252;         /* Bright red = 5.9:1 on black */
  --success: #69F0AE;       /* Bright green = 13.5:1 on black */
  --warning: #FFD740;       /* Bright yellow = 16.5:1 on black */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  
  /* Additional dark mode colors */
  --hover-overlay: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.1);
  --hover-color: #2F3133;
  --focus-color: #2F3133;
  --danger-bg-light: rgba(239, 68, 68, 0.1);
  --overlay-dark: rgba(0, 0, 0, 0.7);
  --skeleton-base: linear-gradient(90deg, #2D2F30 25%, #353738 50%, #2D2F30 75%);
  --white: #FFFFFF;
  --background-color: var(--bg-surface);  /* Pure black */
  --text-color: var(--text-on-accent);         /* Pure white */
  --border-color: var(--border-default);       /* Visible gray */
  
  /* Legacy support - HIGH CONTRAST ON BLACK */
  --primary-color: #4A90E2;
  --success-color: #69F0AE;
  --danger-color: #FF5252;
  --warning-color: #FFD740;
  --info-color: #4A90E2;
  
  /* Status backgrounds */
  --success-bg: rgba(34, 139, 34, 0.2);
  --success-text: #51CF66;
  --error-bg: rgba(220, 53, 69, 0.2);
  --error-text: #FF6B6B;
  --warning-bg: rgba(255, 193, 7, 0.2);
  --warning-text: #FFD93D;
  --info-bg: rgba(33, 150, 243, 0.2);
  --info-text: #6DB3F2;
  --info-hover: #5CA3E2;
  --warning-hover: #FFC707;
  --success-hover: #3EBF52;
  
  /* Navbar colors */
  --navbar-bg: #1a1a1a;
  --navbar-text: #f3f3f3;
  --navbar-hover: rgba(255, 255, 255, 0.1);
}

/* System preference detection - DISABLED to force manual theme selection */
/* Users must explicitly choose their theme via the toggle button */

/* Component Base Styles - Theme Agnostic */

/* Cards and Containers */
.card,
.metric-card,
.dashboard-card,
.content-card {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover,
.metric-card:hover,
.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

/* Form Elements */
input,
textarea,
select,
.form-control {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus {
  border-color: var(--border-focus);
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1; /* Firefox fix */
}

/* Buttons */
button,
.btn {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  transition: all 0.2s ease;
}

button:hover,
.btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-focus);
}

.btn-primary {
  background-color: var(--link);
  color: var(--text-on-accent);
  border-color: var(--link);
}

.btn-primary:hover {
  background-color: var(--link-hover);
  border-color: var(--link-hover);
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Status Colors */
.error,
.alert-error {
  color: var(--error);
}

.success,
.alert-success {
  color: var(--success);
}

.warning,
.alert-warning {
  color: var(--warning);
}

/* Text Hierarchy */
.text-secondary {
  color: var(--text-secondary);
}

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

/* Tables */
table {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

th {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-default);
}

td {
  border-bottom: 1px solid var(--border-subtle);
}

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

/* Navigation */
nav,
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
}

.nav-link {
  color: var(--text-primary);
}

.nav-link:hover {
  color: var(--link);
  background-color: var(--bg-hover);
}

.nav-link.active {
  color: var(--link);
  border-bottom: 2px solid var(--link);
}

/* Modals and Overlays */
.modal,
.dialog {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
}

.modal-overlay {
  background-color: rgba(0, 0, 0, 0.5);
}

body.theme-dark .modal-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Utility Classes */
.bg-surface {
  background-color: var(--bg-surface);
}

.bg-card {
  background-color: var(--bg-card);
}

.border {
  border-color: var(--border-default);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

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

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Accessibility Focus States */
*:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
  text-decoration: none;
  border: 2px solid var(--border-focus);
}

.skip-link:focus {
  top: 0;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border-default);
  box-shadow: var(--shadow-md);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Mobile adjustments for theme toggle */
@media (max-width: 768px) {
  .theme-toggle-btn {
    bottom: 90px; /* Clear space above carousel dots */
    right: 15px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    z-index: 1001; /* Above carousel elements */
  }
}

/* Print styles */
@media print {
  body {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
  }
  
  .no-print,
  .theme-toggle-btn {
    display: none !important;
  }
}/**
 * Trust Score Dashboard Styles
 */

.trust-score-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header Section */
.trust-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 2rem;
  color: var(--text-on-accent);
  margin-bottom: 2rem;
}

.trust-header h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.trust-score-display {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.score-circle.provisional { background: linear-gradient(135deg, #f5f5f5, #e0e0e0); }
.score-circle.basic { background: linear-gradient(135deg, #4CAF50, #45a049); }
.score-circle.contributor { background: linear-gradient(135deg, #2196F3, #1976D2); }
.score-circle.trusted { background: linear-gradient(135deg, #FFD700, #FFA000); }

.score-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--text-primary);
}

.score-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.score-details h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.access-level {
  text-transform: capitalize;
}

.access-level.provisional { color: #e0e0e0; }
.access-level.basic { color: #c8e6c9; }
.access-level.contributor { color: #bbdefb; }
.access-level.trusted { color: #fff9c4; }

.next-level-info {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

.max-level {
  margin: 0;
  color: #fff9c4;
  font-weight: 600;
}

/* Progress Bar */
.trust-progress {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 30px;
  background: var(--bg-card);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  border-radius: 15px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.progress-fill.provisional { background: linear-gradient(90deg, #9e9e9e, #757575); }
.progress-fill.basic { background: linear-gradient(90deg, #4CAF50, #45a049); }
.progress-fill.contributor { background: linear-gradient(90deg, #2196F3, #1976D2); }
.progress-fill.trusted { background: linear-gradient(90deg, #FFD700, #FFA000); }

.progress-markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}

.progress-markers .marker {
  position: absolute;
  width: 30px;
  height: 30px;
  background: var(--bg-surface);
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
  transform: translateX(-50%);
}

/* Content Sections */
.trust-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.trust-section {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trust-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

/* Verification Checklist */
.verification-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.verification-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.verification-item.completed {
  background: #e8f5e9;
}

.verification-item.pending {
  background: var(--bg-card);
  opacity: 0.7;
}

.check-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.9rem;
}

.verification-item.completed .check-icon {
  background: #4CAF50;
  color: var(--text-on-accent);
}

.verification-item.pending .check-icon {
  border: 2px solid #ddd;
  color: #ddd;
}

.verification-item .points {
  margin-left: auto;
  font-weight: 600;
  color: #4CAF50;
}

.verification-item.pending .points {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Permissions List */
.permission-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
}

.permission-item.allowed {
  background: #e8f5e9;
}

.permission-item.restricted {
  background: #ffebee;
  opacity: 0.7;
}

.permission-item .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
}

.permission-item.allowed .icon {
  background: #4CAF50;
  color: var(--text-on-accent);
}

.permission-item.restricted .icon {
  background: #f44336;
  color: var(--text-on-accent);
}

.permission-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Earn Points Section */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  transition: background 0.2s;
}

.action-item:hover {
  background: #e3f2fd;
}

.action-description {
  flex: 1;
  color: var(--text-primary);
}

.action-points {
  font-weight: 600;
  color: #4CAF50;
}

.action-btn {
  padding: 0.4rem 1rem;
  background: #2196F3;
  color: var(--text-on-accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #1976D2;
}

/* Activity Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-left: 3px solid;
  background: var(--bg-card);
}

.activity-item.positive {
  border-color: var(--border-default);
  background: #f1f8e9;
}

.activity-item.negative {
  border-color: var(--border-default);
  background: #ffebee;
}

.activity-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 80px;
}

.activity-description {
  flex: 1;
  color: var(--text-primary);
}

.activity-points {
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.activity-item.positive .activity-points {
  color: #4CAF50;
}

.activity-item.negative .activity-points {
  color: #f44336;
}

/* Footer */
.trust-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn-primary, .btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--link);
  border: 2px solid #667eea;
}

.btn-secondary:hover {
  background: #f5f7ff;
}

/* Modal */
.trust-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-on-accent);
}

.modal-header h2 {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-on-accent);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Leaderboard */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  transition: background 0.2s;
}

.leaderboard-item.current-user {
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border: 2px solid #667eea;
}

.leaderboard-item .rank {
  font-weight: bold;
  min-width: 40px;
  color: var(--text-secondary);
}

.leaderboard-item .name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.leaderboard-item .level {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 1rem;
}

.level.provisional { background: #e0e0e0; color: var(--text-secondary); }
.level.basic { background: #c8e6c9; color: #2e7d32; }
.level.contributor { background: #bbdefb; color: #1565c0; }
.level.trusted { background: #fff9c4; color: #f57c00; }

.leaderboard-item .score {
  font-weight: bold;
  color: var(--link);
}

.user-rank-info {
  margin-top: 1rem;
  padding: 1rem;
  background: #f5f7ff;
  border-radius: 6px;
  text-align: center;
  color: var(--link);
  font-weight: 500;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: #4CAF50;
  color: var(--text-on-accent);
}

.notification.error {
  background: #f44336;
  color: var(--text-on-accent);
}

.notification.info {
  background: #2196F3;
  color: var(--text-on-accent);
}

/* Responsive Design */
@media (max-width: 768px) {
  .trust-score-dashboard {
    padding: 1rem;
  }
  
  .trust-sections {
    grid-template-columns: 1fr;
  }
  
  .trust-score-display {
    flex-direction: column;
    text-align: center;
  }
  
  .trust-footer {
    flex-direction: column;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}/* Orbital Logo Styles - Family History Theme */
.orbital-logo {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 3rem auto;
    z-index: 1;
}

.center-sphere {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--link);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
                inset 0 -5px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: background-color 0.3s ease;
}

/* Dark mode adjustments */
[data-theme="dark"] .center-sphere {
    background: #A29BFE;
    box-shadow: 0 0 25px rgba(162, 155, 254, 0.8),
                inset 0 -5px 10px rgba(0, 0, 0, 0.3);
}

.orbit {
    position: absolute;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

[data-theme="dark"] .orbit {
    border-color: rgba(162, 155, 254, 0.4);
}

.orbit-1 {
    width: 60px;
    height: 60px;
}

.orbit-2 {
    width: 80px;
    height: 80px;
}

.orbit-3 {
    width: 100px;
    height: 100px;
}

.orbit-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--link);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
                0 0 8px currentColor;
    transition: background 1s ease, box-shadow 0.3s ease;
    transform-origin: center;
    will-change: transform;
    z-index: 5;
}

[data-theme="dark"] .orbit-dot {
    border: 1px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6),
                0 0 10px currentColor;
}

.orbit-dot:hover {
    cursor: pointer;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .orbital-logo {
        width: 90px;
        height: 90px;
        margin: 1.5rem auto;
    }
    
    .center-sphere {
        width: 32px;
        height: 32px;
        box-shadow: 0 0 15px rgba(102, 126, 234, 0.7),
                    inset 0 -3px 6px rgba(0, 0, 0, 0.2);
    }
    
    .orbit-1 {
        width: 48px;
        height: 48px;
    }
    
    .orbit-2 {
        width: 64px;
        height: 64px;
    }
    
    .orbit-3 {
        width: 80px;
        height: 80px;
    }
    
    .orbit-dot {
        width: 10px;
        height: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4),
                    0 0 6px currentColor;
    }
}

@media (max-width: 480px) {
    .orbital-logo {
        width: 70px;
        height: 70px;
        margin: 1rem auto;
    }
    
    .center-sphere {
        width: 26px;
        height: 26px;
        box-shadow: 0 0 12px rgba(102, 126, 234, 0.8),
                    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .orbit-1 {
        width: 38px;
        height: 38px;
    }
    
    .orbit-2 {
        width: 52px;
        height: 52px;
    }
    
    .orbit-3 {
        width: 66px;
        height: 66px;
    }
    
    .orbit-dot {
        width: 9px;
        height: 9px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5),
                    0 0 5px currentColor;
    }
}

/* Animation states */
.orbital-logo.loading {
    opacity: 0.5;
}

.orbital-logo.loaded {
    animation: fadeIn 0.5s ease-out;
}

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

/* Integration with landing page */
.orbital-section {
    padding: 4rem 0;
    text-align: center;
    background: var(--bg-card);
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
}

[data-theme="dark"] .orbital-section {
    background: var(--bg-card-dark);
    border-color: var(--border-default-dark);
}

.orbital-section h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.orbital-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .orbital-section {
        padding: 3rem 1rem;
    }
    
    .orbital-section h2 {
        font-size: 1.5rem;
    }
    
    .orbital-section p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .orbital-section {
        padding: 2rem 1rem;
    }
    
    .orbital-section h2 {
        font-size: 1.25rem;
    }
    
    .orbital-section p {
        font-size: 0.95rem;
    }
}/* Vendor Libraries */
/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: var(--bg-surface);
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: var(--text-primary);
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: var(--bg-surface);
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(images/layers.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(images/layers-2x.png);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: var(--text-primary);
	background: var(--bg-surface);
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(images/marker-icon.png);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: var(--bg-surface);
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: var(--text-primary);
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: var(--bg-surface);
	color: var(--text-primary);
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid var(--border-default);
	}


/* div icon */

.leaflet-div-icon {
	background: var(--bg-surface);
	border: 1px solid var(--border-default);
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: var(--bg-surface);
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: var(--text-on-accent);
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: var(--text-on-accent);
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: var(--text-on-accent);
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: var(--text-on-accent);
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}
/* Geographic Mapping Styles */

/* Map Container */
.geographic-map-container {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: var(--bg-surface);
}

.geographic-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-group {
  display: flex;
  gap: 4px;
}

.map-control-btn {
  padding: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  min-width: 36px;
  text-align: center;
}

.map-control-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-default);
}

.map-control-btn.active {
  background: var(--link);
  color: var(--text-on-accent);
  border-color: var(--link);
}

.map-control-btn.active:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
}

/* Timeline Controls */
.timeline-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-overlay);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.timeline-title {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.timeline-range {
  font-size: 14px;
  color: var(--text-secondary);
}

.timeline-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-hover);
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 8px;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--link);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.timeline-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--link);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
}

.timeline-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.timeline-play-controls {
  display: flex;
  gap: 8px;
}

.timeline-play-btn {
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.timeline-play-btn:hover {
  background: var(--bg-surface);
}

.timeline-play-btn.playing {
  background: var(--error);
  color: var(--text-on-accent);
  border-color: var(--error);
}

.timeline-speed {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Migration Path Styles */
.migration-path {
  stroke-width: 3;
  fill: none;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.migration-path:hover {
  stroke-width: 5;
  opacity: 1;
}

.migration-path.active {
  stroke-width: 5;
  opacity: 1;
  stroke-dasharray: 10, 5;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -15;
  }
}

/* Location Markers */
.location-marker {
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.location-marker:hover {
  transform: scale(1.2);
  z-index: 1000;
}

.location-marker.origin {
  background-color: var(--success);
}

.location-marker.destination {
  background-color: var(--error);
}

.location-marker.waypoint {
  background-color: var(--warning);
}

.location-marker.city {
  width: 12px;
  height: 12px;
}

.location-marker.town {
  width: 10px;
  height: 10px;
}

.location-marker.village {
  width: 8px;
  height: 8px;
}

.location-marker.country {
  width: 16px;
  height: 16px;
}

/* Popup Styles */
.leaflet-popup-content {
  margin: 12px 16px;
  line-height: 1.4;
}

.location-popup {
  max-width: 300px;
}

.location-popup-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 16px;
}

.location-popup-details {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.location-popup-coordinates {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.migration-popup {
  max-width: 320px;
}

.migration-popup-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 16px;
}

.migration-popup-route {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.migration-popup-arrow {
  color: var(--link);
  font-weight: bold;
}

.migration-popup-details {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.migration-popup-period {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.migration-popup-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.popup-btn {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.popup-btn:hover {
  background: var(--bg-surface);
  text-decoration: none;
  color: var(--text-primary);
}

.popup-btn.primary {
  background: var(--link);
  color: var(--text-on-accent);
  border-color: var(--link);
}

.popup-btn.primary:hover {
  background: var(--link-hover);
  color: var(--text-on-accent);
  border-color: var(--link-hover);
}

/* Sidebar */
.geographic-sidebar {
  width: 350px;
  height: 600px;
  background: var(--bg-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.sidebar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.sidebar-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-tab:hover {
  color: var(--text-primary);
}

.sidebar-tab.active {
  color: var(--link);
  border-bottom-color: var(--link);
}

/* Migration List */
.migration-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.migration-item {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.migration-item:hover {
  border-color: var(--link);
  box-shadow: 0 2px 4px var(--link-bg-alpha);
}

.migration-item.active {
  border-color: var(--link);
  background: var(--bg-surface);
}

.migration-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 14px;
}

.migration-item-route {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.migration-item-period {
  font-size: 11px;
  color: var(--text-muted);
}

/* Location List */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-item {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.location-item:hover {
  border-color: var(--link);
  background: var(--bg-surface);
}

.location-item.active {
  border-color: var(--link);
  background: var(--info-bg-light);
}

.location-item-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}

.location-item-address {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Filters */
.filter-section {
  margin-bottom: 20px;
}

.filter-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.filter-checkbox input[type="checkbox"] {
  margin: 0;
}

.filter-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-range input {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 12px;
}

/* Loading States */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
  .geographic-sidebar {
    width: 100%;
    height: 300px;
    margin-top: 16px;
  }
  
  .timeline-controls {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 12px;
  }
  
  .timeline-controls-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .map-controls {
    top: 60px;
    right: 10px;
  }
  
  .geographic-map-container {
    height: 400px;
  }
}

/* Color scheme for different migration types */

/* Historical period styling */
.period-ancient { 
  filter: sepia(80%) contrast(120%) hue-rotate(15deg);
  transition: filter 0.5s ease;
}

.period-medieval { 
  filter: sepia(60%) hue-rotate(30deg) contrast(110%);
  transition: filter 0.5s ease;
}

.period-renaissance { 
  filter: sepia(40%) brightness(110%) contrast(105%);
  transition: filter 0.5s ease;
}

.period-industrial { 
  filter: sepia(20%) contrast(110%) brightness(95%);
  transition: filter 0.5s ease;
}

.period-modern { 
  filter: contrast(105%) brightness(102%);
  transition: filter 0.5s ease;
}

.period-contemporary { 
  filter: brightness(105%) contrast(102%);
  transition: filter 0.5s ease;
}

/* Enhanced layer controls */
.time-period-control,
.family-branch-control,
.historical-overlay-control {
  max-width: 200px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.time-period-control h6,
.family-branch-control h6,
.historical-overlay-control h6 {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.time-period-btn:hover,
.historical-overlay-btn:hover {
  background: var(--bg-surface) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.family-branch-item:hover {
  background: var(--bg-surface) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Family branch colors animation */
.family-branch-item {
  transition: all 0.2s ease;
}

.family-branch-item.active {
  border-width: 2px;
  box-shadow: var(--shadow);
}

/* Migration path enhancements for layers */
.migration-path.family-branch {
  stroke-width: 4;
  stroke-dasharray: none;
  filter: drop-shadow(1px 1px 2px var(--shadow-color));
}

.migration-path.time-period {
  opacity: 0.9;
  filter: drop-shadow(0 0 3px currentColor);
}

/* Loading states for controls */
.control-loading {
  opacity: 0.6;
  pointer-events: none;
}

.control-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-subtle);
  border-top: 2px solid var(--link);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Enhanced tooltips for layer controls */
.layer-tooltip {
  position: absolute;
  background: var(--overlay-darker);
  color: var(--text-on-accent);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 10000;
  transform: translateX(-50%);
  white-space: nowrap;
}

.layer-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--overlay-darker) transparent transparent transparent;
}

/* Migration Type Colors */
.migration-economic { stroke: var(--migration-economic, #28a745); }
.migration-religious { stroke: var(--migration-religious, #6f42c1); }
.migration-political { stroke: var(--migration-political, #dc3545); }
.migration-war { stroke: var(--migration-war, #fd7e14); }
.migration-family { stroke: var(--migration-family, #20c997); }
.migration-education { stroke: var(--migration-education, #17a2b8); }
.migration-health { stroke: var(--migration-health, #e83e8c); }
.migration-other { stroke: var(--migration-other, #6c757d); }
/* Collaborative Editor Styles */
.collaborative-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.1));
  overflow: hidden;
}

/* Toolbar */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-format,
.btn-comment,
.btn-history {
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-format:hover,
.btn-comment:hover,
.btn-history:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-format.active {
  background: #007bff;
  color: var(--text-on-accent);
  border-color: var(--border-default);
}

.separator {
  width: 1px;
  height: 24px;
  background: #ddd;
  margin: 0 4px;
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
}

.status-indicator.connected {
  background: #4caf50;
}

.status-indicator.disconnected {
  background: #f44336;
}

.status-indicator.connecting {
  background: #ff9800;
  animation: pulse 1.5s infinite;
}

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

/* Active Users */
.active-users {
  display: flex;
  gap: 4px;
}

.active-user {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid;
  overflow: hidden;
  transition: transform 0.2s;
}

.active-user:hover {
  transform: scale(1.1);
}

.active-user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.typing-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: typing 1.4s infinite;
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* Editor Container */
.editor-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.editor-content {
  flex: 1;
  padding: 24px;
  font-size: 16px;
  line-height: 1.6;
  overflow-y: auto;
  outline: none;
  position: relative;
}

.editor-content:focus {
  background: var(--bg-card);
}

/* Remote Cursors */
.editor-cursors {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.remote-cursor {
  position: absolute;
  width: 2px;
  height: 20px;
  transition: all 0.15s ease-out;
}

.cursor-label {
  position: absolute;
  top: -20px;
  left: 0;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-on-accent);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.remote-cursor:hover .cursor-label {
  opacity: 1;
}

.remote-cursor.has-selection {
  background: var(--shadow-color, rgba(0, 0, 0, 0.1));
  width: auto;
}

/* Sidebar */
.editor-sidebar {
  width: 320px;
  background: var(--bg-card);
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: var(--bg-hover);
}

.tab-btn.active {
  border-bottom-color: #007bff;
  color: #007bff;
  font-weight: 500;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

.tab-panel {
  display: none;
  padding: 16px;
}

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

/* Comments */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px var(--shadow-color, rgba(0, 0, 0, 0.1));
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-author {
  font-weight: 500;
  font-size: 14px;
}

.comment-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.comment-content {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.comment-anchor {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-style: italic;
}

.comment-actions {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.comment-action {
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.comment-action:hover {
  color: #007bff;
}

.comment-replies {
  margin-left: 32px;
  margin-top: 12px;
  border-left: 2px solid #e0e0e0;
  padding-left: 12px;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

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

.history-user {
  font-weight: 500;
  color: var(--text-primary);
}

.history-action {
  color: var(--text-secondary);
  margin: 0 4px;
}

.history-time {
  color: var(--text-muted);
  font-size: 12px;
}

/* Presence */
.presence-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.presence-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.presence-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid;
  overflow: hidden;
}

.presence-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.presence-info {
  flex: 1;
}

.presence-name {
  font-weight: 500;
  font-size: 14px;
}

.presence-status {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Status Bar */
.editor-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-card);
  border-top: 1px solid #e0e0e0;
  font-size: 13px;
  color: var(--text-secondary);
}

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-status.saved::before {
  content: '✓';
  color: #4caf50;
}

.save-status.saving::before {
  content: '⟳';
  animation: spin 1s linear infinite;
}

.save-status.error::before {
  content: '✗';
  color: #f44336;
}

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

/* Notifications */
.editor-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  background: #333;
  color: var(--text-on-accent);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s;
  z-index: 1000;
}

.editor-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.editor-notification.error {
  background: #f44336;
}

.editor-notification.success {
  background: #4caf50;
}

.editor-notification.warning {
  background: #ff9800;
}

/* Comment Dialog */
.comment-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-surface);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  z-index: 1001;
}

.comment-dialog-header {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
}

.comment-dialog-selection {
  background: var(--bg-hover);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-style: italic;
  font-size: 14px;
}

.comment-dialog-input {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 16px;
}

.comment-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.comment-dialog-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-dialog-btn.primary {
  background: #007bff;
  color: var(--text-on-accent);
  border: none;
}

.comment-dialog-btn.primary:hover {
  background: #0056b3;
}

.comment-dialog-btn.secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.comment-dialog-btn.secondary:hover {
  background: var(--bg-hover);
}

/* Overlay */
.editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .editor-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    bottom: 0;
    width: 320px;
    transition: right 0.3s;
    z-index: 999;
  }
  
  .editor-sidebar.open {
    right: 0;
  }
  
  .toolbar-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  
  .active-users {
    order: -1;
  }
}/* Memory Games Styles */

.memory-games-main {
    min-height: calc(100vh - 70px);
    background-color: var(--background-secondary);
    padding: 2rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Game Card */
.game-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

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

.game-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.game-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.game-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Game Stats */
.game-stats {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat i {
    color: var(--accent-color);
}

.stat .score,
.stat .time,
.stat .level,
.stat .count,
.stat .progress,
.stat .accuracy {
    font-weight: 600;
    color: var(--text-primary);
}

/* Play Button */
.play-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 0;
}

.empty-content {
    max-width: 500px;
    margin: 0 auto;
}

.empty-content i {
    font-size: 5rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.empty-content h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

/* Game Container */
.game-container {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    min-height: 500px;
}

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

.game-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-content {
    padding: 2rem;
}

.game-placeholder {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.game-placeholder i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .game-card {
        padding: 1.5rem;
    }

    .game-icon {
        font-size: 3rem;
    }

    .page-header h2 {
        font-size: 2rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .game-card {
        background: var(--surface-color-dark);
        border-color: var(--border-color-dark);
    }

    .game-stats {
        background: var(--background-secondary-dark);
    }

    .game-container {
        background: var(--surface-color-dark);
    }
}/* Modern Memory Games Styles */

.memory-games-page {
  padding-top: 70px;
  min-height: 100vh;
  background: var(--background-primary);
}

/* Gaming Hero Section */
.gaming-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gaming-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
  animation: gaming-pattern 20s linear infinite;
}

@keyframes gaming-pattern {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20px, 20px); }
}

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

.hero-icon-bounce {
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  animation: bounce 2s ease-in-out infinite;
}

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

.hero-title {
  color: var(--text-on-accent);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.stat-bubble {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.stat-bubble:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.stat-bubble i {
  font-size: 2rem;
  color: var(--text-on-accent);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-on-accent);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Stats Bar */
.quick-stats-bar {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

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

.stat-item i {
  color: var(--primary-color);
}

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

.page-help-button {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-help-button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Games Container */
.games-container {
  background: var(--background-secondary);
  min-height: calc(100vh - 70px);
  padding-bottom: 3rem;
}

.section-title {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
}

/* Games Loading */
.games-loading {
  margin-bottom: 3rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.skeleton-card {
  height: 400px;
  background: var(--surface-color);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Game Card */
.game-card {
  background: var(--surface-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.game-card-header {
  position: relative;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  text-align: center;
}

/* Theme variations for different games */
.trivia-theme {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.photo-theme {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.timeline-theme {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.future-theme {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.game-icon {
  font-size: 4rem;
  color: var(--text-on-accent);
  margin-bottom: 1rem;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.difficulty-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-on-accent);
  font-size: 0.85rem;
}

.difficulty-badge i {
  font-size: 0.75rem;
}

.difficulty-badge.easy i { color: #4ade80; }
.difficulty-badge.medium i { color: #facc15; }
.difficulty-badge.hard i { color: var(--error); }

/* Game Card Body */
.game-card-body {
  padding: 2rem;
}

.game-card-body h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.game-card-body p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.game-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.meta-item i {
  color: var(--primary-color);
}

/* Game Progress */
.game-progress {
  margin-bottom: 1.5rem;
}

.progress-bar {
  height: 8px;
  background: var(--background-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.trivia-progress { background: linear-gradient(90deg, #f093fb, #f5576c); }
.photo-progress { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.timeline-progress { background: linear-gradient(90deg, #43e97b, #38f9d7); }

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

/* Play Button */
.btn-game {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color);
  color: var(--text-on-accent);
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-game:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-game.coming-soon {
  background: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Coming Soon Card */
.coming-soon-card {
  opacity: 0.8;
}

.coming-soon-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.coming-soon-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--background-secondary);
  border-radius: 8px;
  color: var(--text-secondary);
}

.coming-soon-item i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

/* Leaderboard Section */
.leaderboard-section {
  margin-top: 4rem;
}

.leaderboard-card {
  background: var(--surface-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard-header {
  display: flex;
  background: var(--background-secondary);
  padding: 0;
}

.leaderboard-tab {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.leaderboard-tab:hover {
  background: var(--background-primary);
}

.leaderboard-tab.active {
  color: var(--primary-color);
  background: var(--surface-color);
}

.leaderboard-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

.leaderboard-list {
  padding: 2rem;
}

.leaderboard-empty {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-tertiary);
}

.leaderboard-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Leaderboard Entry */
.leaderboard-entry {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background: var(--background-secondary);
  transition: all 0.3s ease;
}

.leaderboard-entry:hover {
  background: var(--background-primary);
  transform: translateX(5px);
}

.leaderboard-rank {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 50%;
  margin-right: 1rem;
}

.leaderboard-rank.gold {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: var(--text-primary);
}

.leaderboard-rank.silver {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: var(--text-primary);
}

.leaderboard-rank.bronze {
  background: linear-gradient(135deg, #cd7f32, #e8a964);
  color: var(--text-on-accent);
}

.leaderboard-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.leaderboard-name {
  font-weight: 500;
  color: var(--text-primary);
}

.leaderboard-score {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--primary-color);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-content {
  max-width: 400px;
  margin: 0 auto;
}

.empty-content i {
  font-size: 5rem;
  color: var(--text-tertiary);
  opacity: 0.5;
  margin-bottom: 1.5rem;
}

.empty-content h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-stats {
    gap: 1rem;
  }
  
  .stat-bubble {
    padding: 1rem 1.5rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .stats-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-help-button {
    margin-left: 0;
    width: 100%;
  }
}

/* Game Modal Styles (for actual games) */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.game-modal-content {
  background: var(--surface-color);
  border-radius: 20px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

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

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

.game-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.game-modal-close:hover {
  color: var(--text-primary);
}

.game-modal-body {
  padding: 2rem;
  min-height: 400px;
}/* Pricing Page Styles */

/* Header & Navigation */
.pricing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    z-index: 100;
    padding: 1rem 2rem;
}

.pricing-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2E5266;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: #52796F;
}

/* Hero Section */
.pricing-hero {
    padding: 120px 2rem 60px;
    text-align: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 100%);
}

.pricing-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.pricing-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.pricing-philosophy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #e6f7ed;
    border-radius: 50px;
    border: 1px solid #52796F;
}

.badge-icon {
    font-size: 1.5rem;
}

.badge-text {
    color: #2E5266;
    font-weight: 500;
}

/* Storage Calculator */
.storage-calculator-section {
    padding: 60px 2rem;
    background: var(--bg-surface);
}

.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.calculator-container h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.calculator-inputs {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.calc-input-group {
    display: grid;
    grid-template-columns: 150px 1fr 100px;
    align-items: center;
    gap: 1rem;
}

.calc-input-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.calc-input-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.calc-input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #52796F;
    cursor: pointer;
    border-radius: 50%;
}

.calc-input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #52796F;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.calc-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.calculator-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 2px solid #52796F;
}

.storage-estimate,
.recommended-plan {
    text-align: center;
}

.estimate-label,
.recommend-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.estimate-value,
.recommend-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #52796F;
}

/* Pricing Tiers */
.pricing-tiers {
    padding: 60px 2rem;
    background: var(--bg-card);
}

.pricing-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.pricing-card {
    position: relative;
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.pricing-card.recommended {
    border-color: var(--border-default);
    transform: scale(1.05);
}

.pricing-card.recommended:hover {
    transform: scale(1.05) translateY(-5px);
}

.card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #52796F;
    color: var(--text-on-accent);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tier-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tier-icon {
    font-size: 2.5rem;
}

.card-price {
    text-align: center;
    margin-bottom: 1.5rem;
}

.currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
    vertical-align: top;
}

.amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.period {
    color: var(--text-secondary);
    font-size: 1rem;
}

.card-storage {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-hover);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.storage-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #52796F;
    margin-bottom: 0.25rem;
}

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

.card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.card-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.card-features li:last-child {
    border-bottom: none;
}

.feature-icon {
    color: #52796F;
    font-weight: 700;
    font-size: 1.25rem;
}

.card-cta {
    width: 100%;
    padding: 1rem;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s;
}

.card-cta.primary {
    background: #52796F;
    color: var(--text-on-accent);
}

/* Storage Add-ons */
.storage-addons {
    padding: 60px 2rem;
    background: var(--bg-surface);
}

.addons-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.addons-container h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.addon-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.addon-card {
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.3s, transform 0.3s;
}

.addon-card:hover {
    border-color: var(--border-default);
    transform: translateY(-3px);
}

.addon-size {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.addon-price {
    color: #52796F;
    font-weight: 600;
}

/* Cost Sharing Section */
.cost-sharing {
    padding: 60px 2rem;
    background: var(--bg-card);
}

.sharing-container {
    max-width: 1000px;
    margin: 0 auto;
}

.sharing-container h2 {
    font-size: 2rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

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

.sharing-example {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.sharing-plan {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.sharing-plan h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.sharing-breakdown {
    margin-bottom: 1.5rem;
}

.contributor {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.contributor:last-child {
    border-bottom: none;
}

.contributor-role {
    color: var(--text-secondary);
}

.contributor-amount {
    font-weight: 600;
    color: #52796F;
}

.sharing-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.125rem;
}

.sharing-benefits {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.sharing-benefits h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.sharing-benefits ul {
    list-style: none;
    padding: 0;
}

.sharing-benefits li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
}

/* Feature Comparison */
.feature-comparison {
    padding: 60px 2rem;
    background: var(--bg-surface);
}

.comparison-container {
    max-width: 1200px;
    margin: 0 auto;
}

.comparison-container h2 {
    font-size: 2rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

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

.comparison-table {
    background: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.comparison-header,
.comparison-row {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    align-items: center;
}

.comparison-header {
    background: var(--bg-hover);
    font-weight: 700;
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.comparison-row {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row.highlight {
    background: var(--bg-card);
    font-weight: 700;
}

.feature-name {
    color: var(--text-secondary);
}

.comparison-header .feature-name {
    color: var(--text-primary);
}

.plan-header {
    text-align: center;
    color: var(--text-primary);
}

.feature-check {
    text-align: center;
    color: #52796F;
    font-size: 1.25rem;
    font-weight: 700;
}

.feature-value {
    text-align: center;
    color: #52796F;
    font-weight: 700;
}

/* FAQ Section */
.pricing-faq {
    padding: 60px 2rem;
    background: var(--bg-card);
}

.faq-container {
    max-width: 1000px;
    margin: 0 auto;
}

.faq-container h2 {
    font-size: 2rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.faq-item h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* CTA Section */
.pricing-cta {
    padding: 80px 2rem;
    background: linear-gradient(135deg, #2E5266 0%, #52796F 100%);
    text-align: center;
}

.cta-container h2 {
    font-size: 2.5rem;
    color: var(--text-on-accent);
    margin-bottom: 1rem;
}

.cta-container p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--bg-surface);
    color: #2E5266;
    border: none;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Footer */
.pricing-footer {
    padding: 2rem;
    background: #1f2937;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-on-accent);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pricing-header {
        background: rgba(31, 41, 55, 0.98);
        border-bottom-color: #374151;
    }
    
    .back-link {
        color: #9FB1BC;
    }
    
    .pricing-hero {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }
    
    .pricing-title,
    .tier-name,
    .amount,
    .faq-item h3,
    .comparison-container h2,
    .sharing-container h2,
    .addons-container h2 {
        color: var(--bg-hover);
    }
    
    .pricing-subtitle,
    .badge-text,
    .calc-input-group label,
    .estimate-label,
    .recommend-label,
    .period,
    .currency,
    .storage-description,
    .addons-subtitle,
    .sharing-subtitle,
    .comparison-subtitle,
    .faq-item p {
        color: var(--text-muted);
    }
    
    .pricing-philosophy-badge {
        background: rgba(82, 121, 111, 0.2);
        border-color: var(--border-default);
    }
    
    .calculator-container,
    .pricing-card,
    .sharing-plan,
    .sharing-benefits,
    .comparison-table,
    .faq-item {
        background: #1f2937;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .calculator-result {
        background: #111827;
    }
    
    .card-storage,
    .sharing-total,
    .comparison-header {
        background: #111827;
    }
    
    .pricing-tiers,
    .cost-sharing,
    .pricing-faq {
        background: #111827;
    }
    
    .storage-calculator-section,
    .storage-addons,
    .feature-comparison {
        background: #1f2937;
    }
    
    .addon-card {
        background: #111827;
        border-color: var(--border-default);
    }
    
    .card-features li,
    .contributor,
    .comparison-row {
        border-bottom-color: #374151;
    }
    
    .comparison-header {
        border-bottom-color: var(--text-secondary);
    }
    
    .feature-name,
    .contributor-role {
        color: #d1d5db;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pricing-title {
        font-size: 2rem;
    }
    
    .pricing-subtitle {
        font-size: 1rem;
    }
    
    .calc-input-group {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .calculator-result {
        grid-template-columns: 1fr;
    }
    
    .pricing-container {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.recommended {
        transform: none;
    }
    
    .sharing-example {
        grid-template-columns: 1fr;
    }
    
    .comparison-header,
    .comparison-row {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .plan-header,
    .feature-check,
    .feature-value {
        display: none;
    }
    
    .comparison-row.highlight .feature-value {
        display: block;
        margin-top: 0.5rem;
        text-align: left;
    }
    
    .comparison-row.highlight .feature-value::before {
        content: "Storage: ";
        color: var(--text-secondary);
        font-weight: normal;
    }
}

@media (max-width: 480px) {
    .pricing-hero {
        padding: 100px 1rem 40px;
    }
    
    .calculator-container {
        padding: 2rem 1.5rem;
    }
    
    .pricing-card {
        padding: 1.5rem;
    }
    
    .amount {
        font-size: 2.5rem;
    }
    
    .cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}/* Contribute Page Styles */

.contribute-main {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    background-color: var(--bg-color);
}

.contribute-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contribute-header h2 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.contribute-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

/* Content Type Selector */
.content-type-selector {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.content-type-selector h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.type-card {
    padding: 1.5rem;
    background-color: var(--bg-color);
    border: 2px solid transparent;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

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

.type-card.active {
    border-color: var(--primary-color);
    background-color: var(--primary-bg-light);
}

.type-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.type-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.type-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Contribution Form */
#contribution-form {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--bg-color);
    position: relative;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-bg-light);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: var(--primary-bg-light);
    transform: scale(1.02);
}

.file-upload-area.uploading {
    cursor: not-allowed;
    opacity: 0.7;
}

.file-upload-area.has-files {
    border-style: solid;
    border-color: var(--success-color);
    background-color: var(--success-bg-light);
}

.upload-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-prompt p {
    margin: 0.25rem 0;
}

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

/* File Preview */
.file-preview {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.file-preview-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: var(--bg-color);
}

.file-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.file-preview-item .file-icon {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background-color: var(--white);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.file-preview-item .file-name {
    font-size: 0.75rem;
    word-break: break-all;
    color: var(--text-color);
}

.file-preview-item .file-size {
    font-size: 0.75rem;
    color: var(--text-light);
}

.file-preview-item .remove-file {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: var(--error-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
}

.file-preview-item .remove-file:hover {
    background-color: var(--error);
}

/* File validation indicators */
.file-preview-item.invalid {
    border-color: var(--error);
    background-color: var(--error-bg-light);
}

.file-validation-error {
    font-size: 0.75rem;
    color: var(--error-dark);
    margin-top: 0.25rem;
}

.file-preview-item.processing {
    opacity: 0.7;
    position: relative;
}

.file-preview-item.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-default);
    border-top-color: var(--link);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Smart suggestions */
.upload-suggestions {
    background-color: var(--warning-bg-light);
    border: 1px solid var(--warning-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.upload-suggestions h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--warning-dark);
}

.suggestion-list {
    font-size: 0.875rem;
    color: var(--warning-dark);
    margin: 0;
    padding-left: 1.5rem;
}

.suggestion-list li {
    margin-bottom: 0.25rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Info icons and tooltips */
.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 0.25rem;
    color: var(--text-light);
    cursor: help;
    position: relative;
}

.info-icon:hover {
    color: var(--primary-color);
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-color);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.5rem;
    max-width: 250px;
    white-space: normal;
    text-align: center;
}

.info-icon:hover .tooltip {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-color);
}

/* Enhanced Audio Recording */
.audio-recorder {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--primary-bg-light) 100%);
    border: 2px solid var(--border-default);
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem 0;
    box-shadow: var(--shadow);
}

.audio-recorder-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.audio-recorder-header h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.recording-tips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    background-color: var(--warning-bg-light);
    border: 1px solid var(--warning-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.tip-icon {
    font-size: 1rem;
}

.audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.audio-controls button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.record-btn {
    background-color: var(--error);
    color: var(--text-on-accent);
}

.record-btn:hover {
    background-color: var(--error-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.record-btn.paused:hover {
    background-color: var(--success-dark);
}

.pause-btn, .stop-btn {
    background-color: var(--text-secondary);
    color: var(--text-on-accent);
}

.pause-btn:hover, .stop-btn:hover {
    background-color: var(--text-secondary);
    transform: translateY(-1px);
}

.pause-btn.active, .stop-btn.active {
    background-color: var(--error);
}

.pause-btn.active:hover, .stop-btn.active:hover {
    background-color: var(--error-dark);
}

.recording-status {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: center;
}

.audio-level-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.audio-level-container label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.audio-level-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.audio-level-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 4px;
    transition: width 0.1s ease, background-color 0.2s ease;
    width: 0%;
}

.level-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
}

.recording-timer {
    text-align: center;
}

.timer-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--error);
    font-family: 'Courier New', monospace;
}

.recording-quality {
    text-align: center;
}

.quality-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.quality-indicator {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-indicator.quality-good {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.quality-indicator.quality-low {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
}

.quality-indicator.quality-poor {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

.recording-feedback {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.voice-activity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

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

.activity-indicator {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    background-color: var(--error-bg-light);
    color: var(--error-dark);
    text-transform: uppercase;
    font-size: 0.75rem;
}

.activity-indicator.active {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.audio-preview {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.audio-preview h5 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.preview-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.preview-controls audio {
    width: 100%;
    max-width: 400px;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.preview-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: var(--text-on-accent);
}

.btn-secondary:hover {
    background-color: var(--text-secondary);
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--success-color);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background-color: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.audio-error, .audio-warning {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.audio-error {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
    border: 1px solid var(--error-border);
}

.audio-warning {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-border);
}

/* Recording animation */
@keyframes recording-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--error-glow);
    }
    70% {
        box-shadow: 0 0 0 10px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.record-btn.recording {
    animation: recording-pulse 2s infinite;
}

.audio-timer {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .audio-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .audio-controls button {
        min-width: 200px;
    }
    
    .recording-status {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .preview-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .preview-actions button {
        width: 100%;
    }
}

/* Enhanced Upload Components */
.upload-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-card-alpha);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    z-index: 10;
}

.upload-progress-container {
    width: 80%;
    max-width: 400px;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.upload-progress-fill {
    height: 100%;
    background-color: var(--link);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 600;
}

.upload-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-surface);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

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

.upload-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.upload-stat-label {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* File Type Indicators */
.file-type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--primary-color);
    color: var(--text-on-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.file-type-badge.image {
    background-color: var(--link);
}

.file-type-badge.audio {
    background-color: var(--secondary-color);
}

.file-type-badge.document {
    background-color: var(--warning-color);
}

.file-type-badge.video {
    background-color: var(--error);
}

/* Batch Upload Actions */
.batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: var(--bg-surface);
    border-radius: 0.5rem;
}

.batch-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.batch-select input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.batch-select label {
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.batch-buttons {
    display: flex;
    gap: 0.5rem;
}

.batch-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.batch-btn.remove {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

.batch-btn.remove:hover {
    background-color: var(--error-bg-light);
}

.batch-btn.organize {
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
}

.batch-btn.organize:hover {
    background-color: var(--primary-bg-medium);
}

/* File Organization */
.file-organizer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-group {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    padding: 1rem;
}

.file-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.file-group-title {
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-group-count {
    background-color: var(--bg-hover);
    color: var(--text-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.file-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-group-item {
    font-size: 0.875rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* OCR Preview Styles */
.ocr-preview {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    margin: 1rem 0;
    overflow: hidden;
}

.ocr-header {
    background-color: var(--bg-surface);
    padding: 1rem;
    border-bottom: 1px solid var(--border-default);
}

.ocr-header h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.ocr-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.ocr-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confidence-value {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.confidence-value.high {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
}

.confidence-value.medium {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
}

.confidence-value.low {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
}

.doc-type {
    font-weight: 600;
    color: var(--primary-color);
}

.ocr-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1rem 0;
    background-color: var(--bg-surface);
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem 0.375rem 0 0;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    background-color: var(--bg-surface);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    padding: 1.5rem;
    background-color: var(--bg-surface);
}

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

.extracted-text {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background-color: var(--bg-surface);
    padding: 1rem;
    border-radius: 0.375rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.ocr-line {
    margin: 0.5rem 0;
    position: relative;
}

.ocr-line.low::before {
    content: '⚠️';
    position: absolute;
    left: -1.5rem;
    top: 0;
}

.ocr-word {
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    cursor: help;
}

.ocr-word.low {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
    text-decoration: underline wavy var(--error);
}

.ocr-word.medium {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
}

.text-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-default);
    border-radius: 0.375rem;
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background-color: var(--bg-surface);
    border-color: var(--border-default);
}

.save-btn {
    background-color: var(--link);
    color: var(--text-on-accent);
    border-color: var(--link);
}

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

/* Entities Display */
.entities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.entity-group h5 {
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
    font-size: 1rem;
}

.entity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.entity-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-bg-light);
    color: var(--primary-dark);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Confidence Map */
.confidence-overview {
    display: grid;
    gap: 1.5rem;
}

.confidence-chart {
    display: flex;
    height: 40px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px var(--shadow-color);
}

.conf-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0 0.5rem;
    transition: width 0.3s ease;
}

.conf-bar.high {
    background-color: var(--success-color);
}

.conf-bar.medium {
    background-color: var(--warning-color);
}

.conf-bar.low {
    background-color: var(--error);
}

.confidence-details {
    background-color: var(--bg-surface);
    padding: 1rem;
    border-radius: 0.375rem;
}

.confidence-details p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* OCR Processing Indicator */
.ocr-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: var(--bg-surface);
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.ocr-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-default);
    border-top-color: var(--link);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.ocr-progress {
    width: 200px;
    height: 4px;
    background-color: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.ocr-progress-fill {
    height: 100%;
    background-color: var(--link);
    border-radius: 2px;
    transition: width 0.3s ease;
}

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

/* OCR Integration */
.ocr-container {
    margin: 1rem 0;
}

.ocr-btn {
    background-color: var(--secondary-color);
    color: var(--text-on-accent);
    border: none;
}

.ocr-btn:hover {
    background-color: var(--secondary-dark);
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background-color: var(--success-bg-light);
    color: var(--success-dark);
    border: 1px solid var(--success-border);
}

.alert-warning {
    background-color: var(--warning-bg-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-border);
}

.alert-error {
    background-color: var(--error-bg-light);
    color: var(--error-dark);
    border: 1px solid var(--error-border);
}

/* Responsive */
@media (max-width: 768px) {
    .type-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .batch-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .batch-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .ocr-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .entities-grid {
        grid-template-columns: 1fr;
    }
}/* Beta Feedback Component Styles */

.beta-feedback-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

/* Beta Feedback Modal */
.beta-feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.beta-feedback-modal.active {
    display: flex;
}

.beta-feedback-content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.beta-feedback-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.beta-feedback-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.beta-feedback-close:hover {
    color: var(--text-primary);
}

.beta-feedback-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.beta-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
}

.feedback-type-option {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.feedback-type-option:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.feedback-type-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.feedback-type-option i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.feedback-textarea {
    min-height: 120px;
    resize: vertical;
}

.feedback-rating {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.feedback-rating .star {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
}

.feedback-rating .star:hover,
.feedback-rating .star.active {
    color: var(--warning);
}

.beta-feedback-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Success Message */
.beta-feedback-success {
    text-align: center;
    padding: 2rem;
}

.beta-feedback-success i {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.beta-feedback-success h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.beta-feedback-success p {
    color: var(--text-secondary);
    margin: 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .beta-feedback-button {
        bottom: 1rem;
        right: 1rem;
    }
    
    .beta-feedback-content {
        margin: 1rem;
    }
    
    .feedback-type-selector {
        grid-template-columns: 1fr 1fr;
    }
}

/* Dark Theme */
.theme-dark .beta-feedback-content {
    background: var(--bg-elevated);
}

.theme-dark .feedback-type-option {
    background: var(--bg-card);
}

.theme-dark .feedback-type-option.selected {
    background: rgba(var(--primary-rgb), 0.2);
}/**
 * Upload Zones CSS
 * Styles for PhotoUploader, AudioStudio, and DocumentScanner components
 */

/* ============================================
   Common Styles
   ============================================ */

:root {
    --upload-bg: var(--bg-surface);
    --upload-border: var(--border-color);
    --upload-hover: var(--bg-hover);
    --upload-active: var(--primary-color);
    --upload-success: var(--success-color);
    --upload-error: var(--error-color);
    --upload-warning: var(--warning-color);
    --upload-info: var(--info-color);
}

/* Notifications */
.photo-notification,
.studio-notification,
.scanner-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 350px;
}

.photo-notification.show,
.studio-notification.show,
.scanner-notification.show {
    transform: translateX(0);
}

.photo-notification.success,
.studio-notification.success,
.scanner-notification.success {
    border-left: 4px solid var(--upload-success);
}

.photo-notification.error,
.studio-notification.error,
.scanner-notification.error {
    border-left: 4px solid var(--upload-error);
}

.photo-notification.warning,
.studio-notification.warning,
.scanner-notification.warning {
    border-left: 4px solid var(--upload-warning);
}

.photo-notification.info,
.studio-notification.info,
.scanner-notification.info {
    border-left: 4px solid var(--upload-info);
}

/* ============================================
   PhotoUploader Styles
   ============================================ */

.photo-uploader {
    width: 100%;
}

/* Upload Zone */
.upload-zone {
    background: var(--upload-bg);
    border: 2px dashed var(--upload-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--upload-active);
    background: var(--upload-hover);
}

.upload-zone.dragover {
    border-color: var(--upload-active);
    background: var(--primary-bg-light);
    transform: scale(1.02);
}

.upload-zone.has-photos {
    padding: 1.5rem;
    background: var(--bg-surface);
}

.upload-zone.has-photos .upload-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
}

.upload-zone.has-photos .upload-icon {
    width: 60px;
    height: 60px;
}

.upload-icon svg {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.upload-zone:hover .upload-icon svg {
    color: var(--upload-active);
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1rem 0 0.5rem;
}

.upload-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-color);
}

.browse-button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.browse-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.photo-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: move;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-item.dragging {
    opacity: 0.5;
}

.photo-item.enhancing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.photo-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 aspect ratio */
}

.photo-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.photo-action {
    flex: 1;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-action:hover {
    background: var(--bg-surface);
    transform: scale(1.05);
}

.photo-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.enhanced-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--upload-success);
    color: var(--text-on-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.old-photo-indicator {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--upload-warning);
    color: var(--text-on-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.photo-caption {
    padding: 0.75rem;
}

.caption-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.caption-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.action-btn.danger {
    color: var(--upload-error);
}

.action-btn.danger:hover {
    background: var(--upload-error);
    color: var(--text-on-accent);
    border-color: var(--upload-error);
}

/* ============================================
   AudioStudio Styles
   ============================================ */

.audio-studio {
    width: 100%;
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.studio-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.quality-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.quality-indicator.quality-good {
    background: var(--success-bg-light);
    color: var(--upload-success);
}

.quality-indicator.quality-low {
    background: var(--warning-bg-light);
    color: var(--upload-warning);
}

.quality-indicator.quality-high {
    background: var(--error-bg-light);
    color: var(--upload-error);
}

/* Recording Interface */
.recording-interface {
    margin-bottom: 2rem;
}

.waveform-container {
    position: relative;
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    min-height: 200px;
}

#waveform-canvas {
    width: 100%;
    height: 200px;
    display: block;
}

.waveform-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.waveform-overlay.recording {
    background: rgba(var(--primary-rgb), 0.05);
}

.start-prompt {
    text-align: center;
    color: var(--text-muted);
}

.start-prompt i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Control Panel */
.control-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.timer-display {
    font-size: 2rem;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    color: var(--text-color);
}

.timer-max {
    font-size: 1rem;
    color: var(--text-muted);
}

.main-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.control-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.record-btn {
    border-color: var(--upload-error);
}

.record-btn.recording {
    background: var(--upload-error);
    color: var(--text-on-accent);
    animation: recording-pulse 2s infinite;
}

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--error-rgb), 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(var(--error-rgb), 0); }
}

.record-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.record-btn:not(.recording) .record-icon {
    color: var(--upload-error);
}

/* Volume Meter */
.volume-meter {
    width: 100%;
    max-width: 400px;
}

.meter-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.meter-bar {
    position: relative;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(to right, var(--upload-success), var(--upload-warning), var(--upload-error));
    transition: width 0.1s ease;
    border-radius: 4px;
}

.meter-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.marker.low { color: var(--upload-success); }
.marker.good { color: var(--upload-warning); }
.marker.high { color: var(--upload-error); }

/* Playback Section */
.playback-section {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.playback-section h4 {
    margin: 0 0 1rem;
    color: var(--text-color);
}

#audio-player {
    width: 100%;
    margin-bottom: 1rem;
}

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

.recording-actions .action-btn {
    flex: 1;
    min-width: 120px;
}

/* Transcription Section */
.transcription-section {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

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

.transcription-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-color);
}

.edit-transcription-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-transcription-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.transcription-content {
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-height: 100px;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.transcription-content[contenteditable="true"] {
    border-color: var(--primary-color);
    outline: none;
}

.transcription-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.copy-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.copy-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

/* Recording Tips */
.recording-tips {
    background: var(--info-bg-light);
    border-left: 4px solid var(--upload-info);
    border-radius: 6px;
    padding: 1rem;
}

.recording-tips h5 {
    margin: 0 0 0.75rem;
    color: var(--text-color);
}

.recording-tips ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.recording-tips li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.recording-tips li i {
    color: var(--upload-info);
    width: 20px;
}

/* ============================================
   DocumentScanner Styles
   ============================================ */

.document-scanner {
    width: 100%;
}

/* Document Type Selector */
.document-type-selector {
    margin-bottom: 2rem;
    text-align: center;
}

.document-type-selector h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.type-btn.selected {
    background: var(--primary-bg-light);
    border-color: var(--primary-color);
}

.type-btn i {
    font-size: 2rem;
    color: var(--text-muted);
}

.type-btn.selected i {
    color: var(--primary-color);
}

.type-btn span {
    font-size: 0.875rem;
    color: var(--text-color);
}

/* Document Upload Zone */
.document-upload-zone {
    background: var(--upload-bg);
    border: 2px dashed var(--upload-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.document-upload-zone:hover {
    border-color: var(--upload-active);
    background: var(--upload-hover);
}

.document-upload-zone.dragover {
    border-color: var(--upload-active);
    background: var(--primary-bg-light);
    transform: scale(1.02);
}

.upload-illustration svg {
    color: var(--text-muted);
    opacity: 0.5;
}

.document-upload-zone h4 {
    margin: 1rem 0 0.5rem;
    color: var(--text-color);
}

.document-upload-zone p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.browse-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--text-on-accent);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.browse-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Document List */
.document-list {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.document-list h4 {
    margin: 0 0 1rem;
    color: var(--text-color);
}

.document-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.document-item.processed {
    border-color: var(--upload-success);
}

.doc-icon {
    font-size: 2rem;
    color: var(--text-muted);
}

.doc-info {
    flex: 1;
}

.doc-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.doc-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.doc-status {
    color: var(--upload-success);
}

.doc-actions {
    display: flex;
    gap: 0.5rem;
}

.view-doc,
.remove-doc {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-doc:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.remove-doc:hover {
    background: var(--upload-error);
    color: var(--text-on-accent);
    border-color: var(--upload-error);
}

/* Document Viewer */
.document-viewer {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
}

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

.back-to-list {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-list:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

#document-title {
    flex: 1;
    text-align: center;
    margin: 0;
    color: var(--text-color);
}

.viewer-tools {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

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

.document-preview {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-image {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pdf-preview,
.file-preview {
    text-align: center;
    color: var(--text-muted);
}

.pdf-preview i,
.file-preview i {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Extraction Panel */
.extraction-panel {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 1.5rem;
}

.extraction-panel h5 {
    margin: 0 0 1rem;
    color: var(--text-color);
}

.ocr-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.ocr-progress p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Field Groups */
.extracted-fields,
.manual-fields {
    margin-bottom: 1.5rem;
}

.manual-fields h6 {
    margin: 0 0 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.field-group {
    margin-bottom: 1rem;
}

.field-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.field-input {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    transition: border-color 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.field-input.extracted {
    background: var(--info-bg-light);
    border-color: var(--upload-info);
}

textarea.field-input {
    resize: vertical;
    font-family: inherit;
}

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

.extraction-actions .btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-secondary:hover {
    background: var(--bg-surface);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-on-accent);
}

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

/* Document Actions */
.document-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .viewer-content {
        grid-template-columns: 1fr;
    }
    
    .upload-features {
        flex-direction: column;
        align-items: center;
    }
    
    .main-controls {
        flex-direction: column;
    }
    
    .recording-actions {
        flex-direction: column;
    }
    
    .document-actions {
        flex-direction: column;
    }
    
    .extraction-actions {
        flex-direction: column;
    }
}