/* ============================================================== */
/* HARIBOT — 100% LIGHT MODE GREEN THEME (TryHaritaki Inspired)   */
/* ============================================================== */

:root {
  color-scheme: light !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  background-color: #f8faf7;
  color-scheme: light;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-color: #f8faf7;
  color: #1f2937;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* Light Scrollbars */
* {
  scrollbar-color: #cbd5e1 #f8faf7;
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f8faf7;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Subtle herbal background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 420px;
  background: radial-gradient(ellipse at 50% -20%, rgba(22, 163, 74, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}


/* ============================================================== */
/* CARDS & PANELS                                                  */
/* ============================================================== */
.card-light {
  background: #ffffff;
  border: 1px solid #e6ede6;
  border-radius: 16px;
  padding: 16px;
  position: relative;
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.04), 0 1px 3px -1px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-light:hover {
  border-color: #d1fae5;
  box-shadow: 0 4px 16px -2px rgba(22, 163, 74, 0.06);
}

.step-badge {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  flex-shrink: 0;
}

/* ============================================================== */
/* INPUT FIELDS                                                    */
/* ============================================================== */
.input-field {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.6;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}

.input-field::placeholder {
  color: #9ca3af;
}

.input-field:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
  background: #ffffff;
}

/* Detected Info Pills */
.pill-info {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
}

/* ============================================================== */
/* ACTION SECTIONS (ACCORDION)                                     */
/* ============================================================== */
.action-section {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eef2ee;
  background: #fafbfa;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: #ffffff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-header:hover {
  background: #f4f7f4;
}

.section-header.active {
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid #eef2ee;
  background: #fbfdfb;
}

.section-header.active .section-chevron {
  transform: rotate(180deg);
}

.section-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 12px;
  background: #fafbfa;
}

.section-body.open {
  max-height: 380px;
  padding: 8px 12px 12px 12px;
}

/* ============================================================== */
/* PILL CHECKBOXES                                                 */
/* ============================================================== */
.pill-check {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  cursor: pointer;
  transition: background-color 0.05s ease, border-color 0.05s ease, transform 0.05s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.pill-check span {
  font-size: 11px;
  font-weight: 500;
  color: #4b5563;
  transition: color 0.05s ease;
  white-space: nowrap;
}

.pill-check:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.pill-check:hover span {
  color: #111827;
}

.pill-check:active {
  transform: scale(0.96);
}

.pill-check.active {
  background: #16a34a;
  border-color: #15803d;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}

.pill-check.active span {
  color: #ffffff !important;
  font-weight: 700;
}

.pill-check.active:hover {
  background: #15803d;
  border-color: #166534;
}

/* ============================================================== */
/* BUTTONS                                                         */
/* ============================================================== */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.generate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

.generate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
  color: #dc2626;
}

/* Mini Paste Button */
.mini-paste-btn {
  display: inline-flex;
  align-items: center;
  padding: 3.5px 10px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-paste-btn:hover {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

/* Mini Secondary Button (Clear in Step 1) */
.mini-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 3.5px 8px;
  border-radius: 8px;
  background: #f8faf7;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-btn-secondary:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.mini-btn-secondary:active {
  transform: scale(0.96);
}

/* Attachment Chip */
.attachment-chip {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  transition: all 0.2s ease;
}

/* Smart Mode Toggle Switch */
.toggle-switch-wrapper {
  position: relative;
  width: 32px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-checkbox:checked + .toggle-switch-slider {
  background-color: #16a34a;
  border-color: #15803d;
}

.toggle-checkbox:checked + .toggle-switch-slider:before {
  transform: translateX(14px);
}

/* Mini Copy Buttons for Email and Reason */
.mini-copy-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mini-copy-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

.mini-copy-btn.copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

/* ============================================================== */
/* MODALS & OVERLAYS                                              */
/* ============================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

#settings-modal .modal-content {
  max-width: 500px;
}

#password-modal {
  z-index: 90 !important;
}

#error-modal {
  z-index: 100 !important;
}

/* Fallback compatibility for any glass classes */
.card-glass {
  background: #ffffff !important;
  border: 1px solid #e6ede6 !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.04) !important;
  color: #1f2937 !important;
}

.glass-panel, .glass-panel-bottom {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: #e2e8f0 !important;
}

/* RESULT MODAL (MODAL-IN-A-MODAL ARCHITECTURE)                   */
.result-modal-box {
  width: 100%;
  max-width: 540px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 25px 60px -12px rgba(13, 51, 32, 0.2), 0 0 0 1px rgba(22, 163, 74, 0.08);
  overflow: hidden;
}

/* THE INNER MODAL (SUB-MODAL) FOR THE DRAFT ONLY                 */
.inner-modal-card {
  background: #ffffff;
  border: 1.5px solid #a7f3d0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px -2px rgba(22, 163, 74, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.inner-draft-body {
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.65;
  font-family: inherit;
  word-break: break-word;
  white-space: pre-wrap;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.inner-draft-body::-webkit-scrollbar {
  width: 6px;
}

.inner-draft-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* ============================================================== */
/* SLIDER (Customer Pleaser Level)                                */
/* ============================================================== */
.slider-container {
  padding: 8px 0;
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4);
  transition: transform 0.15s ease;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  transition: all 0.2s ease;
}

.slider-label.active-label {
  color: #15803d;
  font-weight: 700;
}

/* ============================================================== */
/* TOAST                                                          */
/* ============================================================== */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #ffffff;
  color: #15803d;
  border: 1.5px solid #86efac;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

/* ============================================================== */
/* ANIMATIONS                                                     */
/* ============================================================== */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.animate-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
