/* Site-specific styles that complement the modern theme */

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Enhanced focus styles for accessibility */
.btn:focus, 
.btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Layout adjustments */
html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-400);
}

/* Table enhancements */
.table-responsive {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Form improvements */
.form-floating > label {
  color: var(--text-secondary);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary-600);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  border-top-color: var(--primary-500);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile-first responsive design helpers */
@media (max-width: 575.98px) {
  .table-responsive {
    border: none;
    box-shadow: none;
  }
  
  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
  
  .btn-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  .btn-xs {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 767.98px) {
  .content-panel,
  .form-panel {
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }
  
  .content-panel h4,
  .panel-heading h4 {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .search-container {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .page-header {
    margin-bottom: 1rem;
  }
  
  .dashboard-card {
    padding: 1.5rem;
  }
  
  .stat-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .header,
  .site-footer,
  .btn,
  .page-header .btn,
  .action-buttons {
    display: none !important;
  }
  
  #main-content {
    margin-left: 0 !important;
  }
  
  .content-panel {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .table {
    font-size: 10pt;
  }
  
  .table th,
  .table td {
    padding: 0.25rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-500: #0066cc;
    --primary-600: #0052a3;
    --text-primary: #000000;
    --text-secondary: #444444;
    --border-medium: #666666;
  }
  
  .btn {
    border-width: 2px;
  }
  
  .table th {
    border-bottom: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible for better keyboard navigation */
@supports selector(:focus-visible) {
  .btn:focus:not(:focus-visible) {
    box-shadow: none;
  }
  
  .btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.5);
  }
}

/* Custom utility classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
  aspect-ratio: 1 / 1;
}

/* Animation classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Better link styles */
a {
  color: var(--primary-600);
  text-decoration: none;
}

a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* Enhanced card styles */
.card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border-bottom: 1px solid var(--border-light);
  color: var(--primary-700);
  font-weight: 600;
}

/* Enhanced list styles */
.list-group-item {
  border-color: var(--border-light);
  transition: var(--transition-fast);
}

.list-group-item:hover {
  background-color: var(--bg-tertiary);
}

.list-group-item.active {
  background-color: var(--primary-500);
  border-color: var(--primary-500);
}

/* Better modal styles */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-secondary);
}

/* Status indicators */
.status-online {
  color: var(--accent-green);
}

.status-offline {
  color: var(--text-muted);
}

.status-busy {
  color: var(--accent-red);
}

.status-away {
  color: var(--accent-yellow);
}

/* Notification badges */
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--accent-red);
  color: var(--text-white);
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Progress bars */
.progress {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  transition: width 0.6s ease;
}

/* Toast notifications */
.toast {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.toast-header {
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  color: var(--primary-700);
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here */
}