/* =============================================================
   QuickGenerator — Header v2 + bottom sheet mobile
   ============================================================= */

.qg-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.qg-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.qg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 900;
  font-size: 1.15em;
  letter-spacing: -0.02em;
}

.qg-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(34,197,94,0.3));
  border: 1px solid rgba(139,92,246,0.3);
  font-size: 1.1em;
}

.qg-logo span {
  background: linear-gradient(135deg, #a78bfa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.qg-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qg-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.88em;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.qg-menu-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

.qg-auth-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88em;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qg-auth-btn.outline {
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #e2e8f0;
}

.qg-auth-btn.outline:hover {
  background: rgba(255,255,255,0.08);
}

.qg-auth-btn.primary {
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #22c55e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139,92,246,0.3);
}

.qg-auth-btn.primary:hover {
  box-shadow: 0 6px 20px rgba(139,92,246,0.45);
  transform: translateY(-1px);
}

.qg-user-name {
  color: #a5b4c8;
  font-size: 0.88em;
  font-weight: 500;
}

.qg-logout-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: #94a3b8;
  font-size: 0.82em;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: 0.2s;
}

.qg-logout-btn:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

/* ===================== MENU OVERLAY ===================== */

.qg-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  overflow-y: auto;
}

.qg-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.qg-menu-card {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(-20px);
  transition: transform 0.25s;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.qg-menu-overlay.open .qg-menu-card {
  transform: translateY(0);
}

.qg-menu-title {
  font-size: 1em;
  font-weight: 800;
  color: #e2e8f0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qg-menu-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.qg-menu-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.qg-menu-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

.qg-menu-list::-webkit-scrollbar {
  width: 8px;
}

.qg-menu-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}

.qg-menu-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.qg-menu-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.28);
}

.qg-menu-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qg-menu-group-title {
  color: #cbd5e1;
  font-size: 0.84em;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0 4px 4px;
}

.qg-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  color: #e2e8f0;
  transition: all 0.2s;
  cursor: pointer;
}

.qg-menu-item:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.25);
  transform: translateX(4px);
}

.qg-menu-item.active,
.qg-menu-item.current {
  background: rgba(139,92,246,0.16);
  border-color: rgba(139,92,246,0.3);
}

.qg-menu-item.current {
  cursor: default;
}

.qg-menu-item.current:hover {
  transform: none;
}

.qg-menu-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.qg-menu-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(34,197,94,0.15));
  border: 1px solid rgba(139,92,246,0.2);
  flex-shrink: 0;
}

.qg-menu-info h4 {
  margin: 0;
  font-size: 0.95em;
  font-weight: 700;
}

.qg-menu-info p {
  margin: 2px 0 0;
  font-size: 0.82em;
  color: #94a3b8;
}

.qg-menu-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 700;
  white-space: nowrap;
}

.qg-menu-badge.soon {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.25);
}

.qg-menu-current-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 800;
  background: rgba(34,197,94,0.14);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.22);
  white-space: nowrap;
}

/* ===================== HERO ===================== */

.qg-hero {
  background: linear-gradient(135deg, #7c3aed, #6366f1 40%, #8b5cf6 70%, #a78bfa);
  color: #fff;
  text-align: center;
  padding: 28px 20px;
  min-height: 212px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.qg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 20% 100%, rgba(34,197,94,0.2), transparent 60%),
    radial-gradient(500px 300px at 80% 0%, rgba(59,130,246,0.2), transparent 60%);
  pointer-events: none;
}

.qg-hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.qg-hero-title {
  font-size: 2em;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.qg-hero-title .icon {
  font-style: normal;
  margin-right: 8px;
}

.qg-hero-subtitle {
  font-size: 1.05em;
  opacity: 0.92;
  margin: 0 0 18px;
  line-height: 1.5;
}

.qg-hero-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.qg-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9em;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ===================== MOBILE / BOTTOM SHEET ===================== */

@media (max-width: 640px) {
  .qg-header-inner {
    height: 54px;
  }

  .qg-logo {
    font-size: 1em;
  }

  .qg-auth-btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.82em;
  }

  .qg-hero-title {
    font-size: 1.5em;
  }

  .qg-hero {
    min-height: 180px;
    padding: 22px 16px;
  }

  .qg-user-name {
    display: none;
  }

  /* bottom sheet */
  .qg-menu-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .qg-menu-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 82vh;
    padding: 16px;
    transform: translateY(100%);
  }

  .qg-menu-overlay.open .qg-menu-card {
    transform: translateY(0);
  }

  .qg-menu-title {
    padding-top: 6px;
  }

  .qg-menu-title::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
  }

  .qg-menu-group-title {
    font-size: 0.8em;
  }
}

@media print {
  .qg-header, .qg-hero, .qg-menu-overlay {
    display: none !important;
  }
}