/**
 * OTOGO 9 AM — Shared Reusable Components Stylesheet
 * Responsive CSS Architecture — Device & Responsibility Separation
 * 
 * Defines shared, device-agnostic components across all portals:
 * - Buttons (.btn, .btn-primary, .btn-outline, .btn-light, .dash-btn-*)
 * - Badges and Status chips (.badge, .status-pill, etc.)
 * - Card surfaces (dark theme cards & high-contrast white cards)
 * - Segmented controls (.dash-segmented-tabs, .dash-segmented-tab)
 * - Form controls (inputs, selects, textareas, labels, hints)
 * - Alert messages (.alert, .alert-success, .alert-error)
 * - Empty states (.empty-state)
 */

/* ==========================================================================
   1. Buttons System
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target-min, 44px);
  padding: 10px 20px;
  border-radius: var(--radius-md, 12px);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  background: var(--brand-blue, #0878ef);
  color: #ffffff !important;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--brand-blue-hover, #0062d1);
  box-shadow: var(--shadow-blue-glow);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary {
  background: var(--brand-blue, #0878ef);
  color: #ffffff !important;
}

.btn-outline {
  background: transparent;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-light {
  background: #ffffff;
  color: #0f172a !important;
  border: 1px solid #e2e8f0;
}

.btn-light:hover {
  background: #f8fafc;
}

.btn-danger-outline {
  background: transparent;
  color: var(--crimson, #ef4444) !important;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger-outline:hover {
  background: var(--crimson-bg, #fef2f2);
  border-color: var(--crimson, #ef4444);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm, 8px);
}

.btn-lg {
  min-height: 50px;
  padding: 14px 28px;
  font-size: 1.0625rem;
  border-radius: var(--radius-lg, 16px);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   2. Status Badges & Pills
   ========================================================================== */
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-pill, 9999px);
  line-height: 1;
}

.badge-active,
.status-active,
.status-completed {
  background: var(--emerald-bg, #ecfdf5);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending,
.status-pending {
  background: var(--amber-bg, #fffbeb);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-confirmed,
.status-confirmed,
.status-enroute {
  background: var(--sky-bg, #f0f9ff);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-cancelled,
.status-cancelled {
  background: var(--crimson-bg, #fef2f2);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.service-card-status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.service-card-coming-soon,
.service-card-price-soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px !important;
  font-weight: 800;
  color: #b45309 !important;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin-top: 2px;
}

.service-card-btn-soon {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18) !important;
}

.service-card-btn-soon:hover {
  background: #1e293b !important;
}

/* ==========================================================================
   3. Card Surfaces
   ========================================================================== */
.card,
.dash-card {
  background: var(--dark-card, #101b28);
  border: 1px solid var(--border-dark, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-xl, 22px);
  padding: var(--space-5, 20px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.card-white {
  background: var(--light-surface, #ffffff);
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xl, 22px);
  padding: var(--space-5, 20px);
  box-shadow: var(--shadow-card-light);
}

.card-white h1,
.card-white h2,
.card-white h3,
.card-white h4 {
  color: #0f172a;
}

/* ==========================================================================
   4. Segmented Controls (Mobile & Desktop)
   ========================================================================== */
.dash-segmented-tabs,
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: var(--space-4, 16px);
  min-height: 48px;
}

.dash-segmented-tab,
.segmented-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  border-radius: var(--radius-pill, 9999px);
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.dash-segmented-tab.active,
.segmented-btn.active {
  background: var(--brand-blue, #0878ef);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(8, 120, 239, 0.35);
}

/* ==========================================================================
   5. Form Controls & Floating Labels
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-4, 16px);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: var(--touch-target-min, 44px);
  padding: 10px 14px;
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm, 8px);
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-blue, #0878ef);
  box-shadow: 0 0 0 3px rgba(8, 120, 239, 0.18);
}

/* ==========================================================================
   6. Alert Messages
   ========================================================================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md, 12px);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: var(--space-4, 16px);
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
