/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if chosen) is imported into this file so the stylesheets can be processed
 * by Sprockets. Read more: https://github.com/rails/sprockets#sprockets-directives
 *


 */

/* Custom Styles for Chero - Enhanced UI */

/* Light Theme (Default) */
:root,
.theme-light {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary-color: #6c757d;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f5f7fa;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: rgba(0, 0, 0, 0.1);
  --card-bg: rgba(255, 255, 255, 0.95);
  --navbar-bg: rgba(99, 102, 241, 0.95);
}

/* Dark Theme */
.theme-dark {
  --primary-color: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #a5b4fc;
  --secondary-color: #9ca3af;
  --success-color: #34d399;
  --danger-color: #f87171;
  --warning-color: #fbbf24;
  --info-color: #60a5fa;
  --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  --gradient-info: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);

  /* Dark theme colors */
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-tertiary: #0f172a;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(31, 41, 55, 0.95);
  --navbar-bg: rgba(31, 41, 55, 0.95);
}

body {
  background: var(--bg-tertiary);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-light body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.theme-dark body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Card Enhancements - Modern Glassmorphism */
.card {
  border: none;
  border-radius: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transform: translateY(0);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.card:hover::before {
  opacity: 1;
}

.card:hover::after {
  opacity: 1;
}

.theme-dark .card::after {
  background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, transparent 70%);
}

.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  padding: 1.25rem 1.5rem;
  border-radius: 16px 16px 0 0;
  color: var(--text-primary);
}

.card-body {
  padding: 1.5rem;
}

/* Email Item Styling - Enhanced */
.email-item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 5px solid transparent;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 1.25rem !important;
  transform: translateX(0);
}

.email-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.email-item:hover {
  background: var(--bg-primary);
  border-left-color: var(--primary-color);
  transform: translateX(8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.email-item:hover h6 {
  color: var(--primary-color);
}

.email-item:hover::before {
  transform: scaleY(1);
}

.email-item h6 {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.email-item.unread {
  background: var(--bg-secondary);
  border-left-color: var(--primary-color);
}

.theme-light .email-item.unread {
  background: rgba(99, 102, 241, 0.05);
}

.theme-dark .email-item.unread {
  background: rgba(129, 140, 248, 0.1);
}

.email-item.unread::before {
  transform: scaleY(1);
}

/* Settings Form */
.settings-form .form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.settings-form .form-select:focus,
.settings-form .form-check-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Email Body */
.email-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #495057;
}

/* Badge Enhancements */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

/* Button Enhancements - Modern Gradient Buttons */
.btn {
  font-weight: 600;
  border-radius: 12px;
  padding: 0.75rem 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(-1px) scale(1.02);
  transition: all 0.1s ease;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

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

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* Navbar Enhancements - Glassmorphism */
.navbar {
  background: var(--navbar-bg) !important;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.theme-light .navbar {
  background: rgba(99, 102, 241, 0.95) !important;
}

.theme-dark .navbar {
  background: rgba(31, 41, 55, 0.95) !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.75rem;
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: all 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.625rem 1.25rem !important;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 0.25rem;
  position: relative;
}

.navbar-nav .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar-nav .nav-link:hover::before {
  width: 80%;
}

/* Alert Enhancements */
.alert {
  border: none;
  border-left: 4px solid;
}

.alert-success {
  border-left-color: var(--success-color);
}

.alert-danger {
  border-left-color: var(--danger-color);
}

.alert-warning {
  border-left-color: var(--warning-color);
}

.alert-info {
  border-left-color: var(--info-color);
}

/* Loading Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Account Info Card */
dl.row dt {
  font-weight: 600;
  color: var(--text-secondary);
}

dl.row dd {
  color: var(--text-primary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1rem;
  }

  .email-item {
    padding: 0.75rem;
  }

  .email-item h6 {
    font-size: 0.9rem;
  }
}

/* Animation for toggle */
[data-toggle-target="toggleable"] {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 500px;
  overflow: hidden;
}

[data-toggle-target="toggleable"].d-none {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
}

[data-toggle-target="toggleable"].d-block {
  opacity: 1;
  max-height: 500px;
}

/* Statistics Cards */
.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.stat-card > * {
  position: relative;
  z-index: 1;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.stat-card-primary::before {
  background: var(--gradient-primary);
}

.stat-card-success::before {
  background: var(--gradient-success);
}

.stat-card-danger::before {
  background: var(--gradient-danger);
}

.stat-card-info::before {
  background: var(--gradient-info);
}

.stat-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.stat-card:hover::before {
  opacity: 0.1;
}

.stat-card:hover .stat-card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.stat-card-icon {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.stat-card-success .stat-card-icon {
  background: var(--gradient-success);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.stat-card-danger .stat-card-icon {
  background: var(--gradient-danger);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.stat-card-info .stat-card-icon {
  background: var(--gradient-info);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.stat-card-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.stat-card:hover .stat-card-value {
  transform: scale(1.1);
}

.stat-card-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0.5rem 0 0 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-subtitle {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--success-color);
  font-weight: 600;
}

/* Loading Skeletons */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton-card,
.skeleton-email-item {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  animation: shimmer 2s infinite;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.6) 100%
  );
  background-size: 1000px 100%;
}

.skeleton-line {
  height: 1rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  animation: shimmer 2s infinite;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
}

.skeleton-text {
  width: 100%;
}

.skeleton-text.short {
  width: 80%;
}

/* Enhanced Form Elements */
.form-control,
.form-select {
  border-radius: 12px;
  border: 2px solid var(--border-color);
  padding: 0.875rem 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: var(--bg-primary);
  outline: none;
  transform: translateY(-2px);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: white;
  outline: none;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  transition: all 0.3s ease;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Email Body Styling */
.email-body {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  line-height: 1.8;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.email-metadata {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.theme-light .email-metadata {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.theme-dark .email-metadata {
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

/* Badge Enhancements */
.badge {
  font-weight: 600;
  padding: 0.5em 0.875em;
  border-radius: 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-radius: 24px;
  padding: 4rem 2rem;
  margin: 2rem 0;
}

.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-img {
  max-width: 300px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

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

.hero-icon {
  font-size: 5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 2s ease-in-out infinite;
}

.feature-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.feature-card i {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .stat-card {
    margin-bottom: 1rem;
  }

  .stat-card-value {
    font-size: 2rem;
  }

  .card {
    border-radius: 12px;
  }

  .email-item {
    padding: 1rem;
  }

  .hero-section {
    padding: 2rem 1rem;
  }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Page Transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

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

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

.container > * {
  animation: fadeIn 0.6s ease-out;
}

/* Stagger animations for lists */
.list-group-item {
  animation: slideInUp 0.5s ease-out backwards;
}

.list-group-item:nth-child(1) { animation-delay: 0.1s; }
.list-group-item:nth-child(2) { animation-delay: 0.2s; }
.list-group-item:nth-child(3) { animation-delay: 0.3s; }
.list-group-item:nth-child(4) { animation-delay: 0.4s; }
.list-group-item:nth-child(5) { animation-delay: 0.5s; }
.list-group-item:nth-child(n+6) { animation-delay: 0.6s; }

/* Stat cards stagger */
.stat-card {
  animation: scaleIn 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Additional Enhancements */
.list-group-item {
  border: none;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.list-group-flush .list-group-item {
  border-radius: 0;
  margin-bottom: 0;
}

.list-group-flush .list-group-item:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.list-group-flush .list-group-item:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Container Enhancements */
.container {
  max-width: 1200px;
}

/* Text Enhancements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
}

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

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

/* Empty States */
.empty-state-icon {
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

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

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Focus States */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .card-header {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Advanced Visual Effects */
.container {
  position: relative;
}

.container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-20px, -20px) scale(1.1);
  }
}

.theme-dark .container::before {
  background:
    radial-gradient(circle at 20% 50%, rgba(129, 140, 248, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(129, 140, 248, 0.08) 0%, transparent 50%);
}

.container > * {
  position: relative;
  z-index: 1;
}

/* Loading States */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: rotate 0.8s linear infinite;
}

/* Enhanced Empty States */
.empty-state-icon {
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.empty-state-icon:hover {
  opacity: 0.7;
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.3));
}

/* Smooth Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2.25rem;
  font-weight: 700;
}

h3 {
  font-size: 1.875rem;
  font-weight: 700;
}

.theme-dark h1 {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Spacing */
.mb-5 {
  margin-bottom: 3rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

/* Card Header Enhancements */
.card-header h5 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.card-header i {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.card:hover .card-header i {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

/* List Group Enhancements */
.list-group-flush .list-group-item {
  border-left: none;
  border-right: none;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.list-group-flush .list-group-item:first-child {
  border-top: none;
}

.list-group-flush .list-group-item:last-child {
  border-bottom: none;
}

/* Scroll Animations */
[data-animation-target="element"] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animation-target="element"].animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Effects for Interactive Elements */
.interactive {
  cursor: pointer;
  transition: all 0.3s ease;
}

.interactive:hover {
  transform: translateY(-2px);
}

/* Enhanced Badge Animations */
.badge {
  position: relative;
  overflow: hidden;
}

.badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.badge:hover::before {
  left: 100%;
}

/* Enhanced Form Switches */
.form-check-input {
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.form-check-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Loading Button States */
.btn[disabled],
.btn.loading {
  position: relative;
  color: transparent;
}

.btn[disabled]::after,
.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: rotate 0.8s linear infinite;
}

/* Enhanced Alerts */
.alert {
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.4s ease-out;
}

.alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

/* Page Header Styles */
.page-header {
  padding: 2rem 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 2rem;
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Enhanced Display Typography */
.display-4 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Enhanced Badge Styles */
.badge.bg-light {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
}

/* Pulse Animation for New Badges */
@keyframes pulse-badge {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.pulse-badge {
  animation: pulse-badge 2s ease-in-out infinite;
}

/* Enhanced Form Controls */
.form-control-lg {
  font-size: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
}

/* Enhanced Card Shadows */
.shadow-lg {
  box-shadow: var(--shadow-xl) !important;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

/* Pagination Styles */
.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.pagination .page-item {
  margin: 0;
}

.pagination .page-link {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
}

.pagination .page-link:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pagination .page-item.active .page-link {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.pagination .page-item.disabled .page-link:hover {
  transform: none;
  box-shadow: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.pagination.pagination-lg .page-link {
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  min-width: 48px;
  height: 48px;
}

.pagination.pagination-sm .page-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  min-width: 36px;
  height: 36px;
}

.page-entries-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Pagination Icons */
.pagination .page-link i {
  font-size: 0.875rem;
}

/* Enhanced Pagination Container */
.pagination-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Pagination Info Styling */
.pagination-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Signature Preview Styling */
.signature-preview-box {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  transition: all 0.3s ease;
}

.signature-preview-box:hover {
  background: var(--bg-primary) !important;
  border-color: var(--primary-color) !important;
  box-shadow: var(--shadow-sm);
}

.signature-preview {
  color: var(--text-primary);
  font-style: italic;
  white-space: pre-wrap;
  line-height: 1.6;
}

.theme-dark .signature-preview-box {
  background: var(--bg-secondary) !important;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .display-4 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .stat-card-value {
    font-size: 2rem;
  }

  .stat-card-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .card {
    border-radius: 16px;
  }

  .btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.8125rem;
  }

  .page-header {
    padding: 1.5rem 0;
  }

  .info-item-enhanced {
    padding: 1rem;
  }

  .info-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .pagination {
    gap: 0.25rem;
  }

  .pagination .page-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-width: 36px;
    height: 36px;
  }

  .pagination.pagination-lg .page-link {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    min-width: 40px;
    height: 40px;
  }
}
