/* src/styles/global.css */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
  /* Gold palette */
  --gold-100: #fff8e7;
  --gold-200: #fdefc8;
  --gold-300: #f7d98a;
  --gold-400: #e9b84a;
  --gold-500: #c9922a;
  --gold-600: #a07020;
  --gold-700: #7a5218;

  /* Marble / Stone */
  --marble-100: #fdfaf5;
  --marble-200: #f5efe2;
  --marble-300: #e8ddd0;
  --marble-400: #d4c4af;
  --marble-500: #b8a494;
  --marble-600: #8c7868;

  /* Deep tones */
  --deep-100: #2e1f0e;
  --deep-200: #1e1508;
  --deep-300: #0f0a03;

  /* Love accents */
  --rose-100: #fdf0f0;
  --rose-200: #f7d0d0;
  --rose-300: #e8a0a0;
  --rose-400: #d46060;
  --rose-500: #b04040;

  /* Lapis lazuli */
  --lapis-100: #e8f0f8;
  --lapis-200: #b8cce0;
  --lapis-300: #7098c0;
  --lapis-400: #3a6898;
  --lapis-500: #1e3c60;

  /* Fonts */
  --font-display: 'Cinzel Decorative', serif;
  --font-title: 'Cinzel', serif;
  --font-body: 'EB Garamond', serif;

  /* Spacing */
  --radius: 4px;
  --radius-lg: 12px;

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--deep-200);
  color: var(--marble-200);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--deep-200); }
::-webkit-scrollbar-thumb { background: var(--gold-600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* ── Selection ─────────────────────────────────────────────── */
::selection { background: var(--gold-400); color: var(--deep-200); }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.05em; }
h4, h5, h6 { font-family: var(--font-title); font-weight: 500; letter-spacing: 0.03em; }
p { font-family: var(--font-body); }

.text-gold { color: var(--gold-400); }
.text-marble { color: var(--marble-200); }
.text-rose { color: var(--rose-300); }
.text-lapis { color: var(--lapis-300); }

/* ── Decorative border ─────────────────────────────────────── */
.ornament-border {
  position: relative;
  border: 1px solid var(--gold-600);
}
.ornament-border::before, .ornament-border::after {
  content: '◆';
  position: absolute;
  color: var(--gold-400);
  font-size: 10px;
  line-height: 1;
}
.ornament-border::before { top: -6px; left: 50%; transform: translateX(-50%); }
.ornament-border::after { bottom: -6px; left: 50%; transform: translateX(-50%); }

/* ── Gold divider ──────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-600), transparent);
}
.divider-symbol {
  color: var(--gold-400);
  font-size: 18px;
  font-family: var(--font-title);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: linear-gradient(145deg, rgba(46,31,14,0.9), rgba(30,21,8,0.95));
  border: 1px solid var(--gold-700);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9922a' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}
.card:hover {
  border-color: var(--gold-500);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,146,42,0.15);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--deep-200);
  border: 1px solid var(--gold-400);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  box-shadow: 0 4px 16px rgba(201,146,42,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--gold-400);
  border: 1px solid var(--gold-600);
}
.btn-secondary:hover {
  background: rgba(201,146,42,0.1);
  border-color: var(--gold-400);
}

.btn-danger {
  background: transparent;
  color: var(--rose-400);
  border: 1px solid var(--rose-500);
}
.btn-danger:hover {
  background: rgba(176,64,64,0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--marble-300);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--marble-500);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Inputs ────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15,10,3,0.6);
  border: 1px solid var(--gold-700);
  border-radius: var(--radius);
  color: var(--marble-200);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}
.input-field:focus {
  border-color: var(--gold-400);
  background: rgba(15,10,3,0.8);
  box-shadow: 0 0 0 3px rgba(201,146,42,0.12);
}
.input-field::placeholder { color: var(--marble-500); }

textarea.input-field {
  resize: vertical;
  min-height: 100px;
}

.input-label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 6px;
}

/* ── Egyptian decorative patterns ─────────────────────────── */
.hieroglyph-bg {
  background-image:
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c9922a' fill-opacity='0.04'%3E%3Cpath d='M40 0L80 40L40 80L0 40z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Column decoration ─────────────────────────────────────── */
.column-left, .column-right {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--gold-700) 10%,
    var(--gold-600) 50%,
    var(--gold-700) 90%,
    transparent 100%
  );
  z-index: 100;
  pointer-events: none;
}
.column-left { left: 24px; }
.column-right { right: 24px; }

/* ── Page transitions ──────────────────────────────────────── */
.page-enter {
  animation: pageEnter 0.5s ease forwards;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Loading ───────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--gold-700);
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notifications / Toast ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  animation: toastIn 0.3s ease forwards;
  max-width: 320px;
  border-left: 3px solid;
}
.toast.success { background: rgba(46,31,14,0.95); border-color: var(--gold-400); color: var(--gold-300); }
.toast.error { background: rgba(46,31,14,0.95); border-color: var(--rose-400); color: var(--rose-300); }
.toast.info { background: rgba(46,31,14,0.95); border-color: var(--lapis-300); color: var(--lapis-200); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: linear-gradient(145deg, #2e1f0e, #1a1005);
  border: 1px solid var(--gold-600);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--marble-400);
  cursor: pointer;
  font-size: 20px;
  transition: var(--transition);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.modal-close:hover { color: var(--gold-400); background: rgba(201,146,42,0.1); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .column-left, .column-right { display: none; }
  #toast-container { left: 16px; right: 16px; bottom: 16px; }
}
