/* ============================================================
   ADCOPY AI — MAIN.CSS
   Shared tokens, resets, base typography
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0A0A0F;
  --bg-2:      #12121A;
  --bg-3:      #1A1A26;
  --bg-4:      #22223A;
  --border:    rgba(255,255,255,0.07);
  --border-hi: rgba(108,99,255,0.45);
  --text:      #F0EDFF;
  --text-2:    #9B98B8;
  --text-3:    #5A5870;
  --accent:    #6C63FF;
  --accent-2:  #8B84FF;
  --accent-dim: rgba(108,99,255,0.15);
  --accent-glow: rgba(108,99,255,0.25);
  --gold:      #FFD166;
  --green:     #06D6A0;
  --red:       #FF6B6B;

  --ff-head: 'Outfit', sans-serif;
  --ff-body: 'Inter', sans-serif;
  --ff-mono: 'JetBrains Mono', monospace;

  --r:    6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --shadow:    0 8px 40px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 80px rgba(0,0,0,0.6);
  --t: 0.18s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--ff-body); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── CONTAINER ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* ── FORM ELEMENTS ── */
input, textarea, select {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text); font-family: var(--ff-body);
  font-size: 0.9rem; padding: 10px 14px; outline: none; resize: vertical;
  transition: border-color var(--t), box-shadow var(--t);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 5L10 1' stroke='%235A5870' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
select optgroup { font-weight: 700; color: var(--text-2); }

/* ── SPIN ANIMATION ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin-ring {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: white;
  border-radius: 50%; animation: spin 0.65s linear infinite;
  vertical-align: middle; margin-right: 6px;
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; z-index: 9999;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-3); border: 1px solid var(--border-hi);
  color: var(--text); padding: 11px 24px; border-radius: 99px;
  font-size: 0.85rem; font-weight: 500; font-family: var(--ff-body);
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(6,214,160,0.5); }
.toast.error   { border-color: rgba(255,107,107,0.5); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); width: 100%; max-width: 720px;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  font-family: var(--ff-head); font-weight: 700; font-size: 1rem;
}
.modal-close {
  background: none; border: none; color: var(--text-3); font-size: 1.1rem;
  cursor: pointer; padding: 4px 8px; border-radius: var(--r);
  transition: color var(--t), background var(--t);
}
.modal-close:hover { color: var(--text); background: var(--bg-3); }
.modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
  font-size: 0.87rem; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
  color: var(--text-2);
}
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}
.btn-copy-modal, .btn-close-modal {
  padding: 9px 20px; border-radius: var(--r-md); font-family: var(--ff-head);
  font-weight: 600; font-size: 0.85rem; cursor: pointer; border: 1px solid var(--border);
  transition: all var(--t);
}
.btn-copy-modal { background: var(--accent); color: white; border-color: var(--accent); }
.btn-copy-modal:hover { background: var(--accent-2); }
.btn-close-modal { background: transparent; color: var(--text-2); }
.btn-close-modal:hover { background: var(--bg-3); color: var(--text); }

/* ── HIDDEN ── */
.hidden { display: none !important; }
