/* ============================================================
   CRM Email Automation — Olive Garden Feast UI
   ============================================================
   Warm, calm design system inspired by olive groves and garden
   tranquility. Earthy greens, warm creams, and soft amber accents
   replace the cold blue/gray Apple palette.
   ============================================================ */

/* --- Color palette (Olive Garden Feast) ---
   Primary:   #6B8E23  (olive green)
   Primary L: #87A96B  (sage green)
   Primary D: #556B2F  (dark olive)
   Text:      #3D3522  (dark olive brown)
   Muted:     #8B7D6B  (warm taupe)
   Light:     #C4B89E  (light taupe)
   Success:   #7A9B5E  (sage)
   Error:     #C75B5B  (terracotta)
   Gold:      #C9A227  (warm amber)
   Cream BG:  #F5F4E8  (warm cream)
   ----------------------------------------------- */

* { scrollbar-width: thin; scrollbar-color: rgba(139,125,107,0.2) transparent; }
*::-webkit-scrollbar { width: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(139,125,107,0.2); border-radius: 10px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #F5F4E8 0%, #EDE8D8 25%, #F0EBE0 50%, #E8E5D5 75%, #F2EDE0 100%);
  background-attachment: fixed;
  color: #3D3522;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Glass morphism panels — warm tint */
.glass {
  background: rgba(250,248,240,0.35);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(250,248,240,0.5);
  box-shadow: 0 4px 24px rgba(61,53,34,0.04), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Primary button — olive gradient */
.btn-primary {
  background: linear-gradient(180deg, rgba(107,142,35,0.9) 0%, rgba(85,107,47,0.95) 100%);
  color: #fff; font-weight: 500; transition: all 0.2s ease;
  border: 1px solid rgba(107,142,35,0.2);
  box-shadow: 0 1px 3px rgba(107,142,35,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(117,152,45,1) 0%, rgba(95,117,57,1) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(107,142,35,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Secondary button — frosted cream */
.btn-secondary {
  background: rgba(250,248,240,0.5); color: #3D3522; font-weight: 500;
  border: 1px solid rgba(196,184,158,0.5); transition: all 0.2s ease;
  backdrop-filter: blur(10px); box-shadow: 0 1px 3px rgba(61,53,34,0.04);
}
.btn-secondary:hover:not(:disabled) { background: rgba(250,248,240,0.7); box-shadow: 0 2px 8px rgba(61,53,34,0.06); }

/* Danger button — terracotta */
.btn-danger {
  background: linear-gradient(180deg, rgba(199,91,91,0.9) 0%, rgba(180,75,75,0.95) 100%);
  color: #fff; font-weight: 500; transition: all 0.2s ease;
  border: 1px solid rgba(199,91,91,0.2); box-shadow: 0 1px 3px rgba(199,91,91,0.1);
}
.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(209,101,101,1) 0%, rgba(190,85,85,1) 100%);
  transform: translateY(-1px); box-shadow: 0 4px 20px rgba(199,91,91,0.2);
}

/* Cards — warm glass */
.card {
  background: rgba(250,248,240,0.35);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(250,248,240,0.6); border-radius: 20px; transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(61,53,34,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
}
.card:hover { border-color: rgba(196,184,158,0.7); box-shadow: 0 8px 32px rgba(61,53,34,0.06), inset 0 1px 0 rgba(255,255,255,0.7); }

/* Input fields — frosted cream */
.input-field {
  background: rgba(250,248,240,0.5); border: 1px solid rgba(139,125,107,0.15); border-radius: 12px;
  color: #3D3522; padding: 10px 14px; font-size: 14px; transition: all 0.2s ease; width: 100%;
  backdrop-filter: blur(10px);
}
.input-field:focus { outline: none; border-color: rgba(107,142,35,0.5); box-shadow: 0 0 0 3px rgba(107,142,35,0.1); background: rgba(250,248,240,0.7); }
.input-field::placeholder { color: #8B7D6B; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; }
.tag-blue { background: rgba(107,142,35,0.1); color: #6B8E23; }
.tag-green { background: rgba(122,155,94,0.12); color: #5D7E3E; }
.tag-gray { background: rgba(139,125,107,0.1); color: #8B7D6B; }

/* Sidebar — warm glass panel */
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: #8B7D6B; transition: all 0.15s ease; cursor: pointer; font-size: 14px; font-weight: 500; margin: 2px 6px; }
.sidebar-link:hover { background: rgba(107,142,35,0.06); color: #6B8E23; }
.sidebar-link.active { background: rgba(107,142,35,0.1); color: #6B8E23; }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: #6B8E23; border-radius: 0 3px 3px 0; }
.sidebar-item-wrapper { position: relative; }

/* Toast notifications — warm glass */
.toast { position: fixed; top: 20px; right: 20px; padding: 14px 20px; border-radius: 16px; color: #fff; font-size: 14px; font-weight: 500; z-index: 9999; transform: translateX(150%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1); max-width: 420px; backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 8px 32px rgba(61,53,34,0.12); }
.toast.show { transform: translateX(0); }
.toast-success { background: rgba(122,155,94,0.9); }
.toast-error { background: rgba(199,91,91,0.9); }
.toast-info { background: rgba(107,142,35,0.9); }

/* Modal — warm glass */
.modal-overlay { position: fixed; inset: 0; background: rgba(61,53,34,0.2); backdrop-filter: blur(20px); z-index: 9990; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-content { background: rgba(250,248,240,0.5); backdrop-filter: blur(50px) saturate(180%); -webkit-backdrop-filter: blur(50px) saturate(180%); border: 1px solid rgba(250,248,240,0.6); border-radius: 24px; max-width: 600px; width: 90%; max-height: 85vh; overflow-y: auto; transform: scale(0.96); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 24px 80px rgba(61,53,34,0.08), inset 0 1px 0 rgba(255,255,255,0.6); }
.modal-overlay.show .modal-content { transform: scale(1); }

/* Loading */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(245,244,232,0.6); backdrop-filter: blur(20px); z-index: 9995; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid rgba(107,142,35,0.15); border-top-color: #6B8E23; border-radius: 50%; animation: spin 0.8s linear infinite; }
.fade-in { animation: fadeIn 0.35s cubic-bezier(0.4,0,0.2,1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Wizard */
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 0.35s ease; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; transition: all 0.3s ease; }
.step-dot.done { background: #7A9B5E; color: #fff; box-shadow: 0 2px 8px rgba(122,155,94,0.3); }
.step-dot.active { background: #6B8E23; color: #fff; box-shadow: 0 2px 8px rgba(107,142,35,0.3); }
.step-dot.pending { background: rgba(139,125,107,0.15); color: #8B7D6B; }

/* Template cards */
.template-card { cursor: pointer; transition: all 0.2s ease; position: relative; border: 1.5px solid transparent; }
.template-card:hover { border-color: rgba(107,142,35,0.25); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(61,53,34,0.06); }
.template-card.selected { border-color: #6B8E23; background: rgba(107,142,35,0.04); }
.template-card.selected::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; background: #6B8E23; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }

/* Mobile sidebar */
.mobile-sidebar { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); }
.mobile-sidebar.show { transform: translateX(0); }
@media (min-width: 1024px) { .mobile-sidebar { transform: translateX(0) !important; } }

/* Search input — warm glass */
.search-input { background: rgba(250,248,240,0.5); border: 1px solid rgba(139,125,107,0.12); border-radius: 12px; padding: 10px 14px 10px 38px; color: #3D3522; width: 100%; font-size: 14px; transition: all 0.2s; backdrop-filter: blur(10px); }
.search-input:focus { outline: none; border-color: rgba(107,142,35,0.4); box-shadow: 0 0 0 3px rgba(107,142,35,0.08); background: rgba(250,248,240,0.7); }
.search-wrapper { position: relative; }
.search-wrapper i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8B7D6B; font-size: 13px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 100px; font-size: 12px; cursor: pointer; transition: all 0.15s; user-select: none; margin: 2px; }
.chip-on { background: rgba(107,142,35,0.1); color: #6B8E23; border: 1.5px solid rgba(107,142,35,0.2); }
.chip-off { background: rgba(139,125,107,0.06); color: #8B7D6B; border: 1.5px solid rgba(139,125,107,0.08); }

/* Preview frames */
.preview-frame-desktop { width: 100%; }
.preview-frame-mobile { width: 375px; margin: 0 auto; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 32px rgba(61,53,34,0.06); }

/* Spreadsheet table — warm theme */
.bulk-table-wrap::-webkit-scrollbar { height: 6px; }
.bulk-table-wrap::-webkit-scrollbar-track { background: transparent; }
.bulk-table-wrap::-webkit-scrollbar-thumb { background: rgba(139,125,107,0.15); border-radius: 3px; }
#bulk-table tbody tr { border-bottom: 1px solid rgba(139,125,107,0.06); transition: background 0.1s; }
#bulk-table tbody tr:hover { background: rgba(107,142,35,0.03); }
#bulk-table th { background: rgba(250,248,240,0.7); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 3; border-bottom: 1px solid rgba(139,125,107,0.12); }
#bulk-table th.sticky-col { z-index: 4; }
#bulk-table td.sticky-col { background: rgba(250,248,240,0.8); z-index: 2; }
#bulk-table th.sticky-1, #bulk-table td.sticky-1 { position: sticky; left: 0; }
#bulk-table th.sticky-2, #bulk-table td.sticky-2 { position: sticky; left: 32px; }
#bulk-table th.sticky-3, #bulk-table td.sticky-3 { position: sticky; left: 187px; }
#bulk-table td.sticky-1 { border-right: 1px solid rgba(139,125,107,0.08); }
#bulk-table td.sticky-2 { border-right: 1px solid rgba(139,125,107,0.08); }
#bulk-table td.sticky-3 { border-right: 1px solid rgba(139,125,107,0.08); }

/* Var inputs — warm glass */
.var-input { background: rgba(250,248,240,0.5); border: 1px solid rgba(139,125,107,0.1); border-radius: 8px; color: #3D3522; padding: 4px 8px; font-size: 12px; width: 100%; transition: all 0.15s; resize: none; backdrop-filter: blur(5px); }
.var-input:focus { outline: none; border-color: rgba(107,142,35,0.4); background: rgba(250,248,240,0.8); box-shadow: 0 0 0 2px rgba(107,142,35,0.08); }
.var-input::placeholder { color: #C4B89E; font-size: 11px; }
textarea.var-input { min-height: 28px; line-height: 1.3; }
textarea.auto-resize { field-sizing: content; min-height: 48px; max-height: 200px; }

/* Language chips — warm glass */
.lang-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 10px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; user-select: none; border: 1.5px solid rgba(139,125,107,0.1); margin: 3px; background: rgba(250,248,240,0.4); backdrop-filter: blur(5px); }
.lang-chip.on { background: rgba(107,142,35,0.1); color: #6B8E23; border-color: rgba(107,142,35,0.25); box-shadow: 0 1px 4px rgba(107,142,35,0.08); }
.lang-chip.off { background: rgba(250,248,240,0.3); color: #8B7D6B; border-color: rgba(139,125,107,0.06); }
.lang-chip:hover { border-color: rgba(107,142,35,0.2); background: rgba(250,248,240,0.6); }
.lang-chip .flag { font-size: 14px; }

/* Copy modal textareas */
.copy-textarea { min-height: 70px; field-sizing: content; font-size: 13px; line-height: 1.5; }

/* Sidebar background — warm glass */
.sidebar-bg { background: rgba(250,248,240,0.35); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border-right: 1px solid rgba(250,248,240,0.5); }

/* Top bar — warm glass */
.topbar-glass { background: rgba(250,248,240,0.3); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border-bottom: 1px solid rgba(250,248,240,0.4); }
