/* Nitro overrides for Gnuboard/Youngcart theme.
 *
 * Goal: match nitro-main (Next.js) header/footer + global typography/color tokens.
 * Keep existing basic theme CSS as a base, then override selectively.
 */

/* Pretendard Variable — subset copied from nitro-main */
@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/pretendard/PretendardVariable.woff2") format("woff2");
}

:root {
  --nitro-brand: #ea580c;
  --nitro-brand-hover: #c2410c;
  --nitro-brand-50: #fff7ed;
  --nitro-brand-100: #ffedd5;

  --nitro-text: #334155;          /* slate-700 */
  --nitro-text-strong: #0f172a;   /* slate-900 */
  --nitro-text-muted: #64748b;    /* slate-500 */
  --nitro-text-faint: #94a3b8;    /* slate-400 */

  --nitro-border: #f1f5f9;        /* slate-100 */
  --nitro-border-soft: #f8fafc;   /* slate-50 */

  --nitro-radius-lg: 12px;        /* rounded-xl */
  --nitro-radius-md: 8px;         /* rounded-lg */

  --nitro-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12),
    0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

/* Global base */
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #ffffff;
  color: var(--nitro-text);
  letter-spacing: -0.01em;
  min-height: 100vh;
}

a { text-decoration: none; }

/* Tailwind preflight-style: keep boolean `hidden` attribute authoritative. */
[hidden] { display: none !important; }

::selection {
  background: var(--nitro-brand-100);
  color: var(--nitro-brand);
}

/* Hide Gnuboard debug login banner to match nitro-main layout */
#hd_login_msg { display: none !important; }

/* Layout wrapper: make footer stick to bottom on short pages */
#wrapper.nitro-app {
  min-width: 0; /* override basic theme min-width:1200px */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: #fff;
}

main.nitro-main {
  padding-top: 64px; /* header height */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Container spacing: give pages some breathing room */
#container.nitro-container {
  width: 100%;
  max-width: 80rem; /* 7xl */
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  #container.nitro-container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Animations: used by mobile menu */
@keyframes nitroFadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.nitro-animate-fade-in-down {
  animation: nitroFadeInDown 0.25s ease-out forwards;
}

/* Inline icon sizing helpers (lucide-ish) */
.nitro-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}
.nitro-icon--20 { width: 20px; height: 20px; }
.nitro-icon--16 { width: 16px; height: 16px; }
.nitro-icon--12 { width: 12px; height: 12px; }

/* Header (match nitro-main/AppShell) */
.nitro-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nitro-border);
  z-index: 50;
}

.nitro-header__inner {
  max-width: 80rem; /* 7xl */
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .nitro-header__inner { padding: 0 24px; }
}

.nitro-header__left {
  display: flex;
  align-items: center;
  gap: 40px;
  min-width: 0;
}

.nitro-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nitro-logo__mark {
  width: 28px;
  height: 28px;
  border-radius: var(--nitro-radius-md);
  background: #f97316; /* orange-500 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: background-color 160ms ease;
}
.nitro-logo:hover .nitro-logo__mark { background: var(--nitro-brand); }
.nitro-logo__text {
  font-size: 18px;
  font-weight: 700;
  color: var(--nitro-text-strong);
  letter-spacing: -0.02em;
}

.nitro-nav {
  display: none;
  align-items: center;
  gap: 20px;
}
@media (min-width: 1024px) {
  .nitro-nav { display: flex; }
}
@media (min-width: 1280px) {
  .nitro-nav { gap: 28px; }
}

.nitro-nav-item {
  position: relative;
  padding: 20px 0;
}
.nitro-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nitro-text-muted);
  transition: color 160ms ease;
  cursor: pointer;
  user-select: none;
}
.nitro-nav-item:hover .nitro-nav-label { color: var(--nitro-brand); }
.nitro-nav-chevron { opacity: 0.3; }

.nitro-dropdown {
  position: absolute;
  top: 56px; /* top-14 */
  left: 0;
  width: 160px; /* w-40 */
  background: #fff;
  border: 1px solid var(--nitro-border);
  border-radius: var(--nitro-radius-lg);
  box-shadow: var(--nitro-shadow-xl);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  z-index: 60;
}
.nitro-nav-item:hover .nitro-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nitro-dropdown-link,
.nitro-dropdown-disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--nitro-radius-md);
  font-size: 14px;
  font-weight: 500;
}
.nitro-dropdown-link {
  color: #475569; /* slate-600 */
  transition: background-color 160ms ease, color 160ms ease;
}
.nitro-dropdown-link:hover {
  background: var(--nitro-brand-50);
  color: var(--nitro-brand);
}
.nitro-dropdown-disabled {
  color: #cbd5e1; /* slate-300 */
  cursor: not-allowed;
}

.nitro-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nitro-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--nitro-text-muted);
  transition: color 160ms ease;
}
.nitro-link:hover { color: var(--nitro-brand); }

.nitro-link--insights {
  display: none;
  margin-right: 8px;
}
@media (min-width: 1024px) {
  .nitro-link--insights { display: inline-block; }
}

.nitro-btn-primary {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--nitro-brand);
  color: #fff;
  border-radius: var(--nitro-radius-md);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.15);
  transition: background-color 160ms ease;
}
.nitro-btn-primary:hover { background: var(--nitro-brand-hover); }
@media (min-width: 768px) {
  .nitro-btn-primary { display: inline-flex; }
}

.nitro-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--nitro-radius-md);
  color: #475569;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nitro-mobile-toggle:hover { background: var(--nitro-border); }
@media (min-width: 1024px) {
  .nitro-mobile-toggle { display: none; }
}

/* Mobile menu panel */
.nitro-mobile-menu {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid var(--nitro-border);
  box-shadow: var(--nitro-shadow-xl);
  padding: 16px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 40;
}
@media (min-width: 1024px) {
  .nitro-mobile-menu { display: none !important; }
}

.nitro-mobile-label {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--nitro-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nitro-mobile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--nitro-radius-lg);
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease;
}
.nitro-mobile-item:hover {
  background: var(--nitro-brand-50);
  color: var(--nitro-brand);
}
.nitro-mobile-item__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.nitro-mobile-item__disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}
.nitro-mobile-item__disabled:hover { background: transparent; color: #cbd5e1; }
.nitro-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--nitro-border);
  color: var(--nitro-text-faint);
  padding: 2px 8px;
  border-radius: 999px;
}

.nitro-mobile-divider {
  height: 1px;
  background: var(--nitro-border);
  margin: 8px 0;
}

.nitro-mobile-flat:hover {
  background: var(--nitro-border-soft);
  color: #334155;
}

/* Footer (match nitro-main/AppShell) */
.nitro-footer {
  background: #fff;
  border-top: 1px solid var(--nitro-border);
  padding: 64px 0;
  margin-top: auto;
}

.nitro-footer__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .nitro-footer__inner { padding: 0 24px; }
}

.nitro-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.nitro-footer__mark {
  width: 24px;
  height: 24px;
  border-radius: var(--nitro-radius-md);
  background: #f97316;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nitro-footer__brand-text {
  font-weight: 700;
  font-size: 18px;
  color: var(--nitro-text-strong);
  letter-spacing: -0.02em;
}

.nitro-footer__info {
  font-size: 13px;
  line-height: 24px; /* leading-6 */
  color: var(--nitro-text-muted);
  font-weight: 500;
}
.nitro-footer__info p {
  margin: 0;
}
.nitro-footer__info strong {
  color: var(--nitro-text-strong);
  font-weight: 700;
}
.nitro-footer__mailto {
  color: #1e293b;
  font-weight: 700;
}
.nitro-footer__mailto:hover { color: var(--nitro-brand); }

.nitro-footer__bottom {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--nitro-border-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}
@media (min-width: 768px) {
  .nitro-footer__bottom {
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }
}

.nitro-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nitro-text-faint);
}
.nitro-footer__links a {
  color: var(--nitro-text-faint);
  transition: color 160ms ease;
}
.nitro-footer__links a:hover { color: var(--nitro-brand); }
.nitro-footer__links a.nitro-footer__link-strong {
  color: #475569;
  font-weight: 700;
}
.nitro-footer__links a.nitro-footer__link-mid { color: var(--nitro-text-muted); }

.nitro-footer__copy {
  font-size: 11px;
  color: var(--nitro-text-faint);
  font-weight: 500;
}

/* Brandize basic theme primary controls (low-risk global tweaks) */
.btn_submit,
input.btn_submit,
button.btn_submit,
.btn_confirm,
input.btn_confirm,
button.btn_confirm {
  background: var(--nitro-brand) !important;
  border-color: var(--nitro-brand) !important;
}
.btn_submit:hover,
input.btn_submit:hover,
button.btn_submit:hover,
.btn_confirm:hover,
input.btn_confirm:hover,
button.btn_confirm:hover {
  background: var(--nitro-brand-hover) !important;
  border-color: var(--nitro-brand-hover) !important;
}
