/* ════════════════════════════════════════════════════════════════
   global.css — D&D Event Planning System-Wide Stylesheet
   DD Color Palette, Typography, and Shared Responsive Components
════════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  /* ── DD Primary Colors ── */
  --color-title:       #a14a79;   /* Section titles, primary headers */
  --color-body:        #9d6181;   /* Subtitles & soft text           */
  --color-bg-dark:     #575656;   /* Dark background sections        */

  /* ── DD Accent & Complementary ── */
  --color-accent:      #c4748f;   /* Hover states & accents          */
  --color-accent-light:#e8b4c8;   /* Light rose pink                 */
  --color-gold:        #c9a96e;   /* Gold details & badges           */
  --color-cream:       #f9f3f6;   /* Cream section backgrounds       */
  --color-white:       #ffffff;
  --color-black:       #1a1a1a;

  /* ── DD Gradients ── */
  --gradient-hero:     linear-gradient(135deg, rgba(87,86,86,0.82) 0%, rgba(161,74,121,0.55) 100%);
  --gradient-dark:     linear-gradient(180deg, #575656 0%, #3d3c3c 100%);
  --gradient-section:  linear-gradient(135deg, #f9f3f6 0%, #f0e4ec 100%);
  --gradient-card:     linear-gradient(180deg, transparent 40%, rgba(87,86,86,0.92) 100%);
  --gradient-cta:      linear-gradient(135deg, #a14a79 0%, #c4748f 100%);
  --gradient-mission:  linear-gradient(135deg, #3d3c3c 0%, #575656 50%, #6b3d57 100%);

  /* ── Mapped Tokens (for GestionGen compatibility) ── */
  --crimson:       #a14a79;
  --crimson-light: #c4748f;
  --crimson-dark:  #3a1a2b;
  --crimson-glow:  rgba(161,74,121,0.22);
  --crimson-pale:  rgba(161,74,121,0.08);

  /* Neutrals */
  --white:         #ffffff;
  --off-white:     #f9f3f6;
  --gray-50:       #f7eff3;
  --gray-100:      #ede0e7;
  --gray-200:      #dec8d5;
  --gray-300:      #c7a8bb;
  --gray-400:      #9d6181;
  --gray-500:      #7a4563;
  --gray-600:      #575656;

  /* Text */
  --text-dark:     #2b1a23;
  --text-mid:      #5c344a;
  --text-soft:     #8f5674;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Cormorant Garamond', 'Lato', sans-serif;
  --font-body:  'Lato', 'Inter', sans-serif;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(161,74,121,0.08), 0 1px 3px rgba(87,86,86,0.06);
  --shadow-md:  0 6px 24px rgba(161,74,121,0.14), 0 2px 8px rgba(87,86,86,0.08);
  --shadow-lg:  0 12px 40px rgba(161,74,121,0.2), 0 4px 14px rgba(87,86,86,0.12);
  --shadow-xl:  0 20px 70px rgba(161,74,121,0.3), 0 8px 24px rgba(87,86,86,0.18);

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  /* Motion */
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout dimensions */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--gradient-section);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Background Ambient Pattern ─────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10%  5%, rgba(161,74,121,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 60% 80% at 90% 90%, rgba(201,169,110,0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Sidebar Drawer Backdrop (Mobile) ────────────────────────── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(57,56,56,0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--gradient-mission);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  border-right: 1px solid rgba(232,180,200,0.15);
  transition: transform .35s cubic-bezier(.4,0,.2,1), width .35s ease;
}
.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-brand .logo-mark {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-title) 0%, var(--color-accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(161,74,121,0.45);
  border: 1px solid rgba(232,180,200,0.4);
}
.sidebar-brand h1 {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 700;
  color: var(--color-white); letter-spacing: 0.04em;
}
.sidebar-brand p {
  font-family: var(--font-sans);
  font-size: 12px; color: var(--color-accent-light);
  margin-top: 2px; font-style: italic; letter-spacing: 0.05em;
}
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}
.nav-label {
  font-size: 10px; font-weight: 700;
  color: var(--color-accent-light);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 12px; margin-bottom: 6px;
  opacity: 0.85;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover  { background: rgba(161,74,121,0.25); color: var(--color-white); transform: translateX(3px); }
.nav-item.active { background: var(--gradient-cta); color: var(--color-white); box-shadow: 0 4px 14px rgba(161,74,121,0.35); }
.nav-item .icon  { font-size: 16px; flex-shrink: 0; }

/* Dropdown nav group */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  user-select: none;
}
.nav-dropdown-toggle:hover { background: rgba(161,74,121,0.25); color: var(--color-white); }
.nav-dropdown-toggle.open  { background: rgba(161,74,121,0.2); color: var(--color-white); }
.nav-dropdown-toggle .icon { font-size: 16px; flex-shrink: 0; }
.nav-dropdown-arrow {
  margin-left: auto;
  font-size: 10px;
  opacity: .6;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s;
  display: inline-block;
}
.nav-dropdown-toggle.open .nav-dropdown-arrow {
  transform: rotate(180deg);
  opacity: .9;
}
.nav-dropdown-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height .32s cubic-bezier(.4,0,.2,1);
  border-left: 2px solid rgba(232,180,200,0.25);
  margin: 0 12px 4px 22px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.nav-dropdown-items.open { max-height: 400px; }
.nav-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 1px;
}
.nav-dropdown-item:hover  { background: rgba(161,74,121,0.2); color: var(--color-white); }
.nav-dropdown-item.active { background: rgba(161,74,121,0.35); color: var(--color-white); font-weight: 600; }
.nav-dropdown-item .sub-icon { font-size: 13px; flex-shrink: 0; opacity: .85; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(232,180,200,0.2);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-cta);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--color-white);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(161,74,121,0.3);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--color-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10.5px; color: var(--color-accent-light); }

/* ─── Mobile Hamburger Toggle ─────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
  flex-shrink: 0;
}
.mobile-nav-toggle:hover {
  background: var(--gray-100);
  border-color: var(--color-title);
}
.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-title);
  border-radius: 2px;
  transition: var(--transition);
}

/* ─── Main Layout ────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-width);
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .35s ease;
}

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  padding: 16px 36px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 20px rgba(161,74,121,0.04);
  gap: 14px;
}
.topbar-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-soft);
  font-family: var(--font-body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.breadcrumb span      { color: var(--color-title); font-weight: 700; }
.breadcrumb .bc-sep   { color: var(--gray-300); font-weight: 400; }
.breadcrumb .bc-root  { color: var(--text-soft); font-weight: 400; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-cta);
  color: var(--color-white);
  box-shadow: 0 4px 18px rgba(161,74,121,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(161,74,121,0.48);
}
.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--color-title);
}
.btn-sm   { padding: 8px 16px; font-size: 12.5px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); width: 36px; height: 36px; justify-content: center; }

/* ─── Page Content Wrapper ───────────────────────────────────── */
.content {
  padding: 32px 36px;
  flex: 1;
}

/* ─── Panel (reusable card component) ───────────────────────── */
.panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}
.panel-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to right, var(--gray-50), var(--white));
  gap: 16px;
}
.panel-title {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700;
  color: var(--color-title);
  letter-spacing: 0.02em;
}
.panel-subtitle {
  font-size: 12.5px; color: var(--text-soft);
  margin-top: 3px; font-style: italic;
  font-family: var(--font-sans);
}
.panel-body { padding: 0; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 7px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--color-title);
  box-shadow: 0 0 0 3.5px var(--crimson-glow);
}
.form-row              { display: flex; gap: 14px; }
.form-row .form-group  { flex: 1; }
select.form-control    { cursor: pointer; }
textarea.form-control  { resize: vertical; min-height: 80px; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(57,56,56,0.65);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
  padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 530px; max-width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(24px) scale(.96);
  transition: transform .32s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
  border: 1px solid var(--gray-100);
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to right, var(--gray-50), var(--white));
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 700;
  color: var(--color-title);
}
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--gray-100);
  cursor: pointer; font-size: 16px; color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--crimson-pale); color: var(--color-title); }
.modal-body   { padding: 24px 26px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: 12px;
  background: var(--gray-50);
  flex-shrink: 0;
}

/* ─── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--text-dark);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 280px; max-width: 380px;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1) forwards;
  border-left: 4px solid var(--color-title);
}
.toast.fade-out { animation: toastOut .3s ease forwards; }
.toast-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-msg b { display: block; margin-bottom: 2px; color: var(--color-accent-light); }
@keyframes toastIn  { from { opacity:0; transform:translateX(30px) scale(.95); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(30px) scale(.95); } }

/* ─── Progress Bar ───────────────────────────────────────────── */
.progress-bar-wrap {
  height: 7px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gradient-cta);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ─── Utility Classes ────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--crimson-pale); color: var(--color-title);
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
}
.divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ─── RESPONSIVE BREAKPOINTS ─────────────────────────────────── */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  .mobile-nav-toggle { display: flex; }

  /* Slide-out Sidebar Drawer on Mobile / Tablet */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-brand h1, .sidebar-brand p,
  .nav-label, .nav-item span,
  .user-info { display: block !important; }
  .sidebar-brand .logo-mark { margin: 0 0 12px 0 !important; }
  .nav-item { justify-content: flex-start !important; padding: 10px 14px !important; }
  .user-chip { justify-content: flex-start !important; padding: 10px 12px !important; }

  .main { margin-left: 0 !important; }
  .topbar { padding: 14px 24px; }
  .content { padding: 24px; }
}

/* Small Tablet / Mobile Header Wrap (≤ 768px) */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 18px;
    gap: 10px;
  }
  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 20px;
  }
  .panel-header > div:last-child {
    width: 100%;
  }
  #search-input {
    width: 100% !important;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Smartphone (≤ 576px) */
@media (max-width: 576px) {
  .topbar {
    flex-wrap: wrap;
  }
  .topbar-left {
    flex: 1 1 auto;
  }
  .topbar-right {
    flex: 1 1 100%;
    justify-content: space-between;
    margin-top: 4px;
  }
  #filter-status {
    flex: 1;
    min-width: 130px;
  }
  .topbar-right .btn {
    flex: 1;
  }
  .content { padding: 16px 12px; }
  .modal-overlay { padding: 10px; }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 18px 20px; }
  .modal-footer { padding: 14px 20px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }
  .toast-container {
    left: 16px; right: 16px; bottom: 16px;
  }
  .toast {
    min-width: 0; width: 100%; max-width: none;
  }
}
