/* City-Wide Document Tracker - Additional Styles */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

/* Button Styles */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Badge Animations */
.badge {
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Table Row Hover Effect */
tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  transform: translateX(3px);
  box-shadow: -3px 0 0 #667eea;
}

/* Modal Overlay Animation */
.modal {
  animation: fadeIn 0.3s ease;
}

.modal.active .modal-content {
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Form Input Focus Effects */
.form-input:focus,
.form-select:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Stat Card Glow Effect */
.stat-card {
  position: relative;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  opacity: 0;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
  transition: opacity 0.3s ease;
}

.stat-card:hover::after {
  opacity: 1;
}

/* Loading Spinner */
.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State Animation */
.empty-state {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Workflow Timeline Enhancements */
.workflow-step {
  animation: slideInLeft 0.4s ease;
  animation-fill-mode: backwards;
}

.workflow-step:nth-child(1) {
  animation-delay: 0.1s;
}

.workflow-step:nth-child(2) {
  animation-delay: 0.2s;
}

.workflow-step:nth-child(3) {
  animation-delay: 0.3s;
}

.workflow-step:nth-child(4) {
  animation-delay: 0.4s;
}

.workflow-step:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Priority Badge Pulse */
.badge[style*="dc3545"] {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
}

/* Search Input Enhancement */
#search-query {
  transition: all 0.3s ease;
}

#search-query:focus {
  background: linear-gradient(to right, #ffffff, #f8f9ff);
}

/* Panel Slide In */
.panel {
  animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  padding: 8px 12px;
  background: #333;
  color: white;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* Print Styles */
@media print {
  header nav,
  .btn,
  .modal,
  .pagination {
    display: none !important;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .stat-card {
    break-inside: avoid;
  }

  body {
    background: white;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .stat-card .value {
    font-size: 24px;
  }

  .stat-card .icon {
    font-size: 24px;
  }

  th, td {
    font-size: 12px;
    padding: 8px;
  }

  .btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .workflow-timeline {
    padding-left: 30px;
  }

  .workflow-step::before {
    left: -42px;
    width: 16px;
    height: 16px;
  }

  .workflow-step::after {
    left: -35px;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .badge {
    border: 2px solid currentColor;
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Skip to Main Content Link (Accessibility) */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: #667eea;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 10001;
}

.skip-to-main:focus {
  top: 0;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Custom Selection Color */
::selection {
  background: #667eea;
  color: white;
}

::-moz-selection {
  background: #667eea;
  color: white;
}
