/* ==========================================================================
   REUSABLE COMPONENTS
   ========================================================================== */

/* Loading indicator */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-content {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.loading-text {
  color: var(--muted-fg);
  font-size: var(--fs-body);
  margin: 0;
}

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

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: white;
  font-weight: 500;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 300px;
  word-wrap: break-word;
}

.notification--visible {
  transform: translateX(0);
}

.notification--info {
  background: var(--accent);
}

.notification--error {
  background: #dc2626;
}

.notification--success {
  background: #16a34a;
}

.notification--warning {
  background: #ca8a04;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  color: var(--panel-fg);
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Form controls */
select, input[type="text"], input[type="email"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-body);
  font-family: inherit;
  background: var(--panel-bg);
  color: var(--panel-fg);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-fg);
  font-size: 12px;
  border: 1px solid var(--border);
}

.chipTitle {
  font-weight: 600;
  margin-right: 4px;
}

.chipContent {
  font-weight: 400;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .btn {
    font-size: 14px;
    padding: 6px 12px;
  }
}
