/* ========================================
   SampLink Liberia - Enhanced UI/UX Styles
   Modern, Professional, Healthcare-focused
   ======================================== */

/* ==================== VARIABLES ==================== */
:root {
  /* Primary Colors - Medical & Health Theme */
  --primary-teal: #0891b2;
  --primary-teal-dark: #0e7490;
  --primary-teal-light: #06b6d4;
  --primary-blue: #3b82f6;
  --primary-blue-dark: #2563eb;
  
  /* Medical Colors */
  --medical-green: #059669;
  --medical-green-light: #10b981;
  --medical-blue: #0891b2;
  --medical-blue-light: #06b6d4;
  
  /* Accent Colors - Healthcare Theme */
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;
  --accent-purple: #7c3aed;
  --accent-teal: #0d9488;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Medical Gradients */
  --gradient-primary: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
  --gradient-secondary: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-info: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  
  /* Shadows with Medical Theme */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.10);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.20);
  --shadow-glow: 0 0 20px rgba(8, 145, 178, 0.3);
  --shadow-glow-green: 0 0 20px rgba(5, 150, 105, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
  transition: opacity 0.3s ease-out;
}

/* ==================== MAP VIEW BUTTONS ==================== */
.map-view-btn {
  @apply px-4 py-2 rounded-lg font-semibold transition-all;
  @apply bg-gray-200 text-gray-700;
}

.map-view-btn.active {
  @apply bg-blue-500 text-white shadow-lg;
}

.map-view-btn:hover:not(.active) {
  @apply bg-gray-300;
}

/* ==================== QUICK ACTION BUTTONS ==================== */
.quick-action-btn {
  @apply p-4 rounded-xl text-center cursor-pointer transition-all hover:shadow-xl hover:-translate-y-1;
}

/* ==================== GLOBAL ENHANCEMENTS ==================== */
* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(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;
  }
  50% {
    opacity: 0.5;
  }
}

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

/* ==================== ENHANCED CARDS ==================== */
.enhanced-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.enhanced-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

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

/* Glassmorphism Card */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* ==================== STAT CARDS WITH GRADIENTS ==================== */
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 28px;
  color: white;
  box-shadow: var(--shadow-xl);
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

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

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-2xl), var(--shadow-glow);
}

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

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

.stat-card-amber {
  background: var(--gradient-warning);
}

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

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

/* ==================== ENHANCED BUTTONS ==================== */
.btn-enhanced {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.btn-enhanced::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-enhanced:hover::before {
  width: 300px;
  height: 300px;
}

.btn-enhanced:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

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

/* Button Variants */
.btn-primary-gradient {
  background: var(--gradient-primary);
  border: none;
  color: white;
}

.btn-success-gradient {
  background: var(--gradient-success);
  border: none;
  color: white;
}

/* ==================== ENHANCED TABLES ==================== */
.enhanced-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.enhanced-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.enhanced-table thead th {
  padding: 16px;
  font-weight: 600;
  text-align: left;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.enhanced-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: all var(--transition-fast);
}

.enhanced-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.enhanced-table tbody td {
  padding: 16px;
  font-size: 14px;
  color: var(--gray-700);
}

.enhanced-table tbody tr:last-child {
  border-bottom: none;
}

/* Striped Table Variant */
.enhanced-table-striped tbody tr:nth-child(even) {
  background: rgba(249, 250, 251, 0.5);
}

/* ==================== ENHANCED FORMS ==================== */
.enhanced-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  transition: all var(--transition-base);
  background: white;
}

.enhanced-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.enhanced-input:hover {
  border-color: var(--gray-300);
}

/* Input with Icon */
.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  transition: color var(--transition-base);
}

.input-with-icon input {
  padding-left: 48px;
}

.input-with-icon input:focus + i {
  color: var(--primary-blue);
}

/* ==================== ENHANCED MODALS ==================== */
.enhanced-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--transition-base);
}

.enhanced-modal-content {
  background: white;
  border-radius: 20px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  animation: scaleIn var(--transition-base);
}

.enhanced-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-100);
}

/* ==================== BADGES & TAGS ==================== */
.enhanced-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.enhanced-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.badge-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.badge-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #dc2626 100%);
  color: white;
}

.badge-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

/* ==================== LOADING STATES ==================== */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-enhanced {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 300px;
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-2xl);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight var(--transition-base);
  border-left: 4px solid var(--primary-blue);
  z-index: 9999;
}

.toast-success {
  border-left-color: var(--accent-emerald);
}

.toast-error {
  border-left-color: var(--accent-rose);
}

.toast-warning {
  border-left-color: var(--accent-amber);
}

/* ==================== SIDEBAR ENHANCEMENTS ==================== */
.sidebar-enhanced {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.nav-item-enhanced {
  position: relative;
  margin: 4px 0;
  border-radius: 12px;
  transition: all var(--transition-base);
}

.nav-item-enhanced::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
  transition: height var(--transition-base);
}

.nav-item-enhanced:hover::before,
.nav-item-enhanced.active::before {
  height: 70%;
}

.nav-item-enhanced:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.nav-item-enhanced.active {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border-left: 3px solid #0891b2;
  color: #06b6d4;
}

/* ==================== CHART ENHANCEMENTS ==================== */
.chart-container-enhanced {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.chart-container-enhanced:hover {
  box-shadow: var(--shadow-2xl);
}

/* ==================== PROGRESS BARS ==================== */
.progress-bar-enhanced {
  height: 8px;
  background: var(--gray-200);
  border-radius: 50px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 50px;
  transition: width var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* ==================== SCROLL ENHANCEMENTS ==================== */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ==================== UTILITY CLASSES ==================== */
.fade-in-up {
  animation: fadeInUp var(--transition-base) ease-out;
}

.fade-in-down {
  animation: fadeInDown var(--transition-base) ease-out;
}

.slide-in-right {
  animation: slideInRight var(--transition-base) ease-out;
}

.scale-in {
  animation: scaleIn var(--transition-base) ease-out;
}

.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform var(--transition-base);
}

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

/* ==================== RESPONSIVE ENHANCEMENTS ==================== */
@media (max-width: 768px) {
  .enhanced-card {
    padding: 16px;
    border-radius: 12px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .enhanced-modal-content {
    padding: 24px;
    width: 95%;
  }
  
  .toast-enhanced {
    min-width: 280px;
    right: 16px;
    bottom: 16px;
  }
}

/* ==================== DARK MODE SUPPORT ==================== */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #18181b;
    --gray-100: #27272a;
    --gray-200: #3f3f46;
  }
}

/* ==================== LANGUAGE SWITCHER ==================== */
.language-switcher {
  position: relative;
  display: inline-block;
  margin-right: 12px;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
  color: var(--gray-700);
}

.language-btn:hover {
  background: var(--gray-200);
  border-color: var(--primary-blue);
}

.language-btn i {
  font-size: 18px;
}

.current-language {
  font-size: 20px;
  line-height: 1;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
  animation: fade-in var(--transition-fast);
}

.language-dropdown.hidden {
  display: none;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: var(--gray-50);
}

.language-option.active {
  background: var(--primary-blue);
  color: white;
}

.language-option .flag {
  font-size: 24px;
  line-height: 1;
}

.language-option .name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.language-option i.fa-check {
  color: white;
  font-size: 14px;
}

/* RTL Support */
[dir="rtl"] .language-switcher {
  margin-right: 0;
  margin-left: 12px;
}

[dir="rtl"] .language-dropdown {
  right: auto;
  left: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .language-btn {
    padding: 6px 10px;
  }
  
  .language-dropdown {
    min-width: 180px;
  }
  
  .language-option {
    padding: 10px 14px;
  }
}

/* ==================== ACCESSIBILITY ==================== */
.focus-visible:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
