/* Financial Analysis Page Styles */

/* Timeline Styles */
.timeline-horizontal {
  display: flex;
  overflow-x: auto;
  padding: 20px 0;
  gap: 20px;
  scroll-behavior: smooth;
}

.timeline-item {
  min-width: 200px;
  max-width: 200px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.timeline-item:hover {
  transform: translateY(-5px);
}

.timeline-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #007bff;
  margin: 0 auto 10px;
  border: 3px solid white;
  box-shadow: 0 0 0 3px #007bff;
  position: relative;
  z-index: 2;
}

.timeline-marker.bg-warning {
  background-color: #ffc107;
  box-shadow: 0 0 0 3px #ffc107;
}

.timeline-marker.bg-danger {
  background-color: #dc3545;
  box-shadow: 0 0 0 3px #dc3545;
}

.timeline-marker.bg-info {
  background-color: #17a2b8;
  box-shadow: 0 0 0 3px #17a2b8;
}

.timeline-marker.bg-success {
  background-color: #28a745;
  box-shadow: 0 0 0 3px #28a745;
}

.timeline-marker.bg-dark {
  background-color: #343a40;
  box-shadow: 0 0 0 3px #343a40;
}

.timeline-item:not(:last-child) .timeline-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 22px;
  width: 20px;
  height: 2px;
  background-color: #dee2e6;
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-content {
  text-align: center;
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
  transition: box-shadow 0.3s ease;
  width: 170px;
  max-width: 170px;
  box-sizing: border-box;
  margin: 0 auto;
}

.timeline-item:hover .timeline-content {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.timeline-header h6 {
  color: #6c757d;
  font-weight: bold;
  margin-bottom: 5px;
}

.timeline-title {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  display: block;
}

.timeline-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  text-align: left;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.timeline-details p {
  margin-bottom: 0;
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Campaign Icon Styles */
.campaign-icon {
  font-size: 3.5rem;
  color: #dc3545;
}

.warning-section {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border-radius: 10px;
  padding: 2rem;
  margin: 2rem 0;
}

.debt-highlight {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: #212529;
  border-radius: 10px;
  padding: 2rem;
  margin: 2rem 0;
}

/* Interactive Charts Styles */
.color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  border: 1px solid #ddd;
}

.btn-group .btn:has(a) {
  padding: 0;
}

.btn-group .btn a {
  padding: 0.375rem 0.75rem;
  display: block;
}

/* Modal Styles */
.modal-xl {
  max-width: 95%;
}

.table-responsive {
  max-height: 70vh;
  overflow-y: auto;
}

.modal-body .table th {
  position: sticky;
  top: 0;
  background-color: #212529;
  z-index: 10;
}

/* Highlight important rows */
.table-warning {
  background-color: rgba(255, 193, 7, 0.1);
}

/* Style for PDF links */
.modal-body a[href$=".pdf"] {
  color: #dc3545;
  font-weight: 500;
  transition: color 0.2s ease;
}

.modal-body a[href$=".pdf"]:hover {
  color: #bb2d3b;
  text-decoration: underline;
}

/* Loading spinner styling */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Button loading state */
.btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error states */
.text-danger {
  color: #dc3545 !important;
}

.alert-error {
  background-color: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
  .timeline-horizontal {
    padding: 10px 0;
    gap: 15px;
  }
  
  .timeline-item {
    min-width: 180px;
  }
  
  .timeline-content {
    padding: 10px;
  }
  
  .modal-xl {
    max-width: 100%;
    margin: 0;
  }
  
  .modal-body {
    padding: 1rem 0.5rem;
  }
  
  .table-responsive {
    font-size: 0.8rem;
  }
  
  .table th, .table td {
    padding: 0.3rem 0.2rem;
  }
  
  /* Stack buttons on mobile */
  .btn.btn-sm {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .timeline-item {
    min-width: 160px;
  }
}