/* ═══════════════════════════════════════════
   common.css — 이슬비 공통 스타일
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Black+Han+Sans&display=swap');

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  color: #333;
  background: #fff;
}

:root {
  --rain-blue: #5bb8f5;
  --rain-mid: #89cff0;
  --rain-light: #c8e9fa;
  --rain-pale: #e8f5fd;
  --rain-dark: #2a7ab8;
  --sky-bg: #d4eefb;
  --text-dark: #2c4a60;
  --text-mid: #5a8aaa;
  --text-light: #8ab8cc;
  --nav-theme-color: #f8fcff;
  --nav-surface: rgba(255, 255, 255, 0.9);
  --nav-surface-strong: rgba(232, 245, 253, 0.96);
  --nav-border: rgba(91, 184, 245, 0.26);
  --nav-shadow: 0 12px 32px rgba(91, 184, 245, 0.16);
  --nav-link-hover: rgba(91, 184, 245, 0.12);
  --auth-surface: rgba(255, 255, 255, 0.9);
  --auth-border: rgba(91, 184, 245, 0.16);
  --auth-shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
  --auth-text: #17324d;
  --auth-muted: #6283a1;
  --auth-admin-bg: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  --auth-user-bg: linear-gradient(135deg, #0f766e, #0f9f93);
  --auth-guest-bg: linear-gradient(135deg, #f59e0b, #ea580c);
}

/* ── 푸터 공통 ── */
#footerContainer {
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
  width: 100%;
}

/* ── navbar-brand 기본 ──
   주의: .navbar { position:fixed } 같은 전역 nav 스타일은 쓰지 않음
   각 페이지 클래스(.navbar-liquid, .navbar-custom)에서만 정의 */
.navbar-brand {
  display: flex;
  align-items: center;
  margin: 0;
}

.navbar-brand img {
  height: 35px;
  width: 35px;
  object-fit: contain;
}

/* ── navbar-liquid 공통 (모든 페이지) ── */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

nav.navbar-liquid {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 10px); left: 1rem; right: 1rem;
  z-index: 1050;
  background: transparent !important;
  border: none;
  border-radius: 20px;
  box-shadow: none;
  padding-top: 0.4rem !important;
  padding-bottom: 0.4rem !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  overflow: visible !important;
}
nav.navbar-liquid::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--nav-border);
  box-shadow: 0 8px 32px rgba(91, 184, 245, 0.18), 0 2px 8px rgba(0,0,0,0.06);
  z-index: -1;
  pointer-events: none;
}

nav.navbar-liquid .navbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-decoration: none;
  flex-shrink: 0;
}
nav.navbar-liquid .navbar-brand img {
  height: 32px !important;
  width: 32px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  filter: invert(52%) sepia(60%) saturate(500%) hue-rotate(185deg) brightness(95%);
  transition: transform 0.3s;
}
nav.navbar-liquid .navbar-brand:hover img {
  transform: rotate(-15deg) scale(1.1);
}
nav.navbar-liquid .navbar-brand:focus,
nav.navbar-liquid .navbar-brand:focus-visible {
  outline: none;
}
nav.navbar-liquid .brand-name {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.15rem;
  color: var(--rain-blue);
  letter-spacing: 2px;
  white-space: nowrap;
}

/* 서버 상태 뱃지 */
.nav-server-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(91,184,245,0.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}
.nav-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.nav-status-dot.online  { background: #4ade80; box-shadow: 0 0 6px #4ade80; animation: blink 2s ease-in-out infinite; }
.nav-status-dot.offline { background: #f87171; }

nav.navbar-liquid .navbar-toggler {
  border: none !important;
  padding: 5px 7px !important;
  background: rgba(255,255,255,0.54) !important;
  border-radius: 12px;
  box-shadow: none !important;
  outline: none !important;
}
nav.navbar-liquid .navbar-toggler:focus {
  box-shadow: none !important;
  outline: none !important;
}
nav.navbar-liquid .navbar-toggler-icon {
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(44,74,96,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  background-size: 100% 100%;
}

nav.navbar-liquid .nav-link {
  color: var(--text-dark) !important;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 20px;
  padding: 6px 13px !important;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
nav.navbar-liquid .nav-link:hover,
nav.navbar-liquid .nav-link:focus {
  color: var(--rain-dark) !important;
  background: var(--nav-link-hover);
}

nav.navbar-liquid .dropdown-menu {
  background: rgba(255,255,255,0.98) !important;
  border: 1.5px solid var(--nav-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 34px rgba(91,184,245,0.16) !important;
  padding: 8px !important;
}
nav.navbar-liquid .dropdown-item {
  color: var(--text-dark) !important;
  font-size: 0.86rem;
  border-radius: 8px;
  padding: 8px 14px !important;
}
nav.navbar-liquid .dropdown-item:hover {
  background: var(--nav-link-hover) !important;
  color: var(--rain-dark) !important;
}

/* 네비바 링크 가운데 정렬 */
nav.navbar-liquid .nav-main {
  flex: 1;
  justify-content: center;
}
@media (max-width: 991.98px) {
  nav.navbar-liquid .nav-main {
    flex: unset;
    justify-content: flex-start;
  }
}

#cashChargeBtn {
  background: transparent !important;
  color: var(--text-dark) !important;
  border-radius: 20px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}
#cashChargeBtn:hover {
  background: var(--nav-link-hover) !important;
  color: var(--rain-dark) !important;
}

#authNavbar { align-items: center; }
#authNavbar .auth-profile-toggle,
#authNavbar .auth-guest-shell {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(91,184,245,0.18);
}
#authNavbar .auth-profile-toggle:hover,
#authNavbar .auth-guest-shell:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(91,184,245,0.18);
}
#authNavbar .auth-dropdown-menu { margin-top: 10px; }

/* 모바일: auth 인라인 */
@media (max-width: 991.98px) {
  #authNavbar {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .auth-nav-item--mobile {
    display: block !important;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid rgba(91,184,245,0.15);
    margin-top: 6px;
  }
  .auth-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
  }
  .auth-mobile-toggle:hover { background: var(--nav-link-hover); }
  .auth-mobile-chevron { margin-left: auto; transition: transform 0.2s; }
  .auth-mobile-actions {
    display: none;
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }
  .auth-mobile-actions.open { display: flex; }
  .auth-mobile-actions .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px !important;
    padding: 8px 14px !important;
    color: var(--text-dark) !important;
    font-size: 0.88rem;
  }
  .auth-mobile-actions .nav-link:hover { background: var(--nav-link-hover); }
}

/* 모바일: collapse 패널 */
@media (max-width: 991.98px) {
  nav.navbar-liquid .navbar-collapse {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(232,245,253,0.96)) !important;
    border: 1px solid var(--nav-border);
    border-radius: 14px;
    padding: 0.75rem 0.75rem 1.25rem !important;
    box-shadow: 0 18px 36px rgba(91,184,245,0.18);
    margin: 0.5rem 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  nav.navbar-liquid .navbar-nav { gap: 2px; }
  nav.navbar-liquid .nav-link {
    border-radius: 10px !important;
    padding: 8px 14px !important;
  }
  nav.navbar-liquid .dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background: rgba(91,184,245,0.04) !important;
    border-radius: 10px !important;
    margin: 4px 0 4px 10px !important;
    padding: 4px !important;
  }
  #authNavbar {
    padding-top: 10px;
    border-top: 1px solid rgba(91,184,245,0.15);
    margin-top: 6px;
  }
}

/* ── navbar-custom: rule.html / staff.html 등 (하위 호환) ── */
.navbar-custom {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08);
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link,
.navbar-custom .dropdown-toggle,
.navbar-custom .dropdown-item {
  color: #333 !important;
}

.navbar-custom .nav-link:hover,
.navbar-custom .dropdown-item:hover {
  color: #5bb8f5 !important;
}

.navbar-custom .navbar-toggler {
  border-color: rgba(0, 0, 0, 0.2);
}

.navbar-custom .navbar-toggler:focus {
  box-shadow: none;
}

/* ── 기타 페이지용 상단 여백 ── */
.page-with-nav {
  padding-top: 60px;
}

/* ── footer-liquid ── */
.footer-liquid {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-nav-item {
  display: flex;
  align-items: center;
}

.auth-profile-toggle,
.auth-guest-shell {
  display: inline-flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px !important;
  border-radius: 18px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
}

.auth-profile-toggle::after {
  margin-left: 2px;
}

.auth-profile-left,
.auth-profile-right {
  display: inline-flex;
  align-items: center;
}

.auth-profile-left {
  gap: 10px;
  min-width: 0;
}

.auth-profile-right {
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.auth-user-name {
  color: var(--auth-text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.auth-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.auth-role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  flex-shrink: 0;
}

.auth-role-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.auth-role-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-role-icon--admin {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 14px rgba(29, 78, 216, 0.14);
}

.auth-role-icon--user {
  background: linear-gradient(135deg, #dcfce7, #ccfbf1);
  color: #0f766e;
  border: 1px solid rgba(15, 118, 110, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 14px rgba(15, 118, 110, 0.12);
}

.auth-role-text {
  color: var(--auth-text);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.auth-role-badge--admin {
  background: var(--auth-admin-bg);
}

.auth-role-badge--user {
  background: var(--auth-user-bg);
}

.auth-role-badge--guest {
  background: var(--auth-guest-bg);
}

.auth-login-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 !important;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--auth-text) !important;
}

.auth-action-link {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.auth-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #5a83aa;
}

.auth-action-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-login-link .auth-action-icon {
  color: var(--auth-text);
}

.auth-action-link:hover .auth-action-icon,
.auth-login-link:hover .auth-action-icon {
  color: #1d4ed8;
}

.auth-dropdown-menu {
  min-width: 220px;
}

.auth-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 12px;
}

.auth-dropdown-label {
  color: var(--auth-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-dropdown-role {
  color: var(--auth-text);
  font-size: 0.85rem;
}

/* ── 반응형 ── */
@media (max-width: 576px) {
  .icon-image { width: 40px; height: 40px; }

  .auth-profile-toggle,
  .auth-guest-shell {
    width: 100%;
    justify-content: space-between;
  }

  .auth-profile-left,
  .auth-profile-right {
    min-width: 0;
  }

  .auth-nav-item,
  .auth-nav-item--guest {
    width: 100%;
  }
}
@media (min-width: 577px) {
  .icon-image { width: 70px; height: 70px; }
}
