/* Trufl Premium Theme */
:root {
  /* Primary Colors */
  --primary-color: #1A73E8;
  --primary-hover: #1557B0;
  --primary-light: #E8F0FE;
  --primary-gradient: linear-gradient(135deg, #1A73E8 0%, #4285F4 100%);
  
  /* Background Colors */
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-overlay: rgba(26, 115, 232, 0.1);
  
  /* Text Colors */
  --text-primary: #202124;
  --text-secondary: #5F6368;
  --text-muted: #9AA0A6;
  --text-white: #FFFFFF;
  
  /* Border & Shadow */
  --border-color: #E8EAED;
  --shadow-light: 0 2px 8px rgba(60, 64, 67, 0.08);
  --shadow-medium: 0 4px 16px rgba(60, 64, 67, 0.12);
  --shadow-heavy: 0 8px 24px rgba(60, 64, 67, 0.16);
  
  /* Dark Mode */
  --dark-bg: #0D1B2A;
  --dark-card: #1A2332;
  --dark-text: #E8EAED;
  --dark-border: #3C4043;
  
  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
  transition: all 0.3s ease;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 500; }
h5 { font-size: 1.125rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

/* Premium Buttons */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: 12px 24px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: var(--shadow-light);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
  color: var(--text-white);
}

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

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

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
}

.btn-secondary:hover {
  background: var(--bg-light);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
}

/* Premium Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  overflow: hidden;
}

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

.card-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-md);
  font-weight: 600;
}

.card-body {
  padding: var(--spacing-md);
}

/* Premium Navigation */
.navbar {
  background: var(--bg-white) !important;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--primary-hover) !important;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background: var(--primary-light);
}

/* Hamburger Menu Fix - Make it blue for visibility */
.navbar-toggler {
  border: 1px solid var(--primary-color) !important;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.25) !important;
  border-color: var(--primary-color) !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='%231A73E8' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  width: 1.5em;
  height: 1.5em;
}

.dropdown-menu {
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-medium);
  border-radius: var(--radius-md);
  padding: 8px;
}

.dropdown-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

/* Premium Forms */
.form-control {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: var(--bg-white);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
  outline: none;
}

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

/* Statistics Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-heavy);
}

.stat-card.primary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
}

.stat-card.success {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
}

.stat-card.warning {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
}

.stat-card.info {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
}

/* Premium Badges */
.badge {
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
}

.badge.bg-primary {
  background: var(--primary-color) !important;
}

.badge.bg-success {
  background: #34A853 !important;
}

.badge.bg-warning {
  background: #FBBC04 !important;
  color: var(--text-primary) !important;
}

.badge.bg-info {
  background: #4285F4 !important;
}

/* Premium Tables */
.table {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.table th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--bg-light);
}

/* Premium Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes bounceIn {
  0% { transform: scale(0.9); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

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

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.animate-fade-in {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slide-left {
  opacity: 0;
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-bounce {
  animation: bounceIn 0.6s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Staggered animations */
.animate-fade-in:nth-child(1) { animation-delay: 0.1s; }
.animate-fade-in:nth-child(2) { animation-delay: 0.2s; }
.animate-fade-in:nth-child(3) { animation-delay: 0.3s; }
.animate-fade-in:nth-child(4) { animation-delay: 0.4s; }

/* Premium Input Focus Effects */
.form-control:focus, .form-select:focus {
  transform: scale(1.01);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium Table Enhancements */
.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  transform: translateX(4px);
}

/* Premium Scroll Effects */
.container {
  scroll-behavior: smooth;
}

/* Advanced Hover Effects */
.card, .stat-card {
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(26, 115, 232, 0.15);
}

.card::before, .stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(26, 115, 232, 0.08), transparent);
  transition: left 0.6s ease;
}

.card:hover::before, .stat-card:hover::before {
  left: 100%;
}

/* Premium Text Selection */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}

/* Advanced Button Effects */
.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transform: translateY(0);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  letter-spacing: 0.025em;
}

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

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(26, 115, 232, 0.4);
}

.btn-outline-primary:hover {
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.2);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
  z-index: -1;
}

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

/* Premium Loading States */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 115, 232, 0.05);
  animation: shimmer 1.5s infinite;
}

/* World-Class Final Touches */
.hero-section {
  background: radial-gradient(circle at 50% 50%, rgba(26, 115, 232, 0.03) 0%, transparent 70%);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}

.display-2, .display-6 {
  line-height: 1.1;
}

/* Premium Badge Styling */
.badge {
  font-weight: 600;
  letter-spacing: 0.025em;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-full);
}

/* Enhanced Focus States */
.btn:focus, .form-control:focus, .form-select:focus {
  outline: 2px solid rgba(26, 115, 232, 0.3);
  outline-offset: 2px;
}

/* Premium Icon Styling */
.fas, .fab {
  transition: transform 0.2s ease;
}

.card:hover .fas, .stat-card:hover .fas {
  transform: scale(1.05);
}

/* Override any dark backgrounds - Force clean theme */
.bg-dark, .navbar-dark, .table-dark {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
}

/* Force white backgrounds on key elements */
body {
  background: #FFFFFF !important;
}

/* Force clean white theme throughout */
.container, .hero-section, main, .content {
  background: #FFFFFF !important;
}

/* Ensure no dark overlays */
.card, .hero-section, .bg-* {
  background: #FFFFFF !important;
}

/* Ensure all form elements are clean */
.form-control, .form-select, input, textarea, select {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

/* Clean table styling */
.table {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
}

.table thead th {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
}

.table tbody td {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
}

.table tbody tr:hover td {
  background: var(--primary-light) !important;
}

/* Clean card styling */
.card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
}

.card-header {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

/* Ensure dropdowns are clean */
.dropdown-menu {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
}

.dropdown-item {
  color: var(--text-primary) !important;
}

.dropdown-item:hover {
  background: var(--primary-light) !important;
  color: var(--primary-color) !important;
}

/* Force override any remaining dark elements */
.bg-secondary {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
}

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

.text-muted {
  color: #6C757D !important;
}

/* Ensure all borders are light */
.border-dark, .border-secondary {
  border-color: var(--border-color) !important;
}

/* Clean alerts */
.alert {
  border: 1px solid var(--border-color) !important;
}

/* Modal styling */
.modal-content {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-color) !important;
  background: var(--bg-light) !important;
}

.modal-footer {
  border-top: 1px solid var(--border-color) !important;
  background: var(--bg-light) !important;
}

/* Pagination */
.page-item .page-link {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.page-item.active .page-link {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* Premium Loading */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

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

/* Dark Mode */
[data-theme="dark"] {
  --bg-white: var(--dark-bg);
  --bg-light: var(--dark-card);
  --bg-card: var(--dark-card);
  --text-primary: var(--dark-text);
  --text-secondary: #9AA0A6;
  --border-color: var(--dark-border);
}

[data-theme="dark"] body {
  background: var(--dark-bg);
  color: var(--dark-text);
}

[data-theme="dark"] .navbar {
  background: var(--dark-card) !important;
}

[data-theme="dark"] .card {
  background: var(--dark-card);
  border-color: var(--dark-border);
}

/* Enhanced Brand Styling */
.navbar-brand:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  
  /* Mobile hero adjustments */
  .hero-section h1 {
    font-size: 3.5rem !important;
    letter-spacing: 1px !important;
  }
  
  /* Mobile navbar brand */
  .navbar-brand .small {
    display: none;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .card-body {
    padding: var(--spacing-sm);
  }
  
  .stat-card {
    padding: var(--spacing-sm);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

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