/* ==========================================================================
   Kairos — Reusable UI Components & Atoms (Light & Dark Themes)
   ========================================================================== */

.btn-primary {
  background: linear-gradient(135deg, #A159A6 0%, #8C4791 100%);
  color: #ffffff !important;
  border: 1px solid rgba(161, 89, 166, 0.45);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.62rem 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 4px 12px rgba(161, 89, 166, 0.28);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  outline: none;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #8C4791 0%, #76387a 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(161, 89, 166, 0.38);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.6rem 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
  text-decoration: none;
  outline: none;
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--color-kairos-border);
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.btn-link {
  color: var(--color-kairos);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: opacity 0.15s ease;
}
.btn-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.btn-pwa-install {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-pwa-install:hover {
  border-color: var(--color-kairos);
  color: var(--color-kairos);
}

/* Status Badges */
.badge-status {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.badge-confirmed {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
html.dark .badge-confirmed {
  color: #34d399;
}
.badge-cancelled {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.28);
}
.badge-honored {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.32);
}
html.dark .badge-honored {
  color: #60a5fa;
}
.badge-no_show {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.32);
}
html.dark .badge-no_show {
  color: #fbbf24;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  min-width: 0;
  width: 100%;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.68rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.88rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.form-control::placeholder {
  color: var(--text-dim);
}
.form-control:focus {
  border-color: var(--color-kairos);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control.input-readonly {
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
}

.input-prefix-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-prefix-group:focus-within {
  border-color: var(--color-kairos);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-kairos);
  background: var(--color-kairos-tint);
  border-right: 1px solid var(--border-subtle);
  user-select: none;
}
.form-control.with-prefix {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Switches */
.switch-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider,
.slider {
  position: absolute;
  inset: 0;
  background-color: var(--border-color);
  transition: 0.2s ease;
  border-radius: 999px;
}
html.dark .switch-slider,
html.dark .slider {
  background-color: rgba(255, 255, 255, 0.16);
}
.switch-slider:before,
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.switch-label input:checked + .switch-slider,
.switch-label input:checked + .slider {
  background-color: var(--color-kairos);
}
.switch-label input:checked + .switch-slider:before,
.switch-label input:checked + .slider:before {
  transform: translateX(20px);
}

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn.active {
  background: var(--color-kairos);
  color: #fff;
}

/* Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: var(--shadow-jira);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
html.dark .modal-card {
  background: #0f172a;
  border-color: rgba(161, 89, 166, 0.3);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-section-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
}
.modal-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-kairos);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-footer {
  padding: 0.95rem 1.4rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  background: var(--bg-surface);
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: #0f172a;
  border: 1px solid var(--color-kairos-border);
  color: #ffffff;
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.86rem;
  font-weight: 600;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
#toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* International Phone Picker */
.phone-group-wrapper {
  position: relative;
}

.phone-input-container {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.phone-input-container:focus-within {
  border-color: var(--color-kairos);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.phone-prefix-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 0.7rem;
  background: var(--color-kairos-tint);
  border: none;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  border-radius: 9px 0 0 9px;
}
.phone-prefix-btn:hover {
  background: rgba(161, 89, 166, 0.2);
}

.phone-flag { font-size: 1.1rem; line-height: 1; }
.phone-dial {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-kairos);
}
.phone-chevron {
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
.phone-prefix-btn[aria-expanded="true"] .phone-chevron {
  transform: rotate(180deg);
}

.phone-input-field {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 9px 9px 0 !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
}

.phone-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 310px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-jira);
  z-index: 2100;
  overflow: hidden;
}
html.dark .phone-dropdown {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.14);
}

.phone-search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 0.8rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.phone-search-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.84rem;
  outline: none;
}

.phone-country-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 0.35rem;
}

.phone-country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-main);
}
.phone-country-item:hover,
.phone-country-item.active {
  background: var(--color-kairos-tint);
  color: var(--color-kairos);
}
.phone-country-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-country-dial {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-kairos);
}
