@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .glass-panel {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .glass-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.dark .glass-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.7);
}

/* Matrix View Card Layout - Generous Width */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 1536px) {
  .matrix-grid {
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  }
}

/* Search Highlight */
mark.highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

.dark mark.highlight {
  background-color: #854d0e;
  color: #fef08a;
}

/* Sidebar Custom Styling */
.sidebar-nav-item {
  transition: all 0.15s ease-in-out;
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.3);
}

.sidebar-nav-item.active .badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.sidebar-nav-item.active i {
  color: #ffffff !important;
}

/* Icon-Only View Segmented Button */
.view-icon-btn {
  transition: all 0.15s ease-in-out;
}

.view-icon-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 8px -1px rgba(16, 185, 129, 0.35);
}

.view-icon-btn.active i {
  color: #ffffff !important;
}

/* Toast Animations */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.toast-enter {
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-exit {
  animation: fadeOut 0.3s ease forwards;
}

/* Shimmer Loading Effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.6) 25%, rgba(241, 245, 249, 0.9) 50%, rgba(226, 232, 240, 0.6) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.6) 25%, rgba(51, 65, 85, 0.9) 50%, rgba(30, 41, 59, 0.6) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Print Stylesheet for Physical Directory Prints */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
  }

  .no-print,
  #app-sidebar,
  #header-actions,
  #search-container,
  #sidebar-toggle-btn,
  #hotline-bar,
  #admin-modal,
  #toast-container,
  button {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .glass-panel,
  .glass-card {
    background: transparent !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border: 1px solid #ccc !important;
    padding: 4px 8px !important;
  }

  .matrix-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  @page {
    margin: 1cm;
    size: A4 portrait;
  }
}
