/* =========================================================
   components.css — reusable UI components
   ========================================================= */

/* -------- Top header -------- */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: calc(var(--safe-left) + 16px);
  padding-right: calc(var(--safe-right) + 16px);
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.0) 100%
  );
  z-index: 10;
  pointer-events: none;
}
.app-header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}
.app-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* -------- Icon buttons -------- */
.icon-btn {
  height: 36px;
  min-height: 36px;
  min-width: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* -------- Floating Action Button -------- */
.fab {
  position: fixed;
  right: calc(var(--safe-right) + 20px);
  bottom: calc(var(--safe-bottom) + 24px);
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 28px var(--accent-glow);
  z-index: 11;
  transition: transform 0.15s ease;
}
.fab:active {
  transform: scale(0.94);
}

/* -------- Primary / secondary buttons -------- */
.btn {
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #000;
}
.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--block {
  width: 100%;
}

/* -------- Toast -------- */
.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease-out;
  max-width: 90vw;
}
.toast--error  { border-color: var(--danger); }
.toast--success { border-color: var(--success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -------- Spinner -------- */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -------- Form fields -------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.field-input,
.field-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  min-height: 48px;
  width: 100%;
}
.field-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.field-input:focus,
.field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
