/* Shared Components: Breadcrumbs, Toasts, Spinners */

/* WIP Banner - 45 Degree Overlay */
body::before {
  content: "WIP - indicativeonly.com";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 72px;
  font-weight: 900;
  color: rgba(236, 72, 153, 0.08);
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
  letter-spacing: 4px;
  text-transform: uppercase;
  width: 200%;
  text-align: center;
  line-height: 1;
}

/* Breadcrumb Navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding: 0;
}

.breadcrumb a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--teal-light);
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text-secondary);
}

.breadcrumb span.separator {
  color: #999;
  margin: 0 0.25rem;
}

/* Loading Spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(8, 145, 178, 0.3);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.spinner-large {
  width: 24px;
  height: 24px;
  border-width: 3px;
  margin-right: 0.75rem;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 58, 95, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.loading-content p {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  background: #fff;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.removing {
  animation: slideOutRight 0.3s ease-out;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 20px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Toast Types */
.toast.success {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.toast.success .toast-icon {
  color: #10b981;
}

.toast.success .toast-message {
  color: #065f46;
}

.toast.error {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.toast.error .toast-icon {
  color: #ef4444;
}

.toast.error .toast-message {
  color: #7f1d1d;
}

.toast.info {
  border-left-color: var(--teal);
  background: #f0f9ff;
}

.toast.info .toast-icon {
  color: var(--teal);
}

.toast.info .toast-message {
  color: #0c4a6e;
}

.toast.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.toast.warning .toast-icon {
  color: #f59e0b;
}

.toast.warning .toast-message {
  color: #78350f;
}

/* Modal / Confirmation Dialogs */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 58, 95, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 9997;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-content {
  padding: 1.5rem;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: #fafafa;
}

.modal-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn-primary {
  background: var(--teal);
  color: #fff;
}

.modal-btn-primary:hover {
  background: var(--teal-light);
}

.modal-btn-secondary {
  background: var(--border-light);
  color: var(--text-primary);
}

.modal-btn-secondary:hover {
  background: #d1d5db;
}

.modal-btn-danger {
  background: #ef4444;
  color: #fff;
}

.modal-btn-danger:hover {
  background: #dc2626;
}

/* Search & Autocomplete */
.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.autocomplete-list.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}

.autocomplete-item:hover {
  background: #f9fafb;
}

.autocomplete-item.selected {
  background: #f0f9ff;
  color: var(--teal);
  font-weight: 600;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

/* Charts & Heatmap */
.chart-container {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.chart-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.heatmap {
  width: 100%;
  overflow-x: auto;
}

.heatmap-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.heatmap-table td,
.heatmap-table th {
  padding: 8px;
  text-align: center;
  border: 1px solid var(--border-light);
  font-weight: 500;
}

.heatmap-table th {
  background: #fafafa;
  color: var(--text-secondary);
  font-weight: 600;
}

.heatmap-cell {
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
}

.heatmap-cell.low {
  background: #d1fae5;
  color: #065f46;
}

.heatmap-cell.medium {
  background: #fef3c7;
  color: #78350f;
}

.heatmap-cell.high {
  background: #fca5a5;
  color: #7f1d1d;
}

.heatmap-cell.critical {
  background: #ef4444;
  color: #fff;
}

/* Filter UI */
.filter-panel {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.filter-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn-apply {
  background: var(--teal);
  color: #fff;
  flex: 1;
}

.filter-btn-apply:hover {
  background: var(--teal-light);
}

.filter-btn-reset {
  background: var(--border-light);
  color: var(--text-primary);
}

.filter-btn-reset:hover {
  background: #d1d5db;
}

/* Tags / Badges */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f9ff;
  border: 1px solid var(--teal);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  margin: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  background: var(--teal);
  color: #fff;
}

.tag.active {
  background: var(--teal);
  color: #fff;
}

.tag-remove {
  margin-left: 0.5rem;
  opacity: 0.7;
}

.tag-remove:hover {
  opacity: 1;
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.status-success {
  background: #d1fae5;
  color: #065f46;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

.status-warning {
  background: #fef3c7;
  color: #78350f;
}

.status-info {
  background: #f0f9ff;
  color: #0369a1;
}

/* List Items */
.list-item {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: all 0.2s;
}

.list-item:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.1);
}

.list-item-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 0.25rem;
}

.list-item-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.list-item-action {
  background: none;
  border: none;
  color: var(--teal);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s;
}

.list-item-action:hover {
  color: var(--teal-light);
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
  background: #f0f9ff;
}

.pagination-btn.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 1rem;
}

/* Tabs */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.tab-nav-item {
  padding: 1rem 0;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-nav-item:hover {
  color: var(--text-primary);
}

.tab-nav-item.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form Validation */
.form-error {
  display: none;
  color: #ef4444;
  font-size: 13px;
  margin-top: 0.5rem;
}

.form-error.show {
  display: block;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: calc(100% - 2rem);
  }

  .breadcrumb {
    font-size: 12px;
    flex-wrap: wrap;
  }

  .modal {
    width: 95%;
  }

  .filter-actions {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-btn {
    width: 100%;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .heatmap-table td,
  .heatmap-table th {
    padding: 6px 4px;
    font-size: 11px;
  }
}
