/* ============================================================================
   MatTime Dynamic Theming System
   Sophisticated, Beautiful, Brand-Aware Styling
   ============================================================================ */

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

body {
  font-family: var(--font-family, 'Inter, system-ui, sans-serif');
  color: var(--text-color, #333333);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 3%, var(--background-color, #ffffff)) 0%,
    var(--background-color, #ffffff) 100%);
  min-height: 100vh;
}

/* Smooth transitions for all themed elements */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================================
   BUTTONS - Enhanced with gradients and shadows
   ============================================================================ */

.btn {
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: none;
  border-radius: var(--border-radius, 8px);
  padding: 0.625rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    color-mix(in srgb, var(--primary-color, #1e40af) 85%, var(--secondary-color, #1e3a8a)) 100%) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color, #1e40af) 35%, transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-color, #1e40af) 45%, transparent);
}

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

.btn-secondary {
  background: linear-gradient(135deg,
    var(--secondary-color, #1e3a8a) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 90%, black) 100%) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--secondary-color, #1e3a8a) 35%, transparent);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--secondary-color, #1e3a8a) 45%, transparent);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color, #1e40af) !important;
  color: var(--primary-color, #1e40af) !important;
  background: transparent !important;
}

.btn-outline-primary:hover {
  background: var(--primary-color, #1e40af) !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-color, #1e40af) 35%, transparent);
}

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ============================================================================
   CARDS - Beautiful, elevated design
   ============================================================================ */

.card {
  border: none !important;
  border-radius: calc(var(--border-radius, 8px) * 1.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1), 0 16px 32px rgba(0, 0, 0, 0.12);
}

.card-header {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 8%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 5%, white) 100%) !important;
  border-bottom: 3px solid color-mix(in srgb, var(--primary-color, #1e40af) 30%, transparent) !important;
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  color: var(--primary-color, #1e40af);
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
}

.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6 {
  color: var(--primary-color, #1e40af);
  margin-bottom: 0;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: color-mix(in srgb, var(--primary-color, #1e40af) 3%, white);
  border-top: 1px solid color-mix(in srgb, var(--primary-color, #1e40af) 15%, transparent);
  padding: 1rem 1.5rem;
}

/* Stat Cards */
.card.stat-card {
  position: relative;
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  color: white;
}

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

.card.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

/* ============================================================================
   NAVIGATION - Branded and beautiful
   ============================================================================ */

.navbar {
  background: white !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.05);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 50%,
    var(--accent-color, #3b82f6) 100%) 1;
  border-image-slice: 1;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary-color, #1e40af) !important;
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

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

.nav-link {
  color: var(--text-color, #333333) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: calc(var(--border-radius, 8px) * 0.75);
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 80%;
  left: 10%;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color, #1e40af) !important;
  background: color-mix(in srgb, var(--primary-color, #1e40af) 8%, transparent);
}

.nav-link i {
  font-size: 1.1em;
  margin-right: 0.4rem;
  transition: transform 0.3s ease;
}

.nav-link:hover i {
  transform: scale(1.2);
}

/* ============================================================================
   FORMS - Elegant and branded
   ============================================================================ */

.form-label {
  font-weight: 600;
  color: var(--text-color, #333333);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.form-control, .form-select {
  border: 2px solid color-mix(in srgb, var(--primary-color, #1e40af) 20%, #e5e7eb);
  border-radius: var(--border-radius, 8px);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color, #1e40af);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color, #1e40af) 15%, transparent);
  outline: none;
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--text-color, #333333) 50%, #e5e7eb);
}

.input-group-text {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 10%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 8%, white) 100%);
  border: 2px solid color-mix(in srgb, var(--primary-color, #1e40af) 20%, #e5e7eb);
  color: var(--primary-color, #1e40af);
  font-weight: 600;
}

/* ============================================================================
   ALERTS - Eye-catching and informative
   ============================================================================ */

.alert {
  border: none;
  border-radius: var(--border-radius, 8px);
  padding: 1rem 1.5rem;
  border-left: 4px solid;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.alert-success {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--success-color, #10b981) 15%, white) 0%,
    color-mix(in srgb, var(--success-color, #10b981) 8%, white) 100%);
  border-left-color: var(--success-color, #10b981);
  color: color-mix(in srgb, var(--success-color, #10b981) 80%, black);
}

.alert-warning {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--warning-color, #f59e0b) 15%, white) 0%,
    color-mix(in srgb, var(--warning-color, #f59e0b) 8%, white) 100%);
  border-left-color: var(--warning-color, #f59e0b);
  color: color-mix(in srgb, var(--warning-color, #f59e0b) 80%, black);
}

.alert-danger {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--danger-color, #ef4444) 15%, white) 0%,
    color-mix(in srgb, var(--danger-color, #ef4444) 8%, white) 100%);
  border-left-color: var(--danger-color, #ef4444);
  color: color-mix(in srgb, var(--danger-color, #ef4444) 80%, black);
}

.alert-info {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 15%, white) 0%,
    color-mix(in srgb, var(--primary-color, #1e40af) 8%, white) 100%);
  border-left-color: var(--primary-color, #1e40af);
  color: color-mix(in srgb, var(--primary-color, #1e40af) 80%, black);
}

/* ============================================================================
   BADGES - Colorful and prominent
   ============================================================================ */

.badge {
  padding: 0.5rem 0.875rem;
  border-radius: calc(var(--border-radius, 8px) * 1.5);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

.badge.bg-primary {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    color-mix(in srgb, var(--primary-color, #1e40af) 85%, var(--secondary-color, #1e3a8a)) 100%) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color, #1e40af) 30%, transparent);
}

.badge.bg-secondary {
  background: linear-gradient(135deg,
    var(--secondary-color, #1e3a8a) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 90%, black) 100%) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--secondary-color, #1e3a8a) 30%, transparent);
}

.badge.bg-success {
  background: var(--success-color, #10b981) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--success-color, #10b981) 30%, transparent);
}

.badge.bg-warning {
  background: var(--warning-color, #f59e0b) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--warning-color, #f59e0b) 30%, transparent);
}

.badge.bg-danger {
  background: var(--danger-color, #ef4444) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--danger-color, #ef4444) 30%, transparent);
}

/* ============================================================================
   TABLES - Clean and elegant
   ============================================================================ */

.table {
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table thead th {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 12%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 8%, white) 100%);
  color: var(--primary-color, #1e40af);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  border: none;
  padding: 1rem 1.25rem;
}

.table tbody tr {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: color-mix(in srgb, var(--primary-color, #1e40af) 3%, white);
}

.table tbody td {
  padding: 1rem 1.25rem;
  border: none;
  vertical-align: middle;
}

.table tbody tr td:first-child {
  border-top-left-radius: var(--border-radius, 8px);
  border-bottom-left-radius: var(--border-radius, 8px);
}

.table tbody tr td:last-child {
  border-top-right-radius: var(--border-radius, 8px);
  border-bottom-right-radius: var(--border-radius, 8px);
}

/* ============================================================================
   PAGINATION - Stylish navigation
   ============================================================================ */

.pagination {
  gap: 0.5rem;
}

.page-link {
  color: var(--primary-color, #1e40af);
  border: 2px solid color-mix(in srgb, var(--primary-color, #1e40af) 20%, #e5e7eb);
  border-radius: var(--border-radius, 8px);
  padding: 0.5rem 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 0 0.25rem;
}

.page-link:hover {
  background: var(--primary-color, #1e40af);
  color: white;
  border-color: var(--primary-color, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color, #1e40af) 35%, transparent);
}

.page-item.active .page-link {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  border-color: var(--primary-color, #1e40af);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color, #1e40af) 35%, transparent);
}

.page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================================
   PROGRESS BARS - Vibrant and animated
   ============================================================================ */

.progress {
  height: 1rem;
  border-radius: var(--border-radius, 8px);
  background: color-mix(in srgb, var(--primary-color, #1e40af) 10%, #e5e7eb);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-bar {
  background: linear-gradient(90deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 50%,
    var(--accent-color, #3b82f6) 100%);
  background-size: 200% 100%;
  animation: progressGradient 3s ease infinite;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color, #1e40af) 40%, transparent);
}

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

/* ============================================================================
   MODALS - Elegant overlays
   ============================================================================ */

.modal-content {
  border: none;
  border-radius: calc(var(--border-radius, 8px) * 1.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 10%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 6%, white) 100%);
  border-bottom: 3px solid color-mix(in srgb, var(--primary-color, #1e40af) 30%, transparent);
  padding: 1.5rem;
}

.modal-title {
  color: var(--primary-color, #1e40af);
  font-weight: 700;
}

.modal-footer {
  background: color-mix(in srgb, var(--primary-color, #1e40af) 3%, white);
  border-top: 1px solid color-mix(in srgb, var(--primary-color, #1e40af) 15%, transparent);
}

/* ============================================================================
   DROPDOWNS - Sleek menus
   ============================================================================ */

.dropdown-menu {
  border: none;
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: calc(var(--border-radius, 8px) * 0.75);
  padding: 0.625rem 1rem;
  transition: all 0.2s ease;
  color: var(--text-color, #333333);
  font-weight: 500;
}

.dropdown-item:hover, .dropdown-item:focus {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 12%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 8%, white) 100%);
  color: var(--primary-color, #1e40af);
  transform: translateX(4px);
}

.dropdown-item.active, .dropdown-item:active {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  color: white;
}

.dropdown-divider {
  border-top-color: color-mix(in srgb, var(--primary-color, #1e40af) 15%, #e5e7eb);
  margin: 0.5rem 0;
}

/* ============================================================================
   LIST GROUPS - Organized content
   ============================================================================ */

.list-group-item {
  border: 1px solid color-mix(in srgb, var(--primary-color, #1e40af) 15%, #e5e7eb);
  border-radius: var(--border-radius, 8px);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.list-group-item:hover {
  background: color-mix(in srgb, var(--primary-color, #1e40af) 5%, white);
  transform: translateX(4px);
  border-color: var(--primary-color, #1e40af);
}

.list-group-item.active {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  border-color: var(--primary-color, #1e40af);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color, #1e40af) 35%, transparent);
}

/* ============================================================================
   BREADCRUMBS - Navigational clarity
   ============================================================================ */

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1.5rem;
}

.breadcrumb-item {
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "→";
  color: color-mix(in srgb, var(--primary-color, #1e40af) 50%, transparent);
  font-weight: 700;
}

.breadcrumb-item a {
  color: var(--primary-color, #1e40af);
  text-decoration: none;
  transition: all 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--secondary-color, #1e3a8a);
  transform: translateX(2px);
  display: inline-block;
}

.breadcrumb-item.active {
  color: var(--text-color, #333333);
  font-weight: 600;
}

/* ============================================================================
   SPINNERS - Loading indicators
   ============================================================================ */

.spinner-border, .spinner-grow {
  color: var(--primary-color, #1e40af);
}

/* Custom gradient spinner */
.spinner-border-gradient {
  width: 3rem;
  height: 3rem;
  border: 0.25rem solid transparent;
  border-radius: 50%;
  border-top-color: var(--primary-color, #1e40af);
  border-right-color: var(--secondary-color, #1e3a8a);
  border-bottom-color: var(--accent-color, #3b82f6);
  animation: spinner-rotate 1s linear infinite;
}

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

/* ============================================================================
   TOASTS - Notification styles
   ============================================================================ */

.toast {
  border: none;
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.toast-header {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 12%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 8%, white) 100%);
  color: var(--primary-color, #1e40af);
  border-bottom: 2px solid color-mix(in srgb, var(--primary-color, #1e40af) 25%, transparent);
  font-weight: 600;
}

/* ============================================================================
   TABS - Organized navigation
   ============================================================================ */

.nav-tabs {
  border-bottom: 2px solid color-mix(in srgb, var(--primary-color, #1e40af) 20%, #e5e7eb);
}

.nav-tabs .nav-link {
  border: none;
  color: var(--text-color, #333333);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.nav-tabs .nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  transition: width 0.3s ease;
}

.nav-tabs .nav-link:hover, .nav-tabs .nav-link.active {
  color: var(--primary-color, #1e40af);
  background: color-mix(in srgb, var(--primary-color, #1e40af) 5%, transparent);
}

.nav-tabs .nav-link.active::after {
  width: 100%;
}

/* ============================================================================
   GRADIENT UTILITIES - Reusable classes
   ============================================================================ */

.bg-gradient-primary {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%) !important;
  color: white !important;
}

.bg-gradient-primary-subtle {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-color, #1e40af) 15%, white) 0%,
    color-mix(in srgb, var(--secondary-color, #1e3a8a) 10%, white) 100%) !important;
  color: var(--primary-color, #1e40af) !important;
}

.text-gradient {
  background: linear-gradient(135deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* ============================================================================
   ACCENT COLOR UTILITIES
   ============================================================================ */

.text-accent {
  color: var(--accent-color, #3b82f6) !important;
}

.bg-accent {
  background-color: var(--accent-color, #3b82f6) !important;
  color: white !important;
}

.border-accent {
  border-color: var(--accent-color, #3b82f6) !important;
}

/* ============================================================================
   SHADOWS - Depth and elevation
   ============================================================================ */

.shadow-brand {
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary-color, #1e40af) 25%, transparent) !important;
}

.shadow-brand-lg {
  box-shadow: 0 16px 48px color-mix(in srgb, var(--primary-color, #1e40af) 35%, transparent) !important;
}

/* ============================================================================
   UTILITY CLASSES - Quick styling
   ============================================================================ */

.border-primary {
  border-color: var(--primary-color, #1e40af) !important;
}

.border-secondary {
  border-color: var(--secondary-color, #1e3a8a) !important;
}

.text-primary {
  color: var(--primary-color, #1e40af) !important;
}

.text-secondary {
  color: var(--secondary-color, #1e3a8a) !important;
}

.bg-primary {
  background-color: var(--primary-color, #1e40af) !important;
}

.bg-secondary {
  background-color: var(--secondary-color, #1e3a8a) !important;
}

/* ============================================================================
   LINKS - Enhanced styling
   ============================================================================ */

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
  color: var(--link-color, var(--primary-color, #1e40af));
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--primary-color, #1e40af) 0%,
    var(--secondary-color, #1e3a8a) 100%);
  transition: width 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover {
  color: var(--secondary-color, #1e3a8a);
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover::after {
  width: 100%;
}

/* ============================================================================
   ANIMATIONS - Micro-interactions
   ============================================================================ */

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

/* ============================================================================
   RESPONSIVE ENHANCEMENTS
   ============================================================================ */

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

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .table {
    font-size: 0.875rem;
  }
}

/* ============================================================================
   ENHANCED NAVBAR STYLES
   ============================================================================ */

/* Sticky navbar with smooth shadow on scroll */
.navbar.sticky-top {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Navbar brand with brand color */
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  transition: opacity 0.3s ease;
}

.navbar-brand:hover {
  opacity: 0.85;
}

/* Nav links with smooth hover effects */
.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--border-radius, 8px) * 0.75);
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover {
  background-color: color-mix(in srgb, var(--primary-color, #1e40af) 8%, transparent);
  color: var(--primary-color, #1e40af) !important;
}

.navbar-nav .nav-link.active {
  background-color: color-mix(in srgb, var(--primary-color, #1e40af) 12%, transparent);
  color: var(--primary-color, #1e40af) !important;
  font-weight: 600;
}

/* Dropdown menu enhancements */
.dropdown-menu {
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  border-radius: calc(var(--border-radius, 8px) * 1.5);
  padding: 0.5rem;
  margin-top: 0.5rem;
  animation: dropdownFadeIn 0.2s ease;
}

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

.dropdown-item {
  border-radius: var(--border-radius, 8px);
  padding: 0.625rem 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: color-mix(in srgb, var(--primary-color, #1e40af) 10%, transparent);
  color: var(--primary-color, #1e40af) !important;
  transform: translateX(4px);
}

.dropdown-item i {
  width: 20px;
  text-align: center;
}

/* Dropdown dividers */
.dropdown-divider {
  margin: 0.5rem 0;
  opacity: 0.1;
}

/* Notification badge */
.badge.rounded-pill {
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
}

/* User avatar in navbar */
.navbar .rounded-circle {
  border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar .nav-link:hover .rounded-circle {
  border-color: var(--primary-color, #1e40af);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color, #1e40af) 15%, transparent);
}

/* Mobile navbar improvements */
@media (max-width: 991px) {
  .navbar-collapse {
    background-color: var(--background-color, #ffffff);
    border-radius: calc(var(--border-radius, 8px) * 1.5);
    margin-top: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .navbar-nav .nav-link {
    margin-bottom: 0.25rem;
  }

  .dropdown-menu {
    border: none;
    box-shadow: none;
    background-color: color-mix(in srgb, var(--primary-color, #1e40af) 3%, transparent);
    margin-left: 1rem;
    margin-top: 0.5rem;
  }

  /* Stack user info on mobile */
  .navbar-nav.ms-auto {
    border-top: 1px solid color-mix(in srgb, var(--text-color, #333) 10%, transparent);
    padding-top: 1rem;
    margin-top: 1rem;
  }
}

/* Navbar toggler improvements */
.navbar-toggler:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color, #1e40af) 15%, transparent);
  border-color: var(--primary-color, #1e40af);
}

/* Dropdown toggle arrow */
.dropdown-toggle::after {
  transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* ============================================================================
   SKELETON LOADING STATES - React Suspense-style shimmer effects
   ============================================================================ */

/* Base skeleton element */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius, 8px);
  display: inline-block;
  position: relative;
  overflow: hidden;
}

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

/* Skeleton variants */
.skeleton-text {
  height: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.875rem;
  width: 80%;
}

.skeleton-text-lg {
  height: 1.25rem;
  width: 100%;
}

.skeleton-title {
  height: 2rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-circle {
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.skeleton-circle-sm {
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.skeleton-circle-lg {
  border-radius: 50%;
  width: 64px;
  height: 64px;
}

.skeleton-button {
  height: 2.5rem;
  width: 120px;
  border-radius: var(--border-radius, 8px);
}

.skeleton-badge {
  height: 1.5rem;
  width: 80px;
  border-radius: 1rem;
}

.skeleton-card {
  height: 100px;
  width: 100%;
  border-radius: calc(var(--border-radius, 8px) * 1.5);
  margin-bottom: 1rem;
}

.skeleton-stat-card {
  height: 120px;
  width: 100%;
  border-radius: calc(var(--border-radius, 8px) * 1.5);
}

.skeleton-table-row {
  height: 60px;
  width: 100%;
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius, 8px);
}

.skeleton-list-item {
  height: 80px;
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: var(--border-radius, 8px);
}

/* Skeleton with pulse animation (alternative style) */
.skeleton-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Fade in animation for loaded content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-loaded {
  animation: fadeIn 0.4s ease-out;
}

/* Turbo Frame loading state */
turbo-frame[busy] {
  opacity: 0.6;
  pointer-events: none;
}

turbo-frame[complete] {
  animation: fadeIn 0.4s ease-out;
}

/* ============================================================================
   BUTTON LOADING STATES - For form submissions
   ============================================================================ */

/* Loading button with spinner */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
  color: white;
}

.btn-outline-primary.btn-loading::after,
.btn-outline-secondary.btn-loading::after {
  color: var(--primary-color, #1e40af);
}

/* Disabled state during loading */
.btn-loading:disabled,
.btn-loading[disabled] {
  opacity: 0.8;
  cursor: not-allowed;
}

/* Form loading overlay */
.form-loading {
  position: relative;
  pointer-events: none;
}

.form-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  z-index: 10;
  border-radius: var(--border-radius, 8px);
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border: 3px solid var(--primary-color, #1e40af);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
  z-index: 11;
}
