/* ===== CSS VARIABLES FOR THEME SYSTEM ===== */
:root {
  /* Light Theme Colors */
  --light-bg-primary: #ffffff;
  --light-bg-secondary: #f8f9fa;
  --light-bg-tertiary: #e9ecef;
  --light-bg-card: #ffffff;
  --light-bg-navbar: #ffffff;
  --light-bg-footer: #f8f9fa;
  --light-text-primary: #212529;
  --light-text-secondary: #6c757d;
  --light-text-muted: #adb5bd;
  --light-border: #dee2e6;
  --light-border-focus: #0d6efd;
  --light-shadow: rgba(0, 0, 0, 0.1);
  --light-shadow-hover: rgba(0, 0, 0, 0.15);
  
  /* Dark Theme Colors */
  --dark-bg-primary: #0b0d10;
  --dark-bg-secondary: #111418;
  --dark-bg-tertiary: #171a1f;
  --dark-bg-card: #1f242b;
  --dark-bg-navbar: #111418;
  --dark-bg-footer: #0b0d10;
  --dark-text-primary: #e6e8ea;
  --dark-text-secondary: #adb5bd;
  --dark-text-muted: #8b9bb4; /* Improved contrast for dark mode */
  --dark-border: #2d3748;
  --dark-border-focus: #3b82f6;
  --dark-shadow: rgba(0, 0, 0, 0.3);
  --dark-shadow-hover: rgba(0, 0, 0, 0.4);
  
  /* Accent Colors */
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-info: #06b6d4;
  
  /* Gradients */
  --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-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* ===== DARK THEME (DEFAULT) ===== */
[data-theme="dark"] {
  --bg-primary: var(--dark-bg-primary);
  --bg-secondary: var(--dark-bg-secondary);
  --bg-tertiary: var(--dark-bg-tertiary);
  --bg-card: var(--dark-bg-card);
  --bg-navbar: var(--dark-bg-navbar);
  --bg-footer: var(--dark-bg-footer);
  --text-primary: var(--dark-text-primary);
  --text-secondary: var(--dark-text-secondary);
  --text-muted: var(--dark-text-muted);
  --border: var(--dark-border);
  --border-focus: var(--dark-border-focus);
  --shadow: var(--dark-shadow);
  --shadow-hover: var(--dark-shadow-hover);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-primary: var(--light-bg-primary);
  --bg-secondary: var(--light-bg-secondary);
  --bg-tertiary: var(--light-bg-tertiary);
  --bg-card: var(--light-bg-card);
  --bg-navbar: var(--light-bg-navbar);
  --bg-footer: var(--light-bg-footer);
  --text-primary: var(--light-text-primary);
  --text-secondary: var(--light-text-secondary);
  --text-muted: var(--light-text-muted);
  --border: var(--light-border);
  --border-focus: var(--light-border-focus);
  --shadow: var(--light-shadow);
  --shadow-hover: var(--light-shadow-hover);
}

/* Prevent flash of unstyled content by setting default theme immediately */
html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

/* ===== GLOBAL STYLES ===== */
/* Remove global transition to prevent flickering */
/* * {
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
} */

/* Add class to prevent transitions during page load */
.no-transitions * {
  transition: none !important;
}

/* Prevent any flickering during initial page load */
html.no-transitions {
  --transition-normal: 0s;
  --transition-fast: 0s;
  --transition-slow: 0s;
}

/* Prevent any transforms during initial page load */
html.no-transitions * {
  transform: none !important;
}

/* Specific transition classes for elements that should have smooth transitions */
.transition-all {
  /*transition: all var(--transition-normal);*/
}

.transition-fast {
/*  transition: all var(--transition-fast);*/
}

.transition-colors {
  /*
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
  */
}

.transition-transform {
  /*
  transition: transform var(--transition-normal);
  */
}

.transition-opacity {
  /*
  transition: opacity var(--transition-normal);
  */
}

/* Apply transitions to specific elements that need them */
.btn,
.navbar,
.form-control,
.form-select,
.dropdown-menu,
.modal-content,
.alert {
  /*transition: all var(--transition-normal);*/
}

/* Cards should only have transitions after page load */
.card {
  transition: none !important; /* Force no transitions by default */
}

/* Enable card transitions after page load */
.no-transitions .card {
  transition: none !important;
}

/* Cards should have smooth transitions after page load */
html:not(.no-transitions) .card {
  transition: all var(--transition-normal) !important;
}

/* ===== ANIMATION CLASSES (Animation on login) ===== */
/* Card hover animations */
.card-hover {
  /*transition: all var(--transition-normal);*/
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

/* Button hover animations */
.btn-hover {
  transition: all var(--transition-fast);
}

.btn-hover:hover {
  transform: translateY(-2px);
}

/* Primary buttons should not have hover transform */
.btn-primary.btn-hover:hover {
  transform: none;
}

/* Card transition enable class */
.card-transition-enabled {
  transition: all var(--transition-normal) !important;
}

/* Fast transitions for interactive elements */
.nav-link,
.theme-toggle,
.dropdown-item,
.page-link {
  transition: all var(--transition-fast);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAVBAR STYLES ===== */
.navbar {
  background: var(--bg-navbar) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px var(--shadow);
  padding: var(--spacing-md) 0;
  /*transition: all var(--transition-normal);*/
  z-index: 1030; /* Ensure navbar stays above content but below dropdowns */
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.navbar-brand i {
  font-size: 1.8rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md) !important;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--text-primary) !important;
  background-color: var(--bg-secondary);
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
  color: var(--accent-primary) !important;
  background-color: rgba(59, 130, 246, 0.1);
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.05);
}

.theme-toggle i {
  font-size: 1.2rem;
}

/* ===== CARD STYLES ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px var(--shadow);
  transition: none; /* Start with no transitions to prevent flickering */
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px var(--shadow-hover);
  border-color: var(--accent-primary);
}

.card-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--spacing-lg);
}

/* ===== CARD TITLE STYLES ===== */
.card-title {
  color: var(--text-primary) !important;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

.card-title.fw-bold {
  font-weight: 700 !important;
}

.card-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--spacing-md) var(--spacing-lg);
}

/* ===== BUTTON STYLES ===== */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-lg);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Ensure primary buttons are highly visible in dark mode */
[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hero button styling for better visibility */
.btn-hero {
  /*font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);*/
}

[data-theme="dark"] .btn-hero { 
  color: #d1d6dd!important;
}

[data-theme="dark"] .btn-hero:hover { 
  color: #ffffff!important;
  transform: translateY(-3px); 
}

[data-theme="light"] .btn-hero { 
  color: white!important; 
}

[data-theme="light"] .btn-hero:hover { 
  color: #ffffff!important;
  transform: translateY(-3px); 
}

/* Enhanced button visibility for all primary buttons */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Ensure all primary buttons have strong contrast */
[data-theme="dark"] .btn-primary {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .btn-primary {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
}

.btn-warning {
  background: var(--gradient-warning);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: white;
}

.btn-outline-primary {
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-1px);
}

/* ===== FORM STYLES ===== */
.form-control, .form-select {
  background: var(--bg-secondary) !important;
  border: 2px solid var(--border) !important;
  border-radius: var(--radius-md);
  color: var(--text-primary) !important;
  padding: var(--spacing-md);
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  background: var(--bg-secondary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
  color: var(--text-primary) !important;
}

/* Ensure form elements maintain dark theme */
.form-control:not(:focus) {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* Override any Bootstrap light theme styles */
.form-control.bg-white,
.form-control.bg-light {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* ===== PLACEHOLDER TEXT STYLING ===== */
.form-control::placeholder,
.form-select::placeholder {
  color: var(--text-muted);
  opacity: 1; /* Firefox */
}

.form-control::-webkit-input-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control::-moz-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control:-ms-input-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control:-moz-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* ===== IMPROVED TEXT-MUTED CONTRAST ===== */
.text-muted {
  color: var(--text-muted) !important;
}

/* ===== FORM LABELS AND TEXT ===== */
.form-label {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

/* Dark mode specific form label styling */
[data-theme="dark"] .form-label {
  color: #e6e8ea;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Floating label styling for dark mode */
[data-theme="dark"] .form-floating > label {
  color: #adb5bd;
  font-weight: 500;
  background: var(--bg-secondary);
  padding: 0 0.5rem;
  border-radius: 0.25rem;
}

[data-theme="dark"] .form-floating > .form-control:focus ~ label,
[data-theme="dark"] .form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--accent-primary);
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
}

.form-text {
  color: var(--text-secondary);
}

/* ===== CHECKBOX STYLES ===== */
.form-check-input {
  background-color: var(--bg-secondary) !important;
  border: 2px solid var(--border) !important;
  color: var(--accent-primary) !important;
}

.form-check-input:checked {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
}

.form-check-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

.form-check-label {
  color: var(--text-primary) !important;
  font-weight: 500;
}

/* Ensure checkbox is visible in dark mode */
.form-check-input[type="checkbox"] {
  background-image: none !important;
}

.form-check-input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
  background-size: 12px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* ===== FILE INPUT STYLING ===== */
.form-control[type="file"] {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px dashed var(--border);
  cursor: pointer;
}

.form-control[type="file"]:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.form-control[type="file"]::file-selector-button {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-control[type="file"]::file-selector-button:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

/* ===== TABLE STYLES ===== */
.table {
  color: var(--text-primary);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 6px var(--shadow);
}

.table thead th {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
  padding: var(--spacing-lg);
}

.table tbody td {
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-lg);
  vertical-align: middle;
  background: transparent;
}

.table tbody tr {
  background: var(--bg-card);
  transition: background-color var(--transition-normal);
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

/* Override Bootstrap table styles for dark mode */
[data-theme="dark"] .table {
  color: var(--text-primary);
  background: var(--bg-card);
}

[data-theme="dark"] .table thead th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .table tbody td {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .table tbody tr {
  background: var(--bg-card);
}

[data-theme="dark"] .table tbody tr:hover {
  background: var(--bg-secondary);
}

/* Handle Bootstrap table variants in dark mode */
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--bg-card);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) {
  background: var(--bg-secondary);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd):hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even):hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .table-hover > tbody > tr:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] .table-light {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .table-light th,
[data-theme="dark"] .table-light td {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

/* ===== ALERT STYLES ===== */
.alert {
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 4px 6px var(--shadow);
  font-weight: 500;
  position: relative;
  overflow: hidden;
  animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.alert-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-left: 4px solid #1e40af;
}

.alert-primary .btn-close {
  filter: invert(1);
}

.alert-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-left: 4px solid #047857;
}

.alert-success .btn-close {
  filter: invert(1);
}

.alert-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-left: 4px solid #b45309;
}

.alert-warning .btn-close {
  filter: invert(1);
}

.alert-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-left: 4px solid #b91c1c;
}

.alert-danger .btn-close {
  filter: invert(1);
}

.alert-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  border-left: 4px solid #0e7490;
}

.alert-info .btn-close {
  filter: invert(1);
}

/* Alert icons styling */
.alert i {
  font-size: 1.25rem;
  opacity: 0.9;
}

.alert .fw-medium {
  font-weight: 500 !important;
}

/* Alert close button styling */
.alert .btn-close {
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.alert .btn-close:hover {
  opacity: 1;
}

/* Dark theme specific alert adjustments */
[data-theme="dark"] .alert-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
}

[data-theme="dark"] .alert-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

[data-theme="dark"] .alert-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

[data-theme="dark"] .alert-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

[data-theme="dark"] .alert-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

/* ===== BADGE STYLES ===== */
.badge {
  border-radius: var(--radius-sm);
  font-weight: 500;
  padding: var(--spacing-xs) var(--spacing-sm);
}

.badge-primary {
  background: var(--accent-primary);
  color: white;
}

.badge-success {
  background: var(--accent-success);
  color: white;
}

.badge-warning {
  background: var(--accent-warning);
  color: white;
}

.badge-danger {
  background: var(--accent-danger);
  color: white;
}

/* ===== MODAL STYLES ===== */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px var(--shadow);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.modal-title {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== DROPDOWN STYLES ===== */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 25px var(--shadow);
  padding: var(--spacing-sm);
  z-index: 1050 !important; /* Ensure dropdown appears above all other content */
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.dropdown-divider {
  border-color: var(--border);
  margin: var(--spacing-sm) 0;
}

/* Ensure dropdown toggle button maintains proper layering */
.dropdown-toggle {
  z-index: 1031;
}

/* Fix any Bootstrap z-index conflicts */
.dropdown-menu.show {
  z-index: 1050 !important;
}

/* ===== PAGINATION STYLES ===== */
.pagination {
  gap: var(--spacing-xs);
}

.page-link {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all var(--transition-fast);
}

.page-link:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.page-item.active .page-link {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* ===== FOOTER STYLES ===== */
footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  padding: var(--spacing-xl) 0;
  margin-top: auto;
}

/* ===== IMPROVED FOOTER TEXT VISIBILITY ===== */
footer .text-muted {
  color: var(--text-secondary) !important;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--text-primary);
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Ensure text gradient is visible in both themes */
[data-theme="dark"] .text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #e6e8ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero text styling for better visibility */
.hero-text {
  font-weight: 700;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .hero-text {
  color: white;
  /*text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);*/
}

[data-theme="light"] .hero-text {
  color: var(--text-primary);
  /*text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);*/
}

.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-secondary {
  background: var(--gradient-secondary);
}

.shadow-custom {
  box-shadow: 0 4px 6px var(--shadow);
}

.shadow-custom-hover:hover {
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.border-custom {
  border: 1px solid var(--border);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in {
  animation: slideIn 0.4s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .card-body {
    padding: var(--spacing-md);
  }
  
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .table thead th,
  .table tbody td {
    padding: var(--spacing-md);
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
  
  .card {
    margin-bottom: var(--spacing-lg);
  }
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--accent-primary);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .footer,
  .btn,
  .theme-toggle {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* ===== IMAGE AND LAYOUT UTILITY CLASSES ===== */
.img-cover {
  object-fit: cover;
}

.img-cover-200 {
  height: 200px;
  object-fit: cover;
}

.img-cover-160 {
  height: 160px;
  object-fit: cover;
}

.img-cover-120 {
  height: 120px;
  object-fit: cover;
}

.img-cover-100 {
  height: 100px;
  object-fit: cover;
}

.img-cover-80 {
  height: 80px;
  object-fit: cover;
}

.img-cover-40 {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.img-cover-32 {
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.img-cover-120px {
  width: 120px;
  height: 120px;
  object-fit: cover;
}

.img-cover-100px {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.img-cover-80px {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.img-cover-60px {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.img-cover-40px {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.img-cover-32px {
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.img-logo {
  height: 2rem;
  width: auto;
}

.img-logo-lg {
  height: 3rem;
  width: auto;
}

.img-logo-sm {
  height: 32px;
  width: auto;
}

/* ===== HERO SECTION STYLES ===== */
.hero-section {
  background: var(--gradient-primary);
  border-radius: 1rem;
}

.hero-section-light {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* ===== CHANNEL BANNER STYLES ===== */
.channel-banner {
  background-size: cover;
  background-position: center;
  height: 300px;
}

/* ===== CARD IMAGE CONTAINER STYLES ===== */
.card-img-container {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.card-img-container-sm {
  height: 120px;
  overflow: hidden;
  position: relative;
}

/* ===== AVATAR PLACEHOLDER STYLES ===== */
.avatar-placeholder {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
}

.avatar-placeholder-sm {
  width: 32px;
  height: 32px;
}

.avatar-placeholder-md {
  width: 40px;
  height: 40px;
}

.avatar-placeholder-lg {
  width: 100px;
  height: 100px;
}

.avatar-placeholder-xl {
  width: 120px;
  height: 120px;
}

/* ===== PROGRESS BAR STYLES ===== */
.progress-thin {
  height: 4px;
}

.progress-sm {
  height: 8px;
}

/* ===== ICON SIZE UTILITY CLASSES ===== */
.icon-xs {
  font-size: 0.75rem;
}

.icon-sm {
  font-size: 1rem;
}

.icon-md {
  font-size: 1.5rem;
}

.icon-lg {
  font-size: 2rem;
}

.icon-xl {
  font-size: 3rem;
}

.icon-xxl {
  font-size: 4rem;
}

.icon-error {
  font-size: 6rem;
}

/* ===== ICON COLOR UTILITY CLASSES ===== */
.icon-primary {
  color: var(--accent-primary);
}

.icon-secondary {
  color: var(--accent-secondary);
}

.icon-success {
  color: var(--accent-success);
}

.icon-warning {
  color: var(--accent-warning);
}

.icon-danger {
  color: var(--accent-danger);
}

.icon-info {
  color: var(--accent-info);
}

.icon-muted {
  color: var(--text-muted);
}

.icon-light {
  color: var(--text-secondary);
}

/* ===== GRADIENT ICON STYLES ===== */
.icon-gradient-primary {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-gradient-success {
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-gradient-warning {
  background: var(--gradient-warning);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-gradient-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-gradient-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== DISPLAY UTILITY CLASSES ===== */
.d-none-inline {
  display: none;
}

.d-inline-block {
  display: inline-block;
}

/* ===== WIDTH UTILITY CLASSES ===== */
.w-160 {
  width: 160px;
}

.w-140 {
  width: 140px;
}

.w-120 {
  width: 120px;
}

.w-100px {
  width: 100px;
}

.w-80px {
  width: 80px;
}

.w-60px {
  width: 60px;
}

.w-40px {
  width: 40px;
}

.w-32px {
  width: 32px;
}

/* ===== HEIGHT UTILITY CLASSES ===== */
.h-200 {
  height: 200px;
}

.h-160 {
  height: 160px;
}

.h-120 {
  height: 120px;
}

.h-100 {
  height: 100px;
}

.h-80 {
  height: 80px;
}

.h-60 {
  height: 60px;
}

.h-40 {
  height: 40px;
}

.h-32 {
  height: 32px;
}

/* ===== MAX WIDTH UTILITY CLASSES ===== */
.max-w-300 {
  max-width: 300px;
}

/* ===== CURSOR UTILITY CLASSES ===== */
.cursor-pointer {
  cursor: pointer;
}

/* ===== FORM STYLE OVERRIDES ===== */
.form-control-light {
  color: var(--text-primary) !important;
}

.form-control-light:focus {
  border-bottom-color: var(--border) !important;
}

.form-control-light:not(:focus) {
  border-bottom-color: var(--border) !important;
}

/* ===== TABLE STYLE OVERRIDES ===== */
.table-actions {
  width: 160px;
}

.table-actions-sm {
  width: 140px;
}

.table-actions-xs {
  width: 120px;
}

/* ===== EMPTY STATE STYLES ===== */
.empty-state-icon {
  font-size: 4rem;
  color: var(--text-muted);
}

.empty-state-icon-sm {
  font-size: 2rem;
  color: var(--text-muted);
}

/* ===== CODE BLOCK STYLES ===== */
.code-block {
  border-left: 4px solid var(--accent-primary);
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.code-block-light {
  background-color: var(--bg-secondary) !important;
}

.code-block-light .hljs {
  background-color: var(--bg-secondary) !important;
}

.code-block-light .hljs-keyword {
  color: var(--accent-primary);
}

.code-block-light .hljs-string {
  color: var(--accent-success);
}

.code-block-light .hljs-comment {
  color: var(--text-muted);
}

.code-block-light .hljs-function {
  color: var(--accent-secondary);
}

.code-block-light .hljs-number {
  color: var(--accent-warning);
}

/* ===== TABLE OF CONTENTS STYLES ===== */
.table-of-contents {
  display: none;
}

.table-of-contents.show {
  display: block;
}

/* ===== PASSWORD STRENGTH INDICATOR STYLES ===== */
.password-strength {
  height: 4px;
}

.password-strength-bar {
  width: 0%;
}

.password-check {
  display: none;
}

.password-check.show {
  display: inline-block;
}

/* ===== STRIPE ELEMENTS THEME COMPATIBILITY ===== */
.stripe-elements-dark {
  color: var(--text-primary);
}

.stripe-elements-light {
  color: var(--text-primary);
}

/* ===== ERROR PAGE ICON STYLES ===== */
.error-icon {
  font-size: 6rem;
}

.error-icon-primary {
  color: var(--accent-primary);
}

.error-icon-warning {
  color: var(--accent-warning);
}

.error-icon-danger {
  color: var(--accent-danger);
}

.error-icon-muted {
  color: var(--text-muted);
}

/* ===== HERO GRADIENT STYLES ===== */
.hero-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== BORDER UTILITY CLASSES ===== */
.border-light {
  border: 1px solid var(--border);
}

.border-light-focus {
  border-color: var(--accent-primary);
}

/* ===== BACKGROUND UTILITY CLASSES ===== */
.bg-light-secondary {
  background: var(--bg-secondary);
}

.bg-light-tertiary {
  background: var(--bg-tertiary);
}

/* ===== TEXT UTILITY CLASSES ===== */
.text-light-secondary {
  color: var(--text-secondary);
}

.text-light-muted {
  color: var(--text-muted);
}

/* ===== FOCUS STYLES ===== */
.focus-primary {
  border-color: var(--accent-primary);
}

.focus-primary:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* ===== CODE HIGHLIGHTING STYLES ===== */
.code-highlight {
  border-left: 4px solid var(--accent-primary);
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.code-highlight-light {
  background-color: var(--bg-secondary) !important;
}

.code-highlight-light .hljs {
  background-color: var(--bg-secondary) !important;
}

.code-highlight-light .hljs-keyword {
  color: var(--accent-primary);
}

.code-highlight-light .hljs-string {
  color: var(--accent-success);
}

.code-highlight-light .hljs-comment {
  color: var(--text-muted);
}

.code-highlight-light .hljs-function {
  color: var(--accent-secondary);
}

.code-highlight-light .hljs-number {
  color: var(--accent-warning);
}

/* ===== FORM STYLE OVERRIDES FOR DARK THEME ===== */
.form-control-dark {
  color: var(--text-primary) !important;
}

.form-control-dark:focus {
  border-bottom-color: var(--border) !important;
}

.form-control-dark:not(:focus) {
  border-bottom-color: var(--border) !important;
}

/* ===== BORDER UTILITY CLASSES ===== */
.border-light-gray {
  border: 1px solid var(--border);
}

.border-light-gray-focus {
  border-color: var(--accent-primary);
}

/* ===== BACKGROUND UTILITY CLASSES ===== */
.bg-light-gray {
  background-color: var(--bg-secondary);
}

.bg-light-gray-important {
  background-color: var(--bg-secondary) !important;
}

/* ===== TEXT UTILITY CLASSES ===== */
.text-light-gray {
  color: var(--text-secondary);
}

.text-light-muted {
  color: var(--text-muted);
}

/* ===== STRIPE ELEMENTS THEME COMPATIBILITY ===== */
.stripe-elements-theme {
  color: var(--text-primary);
}

/* ===== HERO GRADIENT STYLES ===== */
.hero-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== BUTTON GRADIENT STYLES ===== */
.btn-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
}

/* ===== FOCUS STYLES FOR FORMS ===== */
.form-focus-primary {
  color: var(--text-primary);
}

.form-focus-primary:focus {
  border-bottom-color: var(--border) !important;
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.form-focus-primary:not(:focus) {
  border-bottom-color: var(--border) !important;
}

/* ===== BORDER UTILITY CLASSES ===== */
.border-light-gray {
  border: 1px solid var(--border);
}

.border-light-gray-focus {
  border-color: var(--accent-primary);
}

/* ===== BACKGROUND UTILITY CLASSES ===== */
.bg-light-gray {
  background-color: var(--bg-secondary);
}

.bg-light-gray-important {
  background-color: var(--bg-secondary) !important;
}

/* ===== TEXT UTILITY CLASSES ===== */
.text-light-gray {
  color: var(--text-secondary);
}

.text-light-muted {
  color: var(--text-muted);
}

/* ===== STRIPE ELEMENTS THEME COMPATIBILITY ===== */
.stripe-elements-theme {
  color: var(--text-primary);
}

/* ===== HERO GRADIENT STYLES ===== */
.hero-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== BUTTON GRADIENT STYLES ===== */
.btn-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
}

/* ===== CODE HIGHLIGHTING STYLES ===== */
.code-highlight {
  border-left: 4px solid var(--accent-primary);
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.code-highlight-light {
  background-color: var(--bg-secondary) !important;
}

.code-highlight-light .hljs {
  background-color: var(--bg-secondary) !important;
}

.code-highlight-light .hljs-keyword {
  color: var(--accent-primary);
}

.code-highlight-light .hljs-string {
  color: var(--accent-success);
}

.code-highlight-light .hljs-comment {
  color: var(--text-muted);
}

.code-highlight-light .hljs-function {
  color: var(--accent-secondary);
}

.code-highlight-light .hljs-number {
  color: var(--accent-warning);
}

/* ===== DARK MODE TEXT VISIBILITY FIXES ===== */
/* Ensure all text elements are visible in dark mode */
p, h1, h2, h3, h4, h5, h6, span, div, label, a {
  color: var(--text-primary) !important;
}

/* Specific text color overrides for better visibility */
.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Ensure links are visible and have proper hover states */
a {
  color: var(--accent-primary) !important;
  text-decoration: none;
}

a:hover {
  color: var(--accent-secondary) !important;
  text-decoration: underline;
}

/* Ensure form validation text is visible */
.invalid-feedback {
  color: var(--accent-danger) !important;
}

.valid-feedback {
  color: var(--accent-success) !important;
}

/* Override any Bootstrap light theme classes */
.bg-white {
  background-color: var(--bg-primary) !important;
}

.text-dark {
  color: var(--text-primary) !important;
}

/* Ensure main content area maintains dark theme */
main {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* Override any Bootstrap navbar light theme */
.navbar.bg-white,
.navbar.bg-light {
  background: var(--bg-navbar) !important;
}

/* Ensure navbar toggler is visible in dark theme */
.navbar-toggler {
  border-color: var(--border) !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(230, 232, 234, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

/* Ensure theme toggle shows correct icon */
[data-theme="dark"] .theme-toggle i.ri-sun-line {
  display: inline-block;
}

[data-theme="dark"] .theme-toggle i.ri-moon-line {
  display: none;
}

[data-theme="light"] .theme-toggle i.ri-sun-line {
  display: none;
}

[data-theme="light"] .theme-toggle i.ri-moon-line {
  display: inline-block;
}

/* Force dark theme on all elements */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

/* ===== FORM VALIDATION STYLES ===== */
.invalid-feedback {
  color: var(--accent-danger) !important;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.invalid-feedback small {
  color: var(--accent-danger) !important;
  font-weight: 500;
}

/* Dark mode specific validation styling */
[data-theme="dark"] .invalid-feedback {
  color: #ff6b6b !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .invalid-feedback small {
  color: #ff6b6b !important;
  font-weight: 600;
}

[data-theme="dark"] .form-control.is-invalid {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25) !important;
}

/* Form error summary styling */
.alert-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-left: 4px solid #b91c1c;
}

[data-theme="dark"] .alert-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.alert-danger h6 {
  color: white;
  font-weight: 600;
}

.alert-danger ul {
  color: white;
  opacity: 0.9;
}

.alert-danger li {
  margin-bottom: 0.25rem;
}

/* ===== COMMENT THREADING SYSTEM ===== */

/* Comment Container */
.comment-item {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.comment-item:hover {
    box-shadow: var(--shadow-hover);
}

/* Reply Container */
.replies-container {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.reply-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.reply-item:last-child {
    margin-bottom: 0;
}

/* Reply Form */
.reply-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.reply-form textarea {
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.reply-form textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Comment Actions */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.comment-actions .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Like Button States */
.like-comment-btn {
    transition: all 0.2s ease;
}

.like-comment-btn:hover {
    transform: scale(1.05);
}

.like-comment-btn.active {
    background-color: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
}

.like-comment-btn.active:hover {
    background-color: var(--accent-danger-dark);
    border-color: var(--accent-danger-dark);
}

/* Reply Button */
.reply-btn {
    transition: all 0.2s ease;
}

.reply-btn:hover {
    transform: scale(1.05);
}

/* Load Replies Button */
.load-replies-btn {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.load-replies-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-secondary);
    border-radius: 0.25rem;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-hover);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--accent-success);
}

.toast-error {
    border-left: 4px solid var(--accent-danger);
}

.toast-info {
    border-left: 4px solid var(--accent-info);
}

.toast-warning {
    border-left: 4px solid var(--accent-warning);
}

/* Comment Depth Indicators */
.comment-depth-1 {
    margin-left: 1rem;
}

.comment-depth-2 {
    margin-left: 2rem;
}

.comment-depth-3 {
    margin-left: 3rem;
}

/* Comment Avatar */
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Comment Metadata */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.comment-status {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Comment Text */
.comment-text {
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.comment-text p {
    margin-bottom: 0.5rem;
}

.comment-text p:last-child {
    margin-bottom: 0;
}

/* Comment Stats */
.comment-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.comment-likes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-replies {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comment-item {
        padding: 1rem;
    }
    
    .replies-container {
        padding-left: 0.5rem;
    }
    
    .reply-item {
        padding: 0.75rem;
    }
    
    .comment-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .toast-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .comment-item {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .reply-item {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .reply-form {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .toast-notification {
    background: var(--bg-card);
    border-color: var(--border);
}
