/* Custom styles for Peering Reach */

/* Global Styles */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

main {
  flex: 1 0 auto;
}

/* Navigation Styles */
.navbar-brand {
  font-weight: 600;
  font-size: 1.2rem;
}

.navbar-brand i {
  color: #ffc107;
}

/* Card Enhancements */
.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.card-header {
  border-radius: 0.75rem 0.75rem 0 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Form Styling */
#asCheckForm .input-group {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
  overflow: hidden;
}

#asCheckForm .form-control {
  border: 1px solid #dee2e6;
  border-left: none;
  border-right: none;
}

#asCheckForm .input-group-text {
  background-color: #f8f9fa;
  border-right: none;
  font-weight: 600;
}

#asCheckForm .btn {
  border-left: none;
}

/* Results Table Styling */
.table-responsive {
  border-radius: 0 0 0.75rem 0.75rem;
}

.table thead th {
  border-top: none;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.table tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Status Icons */
.status-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.status-reachable {
  color: #198754;
}

.status-unreachable {
  color: #dc3545;
}

/* Exchange Badges */
.exchange-badge {
  background-color: #e9ecef;
  color: #495057;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin: 0.125rem;
  display: inline-block;
}

.exchange-badge.iaa {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.exchange-badge.common {
  background-color: #198754;
  /* Bootstrap success */
  color: #fff;
  border: 1px solid #146c43;
  font-weight: 600;
  box-shadow: 0 0 0 0.15rem rgba(25, 135, 84, 0.25);
}

.exchange-badge.muted {
  background-color: #f8f9fa;
  color: #6c757d;
  opacity: 0.85;
  border: 1px solid #e9ecef;
}

/* Loading Animation */
#loadingIndicator {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Progress Bars */
.progress {
  height: 1rem;
  border-radius: 0.5rem;
  background-color: #e9ecef;
}

.progress-bar {
  border-radius: 0.5rem;
  transition: width 0.6s ease;
}

/* Recommended Exchanges Grid */
.exchange-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.exchange-card:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.exchange-card h6 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.exchange-card small {
  color: #6c757d;
}

/* Statistics Cards */
.stats-card {
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
}

.stats-card.primary {
  border-left-color: #0d6efd;
}

.stats-card.success {
  border-left-color: #198754;
}

.stats-card.info {
  border-left-color: #0dcaf0;
}

/* Alert Styling */
.alert {
  border: none;
  border-radius: 0.75rem;
  border-left: 4px solid;
}

.alert-danger {
  border-left-color: #dc3545;
  background-color: #f8d7da;
  color: #721c24;
}

/* Footer */
.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.footer a {
  color: #6c757d;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }

  .card-body {
    padding: 1rem;
  }

  .stats-card h3 {
    font-size: 1.5rem;
  }

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

  .exchange-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1rem;
  }

  .display-4 {
    font-size: 1.75rem;
  }

  .lead {
    font-size: 1rem;
  }

  .btn-group-vertical .btn {
    font-size: 0.875rem;
  }
}

/* Print Styles */
@media print {

  .navbar,
  .footer,
  #asCheckForm,
  .btn,
  .alert {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
    break-inside: avoid;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    break-after: avoid;
  }
}

/* Accessibility Enhancements */
.btn:focus,
.form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  border-color: #86b7fe;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #000;
  }

  .exchange-badge {
    border: 1px solid #000;
  }

  .status-reachable {
    color: #000;
    background-color: #0f0;
  }

  .status-unreachable {
    color: #fff;
    background-color: #f00;
  }
}

/* Theme-specific customizations (Bootstrap dark mode handles most styling) */
/* Keep only application-specific dark mode styles that Bootstrap doesn't cover */

/* Animation for results appearance */
.results-animate {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Utility classes */
.text-shadow {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.border-start-primary {
  border-left: 4px solid #0d6efd;
}

.border-start-success {
  border-left: 4px solid #198754;
}

.border-start-warning {
  border-left: 4px solid #ffc107;
}

.cursor-pointer {
  cursor: pointer;
}

.user-select-none {
  user-select: none;
}

/* Results legend */
.results-legend {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.results-legend .legend-item {
  font-size: 0.9rem;
  color: #6c757d;
}

.results-legend .exchange-badge {
  margin-right: 0.25rem;
}

.legend-swatch {
  display: inline-block;
  width: 1rem;
  height: 0.8rem;
  border-radius: 0.2rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}