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

:root {
  --font-sans: 'Inter', sans-serif;
  
  /* Light theme colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-sidebar: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --accent-primary: #3b82f6;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --card-hover-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}

.dark {
  /* Dark theme colors */
  --bg-primary: #0b0f19;
  --bg-secondary: #131c2e;
  --bg-sidebar: #0b0f19;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --accent-primary: #60a5fa;
  --accent-success: #34d399;
  --accent-danger: #f87171;
  --accent-warning: #fbbf24;
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.2), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --card-hover-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
  0% {
    background-color: rgba(148, 163, 184, 0.15);
  }
  50% {
    background-color: rgba(148, 163, 184, 0.3);
  }
  100% {
    background-color: rgba(148, 163, 184, 0.15);
  }
}

.skeleton {
  animation: skeleton-loading 1.5s infinite ease-in-out;
  border-radius: 4px;
}

/* Dynamic Animated Background for Login */
@keyframes gradient-bg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background: linear-gradient(-45deg, #0f172a, #1e3a8a, #0369a1, #0f172a);
  background-size: 400% 400%;
  animation: gradient-bg 15s ease infinite;
}

/* Custom UI styling adjustments */
.glassmorphism {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
}

/* Sidebar active states */
.sidebar-link-active {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary) !important;
  border-left: 4px solid var(--accent-primary);
}

/* Input Styles */
input, select, textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Mobile touch-friendly adjustments */
@media (max-width: 767px) {
  /* Prevent zoom on input focus (iOS) */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Larger touch targets for interactive elements */
  button, a, label, .cursor-pointer {
    min-height: 44px;
  }

  /* Adjust inline elements that don't need 44px */
  label.flex.items-center,
  a.text-blue-400,
  .toggle-password-btn {
    min-height: auto;
  }

  /* Sidebar: smoother on mobile */
  #sidebar-menu {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Card adjustments for mobile */
  .card-hover:hover {
    transform: none;
  }

  /* Pagination touch targets */
  .pagination-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Toast reposition for thumb reach */
  .swal2-toast {
    margin-top: 8px !important;
  }

  /* Remove backdrop blur on low-end devices for performance */
  .backdrop-blur-md {
    backdrop-filter: none;
  }
}

/* Touch manipulation for better mobile response */
.touch-manipulation {
  touch-action: manipulation;
}

/* Table sorting style helpers */
.sorting-asc::after {
  content: ' ▲';
  font-size: 0.7em;
}
.sorting-desc::after {
  content: ' ▼';
  font-size: 0.7em;
}

/* Dark mode utility classes (not generated by Tailwind due to content path mismatch) */
.dark .dark\:hidden {
  display: none !important;
}
.dark .dark\:inline {
  display: inline !important;
}
