/* ===============================================
   Modern Design System - Light Mode
   =============================================== */

/* CSS Variables for Light Mode */
:root {
  /* Modern Color Palette - Emerald/Teal Accent */
  --color-primary: #10b981;
  --color-primary-hover: #059669;
  --color-primary-light: rgba(16, 185, 129, 0.1);
  --color-primary-rgb: 16, 185, 129;

  /* Secondary Colors */
  --color-secondary: #6366f1;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #06b6d4;

  /* Background Colors */
  --color-background: #ffffff;
  --color-background-secondary: #f9fafb;
  --color-background-tertiary: #f3f4f6;
  --color-surface: #ffffff;
  --color-surface-secondary: #f9fafb;
  --color-surface-tertiary: #f3f4f6;

  /* Text Colors - High Contrast for Readability */
  --color-text-primary: #111827;
  --color-text-secondary: #374151;
  --color-text-tertiary: #6b7280;
  --color-text-quaternary: #9ca3af;

  /* Border Colors */
  --color-border-primary: #d1d5db;
  --color-border-secondary: #e5e7eb;
  --color-separator: rgba(0, 0, 0, 0.1);

  /* Modern Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Border Radius - Modern Style */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Typography */
  --font-family-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
    sans-serif;
  --font-family-mono: 'SF Mono', ui-monospace, 'Cascadia Code',
    'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;

  /* Font Sizes - Apple Typography Scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 19px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 34px;
  --text-5xl: 40px;

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.4;
  --leading-relaxed: 1.6;

  /* Font Weights - Apple Style */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Aliases to harmonize older/custom styles */
  --primary-color: var(--color-primary);
  --primary-hover: var(--color-primary-hover);
  --secondary-color: var(--color-secondary);
  --success-color: var(--color-success);
  --warning-color: var(--color-warning);
  --danger-color: var(--color-error);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-tertiary);
  --border-color: var(--color-border-secondary);
  --radius: var(--radius-lg);
  --light-bg: var(--color-surface-secondary);
  --card-bg: var(--color-surface);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
}

/* ===============================================
   Base Styles
   =============================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: 15px; /* Apple's base font size */
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-system);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary) !important;
  background-color: var(--color-background) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal),
    color var(--transition-normal);
}

/* Force text colors to override Bootstrap defaults */
div,
span,
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
td,
th,
label {
  color: inherit;
}

/* Bootstrap text overrides */
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
  color: white !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* ===============================================
   Typography
   =============================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--spacing-md) 0;
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary) !important;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
}
h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
}
h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
}
h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}
h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
}
h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

p {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--color-text-secondary) !important;
}

ul,
ol {
  margin: 0 0 var(--spacing-md) 0;
  padding-left: var(--spacing-lg);
  color: #111827 !important;
}

li {
  margin-bottom: var(--spacing-xs);
  color: #111827 !important;
  line-height: 1.6;
}

ul li,
ol li {
  color: #111827 !important;
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary) !important;
}

/* Report Content Styling - Ensure Visibility */
.report-content,
.report-content * {
  color: #111827 !important;
}

.report-content h1,
.report-content h2,
.report-content h3,
.report-content h4,
.report-content h5,
.report-content h6 {
  color: #111827 !important;
  font-weight: 600;
}

.report-content p,
.report-content ul,
.report-content ol,
.report-content li {
  color: #111827 !important;
}

.report-content a {
  color: #10b981 !important;
}

/* ===============================================
   Buttons - Apple Style
   =============================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: 0;
  font-family: var(--font-family-system);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: var(--leading-tight);
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background-color: transparent;
  color: black;
  transition: all var(--transition-fast);
  user-select: none;
  min-height: 44px; /* Apple's minimum touch target */
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-secondary {
  background-color: var(--color-surface-secondary);
  border-color: var(--color-border-secondary);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  background-color: var(--color-surface-tertiary);
  box-shadow: var(--shadow-xs);
}

.btn-success {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.btn-warning {
  background-color: var(--color-warning);
  border-color: var(--color-warning);
  color: white;
}

.btn-danger {
  background-color: var(--color-error);
  border-color: var(--color-error);
  color: white;
}

.btn-outline-primary {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline-primary:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline-secondary {
  background-color: transparent;
  border-color: var(--color-border-primary);
  color: var(--color-text-secondary);
}

.btn-outline-secondary:hover {
  background-color: var(--color-surface-secondary);
  border-color: var(--color-border-primary);
  color: var(--color-text-primary);
}

/* Button Sizes */
.btn-sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--text-sm);
  min-height: 32px;
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--text-lg);
  min-height: 52px;
}

/* ===============================================
   Cards - Apple Style
   =============================================== */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--spacing-lg);
  background-color: var(--color-surface-secondary);
  border-bottom: 1px solid var(--color-border-secondary);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--color-surface-secondary);
  border-top: 1px solid var(--color-border-secondary);
}

.card-title {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

.card-text {
  margin: 0;
  color: var(--color-text-secondary);
}

/* ===============================================
   Forms - Apple Style
   =============================================== */

.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 44px;
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-control::placeholder {
  color: var(--color-text-tertiary);
  opacity: 1;
}

.form-label {
  display: inline-block;
  margin-bottom: var(--spacing-xs);
  font-weight: var(--font-medium);
}

.form-select {
  appearance: none;
  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 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--spacing-sm) center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  padding-right: var(--spacing-xl);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===============================================
   Navigation - Modern Light Theme
   =============================================== */

.navbar {
  background-color: #ffffff;
  border-bottom: 2px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.navbar-brand {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: #111827 !important;
  text-decoration: none;
}

/* Scope navbar links to prevent collision with pills */
.navbar .nav-link {
  color: #374151 !important;
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #10b981 !important;
  background-color: #ecfdf5;
}

/* Dropdown styling */
.dropdown-menu {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
}

.dropdown-item {
  color: #374151;
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background-color: #f9fafb;
  color: #10b981;
}

.dropdown-divider {
  border-color: #e5e7eb;
}

/* Map Bootstrap pill active color to our primary */
:root {
  --bs-nav-pills-link-active-bg: var(--color-primary);
  --bs-nav-pills-link-active-color: #fff;
}

/* Ensure pills follow variables */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--bs-nav-pills-link-active-bg);
  color: var(--bs-nav-pills-link-active-color);
}

/* Navbar toggler contrast fix */
.navbar .navbar-toggler {
  border-color: var(--color-border-primary);
}
.navbar .navbar-toggler-icon {
  filter: invert(0);
}

/* ===============================================
   Alerts - Apple Style
   =============================================== */

.alert {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-weight: var(--font-medium);
}

.alert-success {
  background-color: rgba(52, 199, 89, 0.1);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-info {
  background-color: rgba(0, 122, 255, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.alert-warning {
  background-color: rgba(255, 149, 0, 0.1);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.alert-danger {
  background-color: rgba(255, 59, 48, 0.1);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* ===============================================
   Badges - Apple Style
   =============================================== */

.badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1;
  color: white;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius-full);
}

.bg-primary {
  background-color: var(--color-primary) !important;
}
.bg-secondary {
  background-color: var(--color-secondary) !important;
}
.bg-success {
  background-color: var(--color-success) !important;
}
.bg-warning {
  background-color: var(--color-warning) !important;
}
.bg-danger {
  background-color: var(--color-error) !important;
}
.bg-info {
  background-color: var(--color-info) !important;
}
.bg-light {
  background-color: var(--color-surface-secondary) !important;
  color: var(--color-text-primary) !important;
}

/* ===============================================
   Modals - Apple Style
   =============================================== */

.modal-content {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border-secondary);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--color-border-secondary);
}

.modal-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

/* ===============================================
   Lists - Apple Style
   =============================================== */

.list-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  border-radius: var(--radius-lg);
}

.list-group-item {
  position: relative;
  display: block;
  color: var(--color-text-primary);
  padding: 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-secondary);
  margin-bottom: -1px;
}

.list-group-item:first-child {
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.list-group-item:last-child {
  border-bottom-right-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.list-group-flush .list-group-item {
  border-width: 0 0 1px;
  border-radius: 0;
}

/* ===============================================
   Tabs - Apple Style
   =============================================== */

.nav-tabs {
  border-bottom: 1px solid var(--color-border-secondary);
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
}

.nav-tabs .nav-link:hover {
  border-color: var(--color-border-secondary);
  background-color: var(--color-surface-secondary);
}

.nav-tabs .nav-link.active {
  color: var(--color-primary);
  background-color: var(--color-surface);
  border-color: var(--color-border-secondary);
  border-bottom-color: var(--color-surface);
}

/* ===============================================
   Utilities
   =============================================== */

/* Text Colors */
.text-primary {
  color: var(--color-primary) !important;
}
.text-secondary {
  color: var(--color-text-secondary) !important;
}
.text-tertiary {
  color: var(--color-text-tertiary) !important;
}
.text-success {
  color: var(--color-success) !important;
}
.text-warning {
  color: var(--color-warning) !important;
}
.text-danger {
  color: var(--color-error) !important;
}
.text-info {
  color: var(--color-info) !important;
}
.text-muted {
  color: var(--color-text-tertiary) !important;
}

/* Background Colors */
.bg-surface {
  background-color: var(--color-surface) !important;
}
.bg-surface-secondary {
  background-color: var(--color-surface-secondary) !important;
}

/* Shadows */
.shadow-xs {
  box-shadow: var(--shadow-xs);
}
.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Smooth transitions for theme switching */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: var(--transition-normal);
  transition-timing-function: ease;
}

/* Global subtle entrance animation */
.animate-fade-in {
  animation: fadeInUp var(--transition-slow);
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* File upload styles */
.input-file {
  cursor: pointer;
}

.input-file:hover {
  opacity: 0.8;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-primary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* Bootstrap overrides for consistency */
.btn-close {
  filter: invert(1);
  opacity: 0.5;
}

.btn-close:hover {
  opacity: 0.75;
}

.btn-close {
  filter: invert(0);
}

/* ===============================================
   Bootstrap Component Overrides
   =============================================== */

/* Ensure all text inherits proper colors */
.container,
.container-fluid,
.row,
.col,
[class*='col-'] {
  color: var(--color-text-primary) !important;
}

/* Card text colors */
.card-title,
.card-text,
.card-subtitle {
  color: var(--color-text-primary) !important;
}

.card-text {
  color: var(--color-text-secondary) !important;
}

/* Table colors */
.table {
  color: var(--color-text-primary) !important;
}

.table td,
.table th {
  border-color: var(--color-border-secondary) !important;
}

/* Form labels */
.form-label,
label {
  color: var(--color-text-primary) !important;
}

/* Form placeholders - ensure good readability */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder,
input::placeholder {
  color: var(--color-text-tertiary) !important;
  opacity: 1;
}

/* List groups */
.list-group-item {
  color: var(--color-text-primary) !important;
  background-color: var(--color-surface) !important;
  border-color: var(--color-border-secondary) !important;
}

/* Breadcrumbs and other nav elements */
.breadcrumb-item {
  color: var(--color-text-secondary) !important;
}

.breadcrumb-item.active {
  color: var(--color-text-primary) !important;
}

/* Small text and muted content */
.text-muted,
.small,
small {
  color: var(--color-text-tertiary) !important;
}

/* Ensure main content areas use proper background */
main,
.main-content,
.content {
  background-color: var(--color-background) !important;
  color: var(--color-text-primary) !important;
}

/* Default link colors that work in both modes */
a {
  color: var(--color-primary) !important;
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover) !important;
}

/* ===============================================
   Validation Styles - Apple Style
   =============================================== */

.invalid {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.valid.modified:not([type='checkbox']) {
  border-color: var(--color-success) !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

.validation-message {
  color: var(--color-error);
  font-size: var(--text-sm);
  margin-top: var(--spacing-xs);
  display: block;
}

/* ===============================================
   Error Boundary - Apple Style
   =============================================== */

.blazor-error-boundary {
  background: linear-gradient(135deg, var(--color-error), #dc2626);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  color: white;
  margin: var(--spacing-lg) 0;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.blazor-error-boundary::before {
  content: '⚠️';
  font-size: var(--text-xl);
  margin-right: var(--spacing-sm);
}

.blazor-error-boundary::after {
  content: 'An error has occurred. Please try again or contact support.';
}

/* ===============================================
   Form Enhancements
   =============================================== */

.form-check-input {
  border-color: var(--color-border-primary);
  background-color: var(--color-surface);
}

.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--color-text-tertiary);
  text-align: end;
}

/* ===============================================
   Layout Utilities
   =============================================== */

.content {
  padding: var(--spacing-2xl) var(--spacing-lg);
  /* max-width: 1400px; */
  margin: 0 auto;
}

/* Typography improvements */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: var(--spacing-lg);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-2xl);
}
h4 {
  font-size: var(--text-xl);
}
h5 {
  font-size: var(--text-lg);
}
h6 {
  font-size: var(--text-base);
}

h1:focus {
  outline: none;
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ===============================================
   Special Components
   =============================================== */

/* Decorative / marketing / auth specific styles removed for lean core. */
.status-busy {
  color: var(--color-warning);
}

/* ===============================================
   File Tree Styles
   =============================================== */

.file-tree {
  font-family: var(--font-family-system);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.file-tree-node {
  margin: 0;
}

.file-tree-item {
  display: block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-xs);
  margin: 1px 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
}

.file-tree-item:hover {
  background-color: var(--color-surface-secondary);
}

.file-tree-item.selected {
  background-color: var(--color-primary);
  color: white;
}

.file-tree-item.selected .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
}

.file-tree-item.folder {
  font-weight: var(--font-medium);
  border-left: 3px solid transparent;
}

.file-tree-item.folder.expanded {
  border-left-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.file-tree-item.file {
  margin-left: 20px;
  padding-left: 24px;
  border-left: 1px solid var(--color-border-secondary);
}

.file-tree-item.file:before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 12px;
  height: 1px;
  background-color: var(--color-border-secondary);
}

.file-tree-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.file-tree-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.file-tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree-toggle {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.file-tree-actions {
  display: none;
  gap: var(--spacing-xs);
}

.file-tree-item:hover .file-tree-actions {
  display: flex;
}

.file-tree-meta {
  margin-top: 2px;
  margin-left: 28px;
  font-size: var(--text-xs);
}

.file-tree-children {
  margin-left: 0;
}

.file-tree-item.empty {
  margin-left: 20px;
  font-style: italic;
  opacity: 0.7;
}

.search-highlight {
  background-color: #ffd700;
  color: #000;
  font-weight: var(--font-semibold);
  padding: 1px 2px;
  border-radius: var(--radius-xs);
}

.file-tree-item.folder.expanded {
  background-color: rgba(0, 122, 255, 0.15);
}

.file-tree-item:hover {
  background-color: var(--color-surface-tertiary) !important;
}

.file-tree-item:hover .file-tree-label,
.file-tree-item:hover .file-tree-label span {
  color: var(--color-text-primary) !important;
}

.file-tree-item:hover .file-tree-meta {
  color: var(--color-text-secondary) !important;
}

.search-highlight {
  background-color: #ffd700;
  color: #000;
}

.file-tree-item.file:before {
  background-color: rgba(255, 255, 255, 0.2);
}

.file-tree-item.file {
  border-left-color: rgba(255, 255, 255, 0.2);
}

.file-tree-item.selected {
  background-color: var(--color-primary) !important;
  color: white !important;
}

.file-tree-item.selected *,
.file-tree-item.selected .file-tree-label,
.file-tree-item.selected .file-tree-label span,
.file-tree-item.selected .file-tree-meta {
  color: white !important;
}

.status-error {
  color: var(--color-error);
}

/* Responsive helpers */
@media (max-width: 768px) {
  .content {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  h1 {
    font-size: var(--text-3xl);
  }
  h2 {
    font-size: var(--text-2xl);
  }
  h3 {
    font-size: var(--text-xl);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
  }
}
.darker-border-checkbox.form-check-input {
  border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* File Upload Styles */
.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  background: var(--light-bg);
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

.file-upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
}

.file-list {
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.file-item:last-child {
  border-bottom: none;
}

.file-icon {
  color: var(--primary-color);
  margin-right: 0.75rem;
}

/* File Upload Section Fade Animations */
.file-upload-section {
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out,
    max-height 0.5s ease-in-out;
  overflow: hidden;
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
  max-height: 1000px;
  animation: fadeInUp 0.5s ease-out;
}

.fade-out {
  opacity: 0;
  transform: translateY(-20px);
  max-height: 0;
  margin: 0;
  padding: 0;
  animation: fadeOutUp 0.5s ease-in forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Progress and Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.progress-bar {
  height: 8px;
  background: var(--light-bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-hover)
  );
  transition: width 0.3s ease;
}

/* Alert Styles - Enhanced for dark theme */
.alert {
  border: none;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success-color);
  color: #6ee7b7;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger-color);
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning-color);
  color: #fbbf24;
}

/* Badge Styles */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.badge-primary {
  background-color: var(--primary-color);
  color: white;
}

.badge-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.badge-coming-soon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Feedback Styles */
.feedback-section {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.rating-slider {
  border-radius: black;
  padding: 1rem;
  margin: 1rem 0;
}

.rating-display {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Response Container */
.response-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.response-container h1,
.response-container h2,
.response-container h3 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.response-container p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.response-container ul,
.response-container ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.response-container li {
  margin-bottom: 0.5rem;
}

/* Question Form Styles */
.question-form {
}

.question-step {
  margin-bottom: 1.5rem;
}

.question-step label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.question-step input[type='text'] {
  width: 100%;
}

/* Enhanced Dark Theme Effects */
.text-gradient {
  background: linear-gradient(
    135deg,
    var(--text-primary),
    var(--primary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.glow-text {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.glow-button {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
  transition: all 0.3s ease;
}

.glow-button:hover {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

.hero-section {
  background: linear-gradient(
    135deg,
    var(--light-bg) 0%,
    #1a202c 50%,
    var(--card-bg) 100%
  );
  position: relative;
  overflow: hidden;
  padding: 0px 40px 40px 40px;
  border-radius: 10px;
  box-shadow: inset;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(16, 185, 129, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(245, 158, 11, 0.1) 0%,
      transparent 50%
    );
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* Enhanced Authentication Styles */
.auth-container {
  min-height: 100vh;
  /* background: linear-gradient(
    135deg,
    var(--light-bg) 0%,
    #1a202c 50%,
    var(--card-bg) 100%
  ); */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(59, 130, 246, 0.1);
  padding: 3rem;
  width: 100%;
  max-width: 600px;
  position: relative;
  z-index: 1;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-input {
  color: var(--text-primary) !important;
  border-radius: 0.75rem !important;
  padding: 1rem !important;
  font-size: 1rem !important;
  transition: all 0.3s ease !important;
}

.auth-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  color: var(--text-primary) !important;
}

.auth-input::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7 !important;
}

.form-floating .auth-input ~ label {
  color: var(--text-secondary) !important;
  padding-left: 1rem !important;
}

.form-floating .auth-input:focus ~ label,
.form-floating .auth-input:not(:placeholder-shown) ~ label {
  color: var(--primary-color) !important;
  font-weight: 500 !important;
}

.divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}

.divider span {
  background: var(--glass-bg);
  padding: 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.external-providers {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Enhanced Button Styles for Authentication */
.btn-primary {
  color: black !important;
  background-color: #ecfdf5;
  border: none !important;
  border-radius: 0.75rem !important;
  padding: 0.875rem 1.5rem !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  transition: all 0.3s ease !important;
}

.btn-primary:hover {
  background: #f9fafb !important;
  transform: translateY(-2px) !important;
}

.btn-primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .content {
    padding: 1rem 0.5rem;
  }

  h1 {
    font-size: 1.875rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .file-upload-area {
    padding: 1.5rem;
  }

  .question-form {
    padding: 1.5rem;
  }

  .glass-card {
    padding: 2rem;
    margin: 1rem;
    border-radius: 1rem;
  }

  .auth-title {
    font-size: 1.75rem;
  }

  .auth-input {
    padding: 0.875rem !important;
    font-size: 0.95rem !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
  }
}

/* Enhanced Text Visibility */
.text-muted {
  color: var(--text-muted) !important;
  opacity: 0.8;
}

/* Improved contrast for links */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

/* Enhanced readability */
p,
li,
span {
  color: black;
}

/* High contrast for headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Better visibility for disabled elements */
.disabled,
[disabled] {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Enhanced focus indicators for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Additional Home Page Styles */
.glass-card-inner {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease;
}

.glass-card-inner:hover {
  background: rgba(255, 255, 255, 1) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.glass-card-inner .h6 {
  color: var(--text-primary) !important;
}

.glass-card-inner small {
  color: var(--text-muted) !important;
}

/* Enhanced stats styling */
.stats-row .stat-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stats-row .stat-item:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.stats-row .glow-text {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

/* Badge improvements */
.badge-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-hover)
  );
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
