/* ============================================
   EventLay — Global Styles
   ============================================ */
:root {
  --bg: #0b0d17;
  --surface: #12152a;
  --surface2: #1a1d35;
  --border: #1e2244;
  --accent: #6c63ff;
  --accent-hover: #5a52e0;
  --accent2: #00d4aa;
  --accent2-hover: #00b894;
  --text: #e0e0ec;
  --muted: #8888a8;
  --heading: #ffffff;
  --danger: #ff4757;
  --warning: #f7b731;
  --success: #00d4aa;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all .15s ease;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--accent2); color: #0b0d17; }
.btn-success:hover { background: var(--accent2-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e84147; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* TOPBAR */
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
}
.topbar .logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.5px;
}
.topbar .logo span { color: var(--accent); }
.topbar-spacer { flex: 1; }
.topbar .project-name {
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: 4px;
  max-width: 300px;
}
.topbar .project-name:hover { border-color: var(--border); }
.topbar .project-name:focus { border-color: var(--accent); color: var(--heading); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all .2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 560px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform .2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal h2 { color: var(--heading); font-size: 22px; margin-bottom: 6px; }
.modal p.desc { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; }
.modal input[type="text"], .modal input[type="file"] { width: 100%; margin-bottom: 16px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* TEMPLATE GRID */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.template-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  background: var(--surface2);
}
.template-card:hover { border-color: var(--border); transform: translateY(-2px); }
.template-card.selected { border-color: var(--accent); }
.template-card img { width: 100%; height: 90px; object-fit: cover; display: block; }
.template-card .name { padding: 6px 8px; font-size: 12px; color: var(--muted); text-align: center; }

/* TOAST */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in .3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toast-in { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
