/* Minimal styling for the Basketball Optimizer starter app */
body {
  background: #f8f9fa;
  color: #212529;
}
main.container {
  max-width: 900px;
}

/* =========================
   TOAST NOTIFICATIONS
   ========================= */
.toast-container {
  position: fixed;
  top: 80px; /* Below header */
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.toast-container .alert {
  margin-bottom: 10px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* =========================
   LOADING STATES
   ========================= */
.btn-loading {
  position: relative;
  color: transparent !important;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   CARD HOVER EFFECTS
   ========================= */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(228, 0, 43, 0.15) !important;
}

/* =========================
   MOBILE RESPONSIVE TABLES
   ========================= */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .table-responsive {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
  }
  
  .table-responsive table {
    margin-bottom: 0;
  }
  
  /* Make editable cells easier to tap on mobile */
  td[contenteditable="true"] {
    min-height: 44px;
    padding: 12px 8px !important;
  }
  
  /* Stack form controls on mobile */
  .row.g-3 > [class*="col-"] {
    margin-bottom: 1rem;
  }
}

/* =========================
   ACTIVE NAV STATE
   ========================= */
.nav-link.active {
  color: var(--nc-red, #E4002B) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--nc-red, #E4002B);
}

.dropdown-item.active {
  background-color: var(--nc-red, #E4002B);
  color: white;
}

/* =========================
   BREADCRUMBS
   ========================= */
.breadcrumb {
  background-color: transparent;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--nc-red, #E4002B);
  font-weight: bold;
}

.breadcrumb-item.active {
  color: var(--nc-gray-700, #4a4a4a);
  font-weight: 600;
}

/* =========================
   INPUT VALIDATION
   ========================= */
td[contenteditable="true"].invalid {
  background-color: #fee;
  border: 1px solid #dc3545;
  outline: 2px solid #dc3545;
}

.validation-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* =========================
   TOOLTIPS
   ========================= */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #6c757d;
  color: white;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  margin-left: 4px;
}

/* =========================
   ACCESSIBILITY
   ========================= */
:focus-visible {
  outline: 2px solid var(--nc-red, #E4002B);
  outline-offset: 2px;
}

/* Screen reader only text */
.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;
}
