/* ─── Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* ─── Auth Tabs ─────────────────────────────────────────── */
.tab-active {
  border-color: #6366f1;
  color: #6366f1;
  font-weight: 600;
}

.tab-inactive {
  border-color: transparent;
  color: #9ca3af;
}

.tab-inactive:hover {
  color: #6b7280;
  border-color: #e5e7eb;
}

/* ─── Social Buttons ───────────────────────────────────── */
.btn-social {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-social:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ─── Inputs ───────────────────────────────────────────── */
input:focus, select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ─── Animations ───────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Bottom Tab Navigation ────────────────────────────── */
.tab-nav-active {
  color: #6366f1;
}

.tab-nav-inactive {
  color: #9ca3af;
}

.tab-nav-inactive:hover {
  color: #6b7280;
}

/* ─── Purpose Cards ────────────────────────────────────── */
.purpose-active {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.08) !important;
}

/* ─── Last Minute Sub-Tabs ─────────────────────────────── */
.lm-subtab-active {
  background: #6366f1;
  color: white;
}

.lm-subtab-inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.lm-subtab-inactive:hover {
  background: #e5e7eb;
  color: #374151;
}

/* ─── Priority Filter Pills ────────────────────────────── */
.priority-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.priority-pill-active {
  background: #6366f1;
  color: white;
}

.priority-pill-inactive {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

.priority-pill-inactive:hover {
  background: #e5e7eb;
}

/* ─── Chevron Rotation ─────────────────────────────────── */
.rotate-180 {
  transform: rotate(180deg);
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f9fafb;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ─── Safe Areas (iPhone notch / home bar) ─────────────── */
.safe-top {
  padding-top: env(safe-area-inset-top);
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ─── Touch Targets ────────────────────────────────────── */
.touch-target {
  -webkit-tap-highlight-color: transparent;
}

/* ─── Mobile Tweaks ────────────────────────────────────── */
@media (max-width: 380px) {
  .priority-pill {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Prevent iOS zoom on input focus */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ─── AI Badge ────────────────────────────────────────── */
.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: white;
  cursor: help;
  flex-shrink: 0;
  white-space: nowrap;
}

.ai-item-highlight {
  border-left: 3px solid #a855f7;
}

/* ─── AI Spinner ──────────────────────────────────────── */
.ai-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e9d5ff;
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}

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

/* ─── Select Dropdown ──────────────────────────────────── */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em;
}
