:root {
  --primary-100: #ff6600;
  --primary-200: #ff983f;
  --primary-300: #ffffa1;
  --accent-100: #f5f5f5;
  --accent-200: #929292;
  --text-100: #1d1f21;
  --text-200: #444648;
  --bg-100: #ffffff;
  --bg-200: #f5f5f5;
  --bg-300: #cccccc;
}

/* Typography: NestVerse brand font */
@import url("https://fonts.googleapis.com/css2?family=Agbalumo&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Quintessential&family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap");

body,
.navbar-brand,
.card-header,
h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.nav-link {
  font-family: "Work Sans", system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !important;
}

.brand-title {
  font-family: "Agbalumo", system-ui !important;
  letter-spacing: 0.5px;
}
.work-sans {
  font-family: "Work Sans", sans-serif !important;
  font-optical-sizing: auto;
}
.quintessential-regular {
  font-family: "Quintessential", serif !important;
  font-weight: 400;
  font-style: normal;
}
.libre-baskerville-regular {
  font-family: "Libre Baskerville", serif !important;
  font-weight: 400;
  font-style: normal;
}
.libre-baskerville-bold {
  font-family: "Libre Baskerville", serif !important;
  font-weight: 700;
  font-style: normal;
}
.libre-baskerville-regular-italic {
  font-family: "Libre Baskerville", serif !important;
  font-weight: 400;
  font-style: italic;
}

/* Override Bootstrap primary colors */
.btn-primary {
  background-color: var(--primary-100) !important;
  border-color: var(--primary-100) !important;
}

.btn-primary:hover {
  background-color: var(--primary-200) !important;
  border-color: var(--primary-200) !important;
  color: #fff !important;
}

.btn-outline-primary {
  color: var(--primary-100) !important;
  border-color: var(--primary-100) !important;
}

.btn-outline-primary:hover {
  background-color: var(--primary-100) !important;
  border-color: var(--primary-100) !important;
  color: var(--bg-100) !important;
}

.navbar-dark.bg-primary {
  background-color: var(--primary-100) !important;
}

.text-primary {
  color: var(--primary-100) !important;
}

.bg-primary {
  background-color: var(--primary-100) !important;
}

/* Custom background colors */
.bg-custom-100 {
  background-color: var(--bg-100);
}

/* Notification dropdown styles */
.notification-list {
  max-height: 300px;
  overflow-y: auto;
}

.notification-list::-webkit-scrollbar {
  width: 6px;
}

.notification-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb {
  background: var(--primary-100);
  border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-200);
}

.notification-item {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
  position: relative;
}

.notification-item:hover {
  background-color: rgba(255, 102, 0, 0.05) !important;
  border-left-color: var(--primary-100);
  transform: translateX(2px);
}

.notification-item:not(.bg-light) {
  border-left-color: var(--primary-100);
  background-color: rgba(255, 102, 0, 0.08) !important;
}

.notification-item.bg-light {
  border-left-color: transparent;
  background-color: #f8f9fa !important;
}

.notification-item.bg-light:hover {
  background-color: rgba(255, 102, 0, 0.03) !important;
  border-left-color: var(--primary-100);
}

.notification-clickable {
  cursor: pointer;
}

.notification-clickable:hover {
  background-color: rgba(255, 102, 0, 0.05) !important;
}

.notification-item .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Unread notification indicator */
.notification-item:not(.bg-light)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--primary-100);
  border-radius: 0 2px 2px 0;
}

/* Notification item content styling */
.notification-item h6 {
  transition: all 0.2s ease;
}

.notification-item:not(.bg-light) h6 {
  color: var(--text-100) !important;
  font-weight: 600 !important;
}

.notification-item.bg-light h6 {
  color: var(--text-200) !important;
  font-weight: 400 !important;
}

/* Notification timestamp styling */
.notification-item small {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.notification-item:hover small {
  opacity: 1;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.dropdown-header {
  background-color: transparent;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-100);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: rgba(255, 102, 0, 0.1);
  color: var(--primary-100);
}

.dropdown-item:active {
  background-color: var(--primary-100);
  color: white;
}

.bg-custom-200 {
  background-color: var(--bg-200);
}

.bg-custom-300 {
  background-color: var(--bg-300);
}

/* Custom text colors */
.text-custom-100 {
  color: var(--text-100);
}

.text-custom-200 {
  color: var(--text-200);
}

/* Custom accent colors */
.bg-accent-100 {
  background-color: var(--accent-100);
}

.bg-accent-200 {
  background-color: var(--accent-200);
}

/* Mobile-friendly improvements */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
  }

  .card {
    margin-bottom: 1rem;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }

  .display-1 {
    font-size: 3rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .table-responsive {
    font-size: 0.9rem;
  }

  .dropdown-menu {
    min-width: 200px;
  }
}

/* Animation enhancements */
.animate__animated {
  animation-duration: 0.6s;
}

.card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.btn {
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Custom form styling */
.form-control:focus {
  border-color: var(--primary-100);
  box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.25);
}

.form-select:focus {
  border-color: var(--primary-100);
  box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.25);
}

/* Custom alert styling */
.alert-danger {
  border-color: #dc3545;
  background-color: #f8d7da;
}

.alert-success {
  border-color: #198754;
  background-color: #d1e7dd;
}

.alert-info {
  border-color: #0dcaf0;
  background-color: #cff4fc;
}

/* Custom badge styling */
.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

.badge.bg-secondary {
  background-color: var(--accent-200) !important;
}

.badge.bg-dark {
  background-color: var(--text-100) !important;
}

/* Custom table styling */
.table {
  border-color: var(--bg-300);
}

.table th {
  background-color: var(--bg-200);
  border-color: var(--bg-300);
  color: var(--text-100);
  font-weight: 600;
}

.table td {
  border-color: var(--bg-300);
  color: var(--text-200);
}

/* Custom modal styling */
.modal-content {
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 1065;
}
.modal {
  z-index: 1060;
}
.modal.show {
  display: block;
}

.modal-header {
  background-color: var(--bg-200);
  border-bottom: 1px solid var(--bg-300);
}

.modal-footer {
  background-color: var(--bg-200);
  border-top: 1px solid var(--bg-300);
}

/* Modal backdrop override: dark blur */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop.show {
  opacity: 1 !important;
}

/* Custom dropdown styling */
.dropdown-menu {
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 1000;
}

.dropdown-item:hover {
  background-color: var(--bg-200);
}

/* Ensure dropdowns are visible */
.dropdown-menu.show {
  display: block !important;
}

/* Fix dropdown positioning */
.navbar-nav .dropdown-menu {
  position: absolute;
}

/* Custom pagination styling */
.page-link {
  color: var(--primary-100);
  border-color: var(--bg-300);
}

.page-link:hover {
  color: var(--primary-200);
  background-color: var(--bg-200);
  border-color: var(--bg-300);
}

.page-item.active .page-link {
  background-color: var(--primary-100);
  border-color: var(--primary-100);
}

/* Custom input group styling */
.input-group-text {
  background-color: var(--bg-200);
  border-color: var(--bg-300);
  color: var(--text-200);
}

/* Custom card styling */
.card-header {
  background-color: var(--bg-200);
  border-bottom: 1px solid var(--bg-300);
  color: var(--text-100);
  font-weight: 600;
}

.card-footer {
  background-color: var(--bg-200);
  border-top: 1px solid var(--bg-300);
}

/* Custom list group styling */
.list-group-item {
  border-color: var(--bg-300);
  color: var(--text-200);
}

.list-group-item:hover {
  background-color: var(--bg-200);
}

/* Custom progress bar styling */
.progress-bar {
  background-color: var(--primary-100);
}

/* Custom spinner styling */
.spinner-border.text-primary {
  color: var(--primary-100) !important;
}

/* Icon circle utilities for stat cards */
.icon-circle {
  width: 3rem;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  display: inline-grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  flex: 0 0 auto;
}
.icon-circle.sm {
  width: 2.5rem;
  aspect-ratio: 1 / 1;
}
.icon-circle.lg {
  width: 3.75rem;
  aspect-ratio: 1 / 1;
}
.bi {
  vertical-align: -0.125em;
  line-height: 1;
}
.bi {
  vertical-align: -0.125em;
}

/* Custom tooltip styling */
.tooltip-inner {
  background-color: var(--text-100);
}

.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: var(--text-100);
}

/* Custom popover styling */
.popover {
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.popover-header {
  background-color: var(--bg-200);
  border-bottom: 1px solid var(--bg-300);
  color: var(--text-100);
}

/* Custom navbar styling */
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 1);
}

.navbar-dark .navbar-nav .nav-link.active {
  color: rgba(255, 255, 255, 1);
  font-weight: 600;
}

/* Custom sidebar styling (if needed) */
.sidebar {
  background-color: var(--bg-200);
  border-right: 1px solid var(--bg-300);
}

.sidebar .nav-link {
  color: var(--text-200);
  border-radius: 8px;
  margin: 2px 0;
}

.sidebar .nav-link:hover {
  background-color: var(--bg-300);
  color: var(--text-100);
}

.sidebar .nav-link.active {
  background-color: var(--primary-100);
  color: white;
}

/* Mobile accordion styles for sidebar dropdown menus */
@media (max-width: 991.98px) {
  .sidebar .dropdown-menu,
  .nav-sidebar .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    margin-top: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .sidebar .dropdown-menu.show,
  .nav-sidebar .dropdown-menu.show {
    max-height: 300px;
    padding: 0.5rem 0;
  }

  .sidebar .dropdown-item,
  .nav-sidebar .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.5rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
  }

  .sidebar .dropdown-item:hover,
  .nav-sidebar .dropdown-item:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #fff;
  }

  .sidebar .dropdown-header,
  .nav-sidebar .dropdown-header {
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .sidebar .dropdown-divider,
  .nav-sidebar .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 1.5rem;
  }

  /* Accordion arrow indicator for sidebar */
  .sidebar .dropdown-toggle::after,
  .nav-sidebar .dropdown-toggle::after {
    transition: transform 0.3s ease;
  }

  .sidebar .dropdown-toggle[aria-expanded="true"]::after,
  .nav-sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
  }
}

/* Custom footer styling */
footer {
  background-color: var(--text-100) !important;
  color: var(--bg-100) !important;
}

/* Custom loading animation */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-300);
  border-top: 4px solid var(--primary-100);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Button spinner styles */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.btn:disabled .btn-spinner {
  margin-right: 0;
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading .btn-spinner {
  opacity: 1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-200);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-200);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-200);
}

/* Custom focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-100);
  outline-offset: 2px;
}

/* Custom selection styling */
::selection {
  background-color: var(--primary-300);
  color: var(--text-100);
}

/* Custom print styles */
@media print {
  .navbar,
  .btn,
  .dropdown-menu,
  .modal,
  .tooltip,
  .popover {
    display: none !important;
  }

  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }
}

/* Timeline styles for complaint lifecycle */
.timeline-container {
  position: relative;
  padding-left: 2rem;
}

.timeline-container::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #e9ecef 0%, #dee2e6 50%, #e9ecef 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.timeline-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.75rem;
  height: 0.75rem;
  background: white;
  border-radius: 50%;
  z-index: 1;
}

.timeline-marker i {
  position: relative;
  z-index: 3;
  font-size: 0.75rem;
}

.timeline-content {
  flex: 1;
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-left: 0.5rem;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.timeline-item:hover .timeline-content {
  background: #e9ecef;
  transform: translateX(2px);
}

.timeline-header {
  margin-bottom: 0.5rem;
}

.timeline-header h6 {
  margin: 0;
  font-weight: 600;
  font-size: 0.875rem;
}

.timeline-header small {
  font-size: 0.75rem;
}

.timeline-content p {
  margin: 0;
  line-height: 1.4;
}

/* Timeline marker colors */
.timeline-marker.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.timeline-marker.bg-info {
  background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.timeline-marker.bg-warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.timeline-marker.bg-primary {
  background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
}

.timeline-marker.bg-danger {
  background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.timeline-marker.bg-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.timeline-marker.bg-dark {
  background: linear-gradient(135deg, #343a40 0%, #212529 100%);
}
