/* Import external libraries */
@import "@fortawesome/fontawesome-free/css/all.min.css"; /* Ensure FontAwesome icons are available */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* -- Custom Variables -- */
:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/poppins/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
}

/* Base styles */
body {
  font-family: 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: all 0.25s ease;
  background-color: transparent;
}

/* Optional: tambahkan ke elemen teks agar konsisten */
h1, h2, h3, h4, h5, h6, p, span, a, button, input, label {
  font-family: 'Poppins', sans-serif !important;
}

/* Sidebar */
.sidebar-item {
  @apply flex items-center px-3 py-3 text-sm font-medium transition-all duration-200 rounded-lg;
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-item:hover {
  @apply bg-[color:var(--primary-800)];
  color: #fff;
  transform: translateX(4px);
}

.sidebar-item.active {
  @apply bg-[color:var(--primary-700)];
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary-400);
}

/* Card Statistik */
.stat-card {
  @apply p-6 transition-transform duration-300 ease-in-out bg-white border border-gray-200 rounded-xl;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 6px 12px -6px rgba(0, 0, 0, 0.04);
}

/* Sidebar Scrollbar */
#sidebar {
  height: 100vh;
  overflow-y: auto;
}

#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Sidebar Responsive Toggle */
.mobile-menu-open {
  transform: translateX(0);
}

.mobile-menu-closed {
  transform: translateX(-100%);
}

/* Sidebar for mobile */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
  }
}

/* Sidebar for desktop */
@media (min-width: 1024px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: none !important;
  }
}

/* Button */
.btn-primary {
  @apply px-4 py-2 font-medium text-white transition-all duration-200 rounded-lg;
  background-color: var(--primary-600);
}

.btn-primary:hover {
  background-color: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

/* Form */
.form-input {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-[color:var(--primary-500)] focus:border-[color:var(--primary-500)];
}

.form-label {
  @apply block mb-1 text-sm font-medium text-gray-700;
}

/* Utility */
.d-none {
  display: none !important;
}

a {
  transition: color 0.15s ease;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.pagination li {
  margin: 0 4px;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: #374151;
  border: 1px solid #d1d5db;
  background: #fff;
  transition: all 0.15s ease;
}

.pagination li a:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pagination li.active span {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: #fff;
}

.pagination li.disabled span {
  color: #9ca3af;
  background: #f9fafb;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

/* Research list */
.research-item {
  transition: all 0.2s ease;
}

.research-item.hidden {
  display: none;
}

/* Print */
@media print {
  .no-print {
    display: none !important;
  }

  .print-break {
    page-break-after: always;
  }
}

/* Animation */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
