/* ============================================
   Custom Styles for Barstow Document Portal
   ============================================ */

/* Import Inter font from Google Fonts for professional look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #334155;
}

/* Header Enhancements */
header {
  border-bottom: 4px solid #1e40af;
}

/* Table Enhancements */
#documents-table {
  font-size: 14px;
}

#documents-table thead th {
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Smooth transitions for interactive elements */
button,
a,
input,
select {
  transition: all 0.2s ease-in-out;
}

/* Focus styles for accessibility */
input:focus,
select:focus,
button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Loading spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Custom scrollbar for table container */
.overflow-x-auto::-webkit-scrollbar {
  height: 8px;
}

.overflow-x-auto::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Print styles */
@media print {
  header,
  #search,
  #category-filter,
  #clear-filters,
  #loading,
  #error {
    display: none !important;
  }

  body {
    background: white;
  }

  #table-container {
    box-shadow: none;
  }

  #documents-table {
    font-size: 10px;
  }

  #documents-table th,
  #documents-table td {
    padding: 4px;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.875rem;
  }

  #documents-table {
    font-size: 12px;
  }

  #documents-table th,
  #documents-table td {
    padding: 12px 8px;
  }

  /* Make table scrollable on mobile */
  .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Hover effects for better UX */
#documents-table tbody tr:hover {
  background-color: #f8fafc;
  cursor: default;
}

/* Badge styles for file types */
.bg-blue-100 {
  background-color: #dbeafe;
}

.text-blue-800 {
  color: #1e40af;
}

/* Download link styles */
#documents-table a[download] {
  font-weight: 500;
  text-decoration: none;
}

#documents-table a[download]:hover {
  text-decoration: underline;
}

/* Empty state styling */
#no-results {
  padding: 3rem 1.5rem;
}

/* Results count styling */
#results-count {
  font-size: 0.875rem;
}

/* Error message styling */
#error {
  border-left: 4px solid #dc2626;
}

/* Loading state styling */
#loading {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Utility classes for consistent spacing */
.section-spacing {
  margin-bottom: 1.5rem;
}

:root {
  --color-primary: #003366;        /* Navy blue - primary brand */
  --color-primary-light: #004C99;  /* Lighter blue for hovers */
  --color-accent: #99CCFF;         /* Light blue accent */
  --color-secondary: #6B7280;      /* Gray for secondary actions */
  --color-background: #f8fafc;     /* Light gray background */
  --color-border: #e2e8f0;         /* Border gray */
  --color-text: #334155;           /* Dark gray text */
  --color-text-light: #64748b;     /* Light gray text */
  --color-error: #dc2626;          /* Red for errors */
  --color-success: #16a34a;        /* Green for success */
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  button,
  a {
    text-decoration: underline;
  }

  #documents-table tbody tr:hover {
    background-color: #e2e8f0;
    outline: 2px solid #1e40af;
  }
}

/* Dark mode support (optional enhancement) */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode */
  /*
  body {
    background-color: #0f172a;
    color: #e2e8f0;
  }

  header {
    background-color: #1e293b;
  }

  #documents-table,
  .bg-white {
    background-color: #1e293b;
    color: #e2e8f0;
  }

  #documents-table thead {
    background-color: #334155;
  }

  #documents-table tbody tr:hover {
    background-color: #334155;
  }

  input,
  select {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #475569;
  }
  */
}
