/* Base theme tokens (dark by default) */
html[data-bs-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0c;
  --card: #121214;
  --border: #1f1f23;
  --text: #eaeaec;
  --muted: #a2a2a6;
  --brand: #9333ea;
  --brand-secondary: #ec4899;
  --brand-accent: #fbbf24;
  --thumb: #202024;

  /* Bootstrap variable bindings */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-card-bg: var(--card);
  --bs-card-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-link-color: var(--brand);
  --bs-offcanvas-bg: var(--card);
  --bs-offcanvas-color: var(--text);
  --bs-dropdown-bg: var(--card);
  --bs-dropdown-color: var(--text);
  --bs-list-group-bg: var(--card);
  --bs-list-group-border-color: var(--border);
}

/* Light theme overrides */
html[data-bs-theme="light"] {
  color-scheme: light;
  --bg: #faf5ff;
  --card: #ffffff;
  --border: #e9d5ff;
  --text: #0b0b0c;
  --muted: #6b7280;
  --brand: #a855f7;
  --brand-secondary: #ec4899;
  --brand-accent: #fbbf24;
  --thumb: #faf5ff;

  /* Bootstrap variable bindings */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-card-bg: var(--card);
  --bs-card-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-link-color: var(--brand);
  --bs-offcanvas-bg: var(--card);
  --bs-offcanvas-color: var(--text);
  --bs-dropdown-bg: var(--card);
  --bs-dropdown-color: var(--text);
  --bs-list-group-bg: var(--card);
  --bs-list-group-border-color: var(--border);
}

/* Support widget (ChannelTalk-like) */
#supportPanel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}

#supportPanel .tab-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none !important;
}

#supportPanel .tab-content.active {
  display: block !important;
}

#supportPanel .tab-btn {
  color: #6c757d;
  transition: color 0.2s;
  background: var(--bs-body-bg);
}

#supportPanel .tab-btn.active {
  color: var(--brand);
}

#supportPanel .tab-btn:hover {
  color: var(--brand);
}

#supportPanel .message-bubble {
  display: inline-block;
  max-width: 70%;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 18px;
  margin-bottom: 8px;
}

#supportPanel .message-me {
  margin-left: auto;
  background: var(--brand);
  color: white;
  border-bottom-right-radius: 4px;
}

#supportPanel .message-other {
  margin-right: auto;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border-bottom-left-radius: 4px;
}

#supportPanel .message-system {
  margin: 0 auto;
  background: #fff3cd;
  color: #856404;
  text-align: center;
  font-size: 0.9em;
}

#supportPanel .ct-hero {
  position: relative;
  height: 140px;
}

#supportPanel .ct-hero-fixed {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(147, 51, 234, .25), rgba(236, 72, 153, .15)), var(--bs-tertiary-bg);
}

#supportPanel .ct-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 12px 16px;
}

#supportPanel .ct-brand-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

#supportPanel .ct-brand-title {
  font-weight: 700;
  font-size: 1rem;
}

#supportPanel .ct-welcome {
  background: var(--bs-body-bg);
}

#supportPanel .ct-integration {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}

#supportPanel .ct-integration.more {
  color: var(--bs-secondary-color);
}

/* New Support Widget structure */
#supportPanel .sw-page {
  position: absolute;
  inset: 0;
  display: none !important;
  background: var(--bs-body-bg);
}

#supportPanel .sw-page.active {
  display: block !important;
}

#supportPanel .sw-hero {
  position: relative;
  height: 160px;
}

#supportPanel .sw-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 24px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bs-body-bg));
  pointer-events: none;
}

#supportPanel .sw-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(147, 51, 234, .25), rgba(236, 72, 153, .15)), var(--bs-tertiary-bg);
}

#supportPanel .sw-hero-brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#supportPanel .sw-brand-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

#supportPanel .sw-brand-title {
  font-weight: 800;
  font-size: 1.35rem;
}

#supportPanel .sw-body {
  height: calc(100% - 160px - 56px);
  overflow: auto;
  padding: 12px 16px 16px 16px;
}

#supportPanel .sw-primary-cta {
  border-radius: 14px;
}

#supportPanel .sw-welcome {
  border: 1px solid var(--bs-border-color) !important;
  border-radius: 14px;
  overflow: hidden;
}

#supportPanel .sw-tabbar {
  height: 56px;
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  z-index: 2;
}

#supportPanel .sw-tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  padding-top: 6px;
  font-size: 12px;
  transition: color .15s ease, background-color .15s ease;
}

#supportPanel .sw-tab-btn i {
  font-size: 18px;
  transition: transform .15s ease;
}

#supportPanel .sw-tab-btn:hover,
#supportPanel .sw-tab-btn:focus {
  color: var(--brand);
  background: var(--bs-tertiary-bg);
}

#supportPanel .sw-tab-btn:hover i,
#supportPanel .sw-tab-btn:focus i {
  transform: translateY(-1px);
}

#supportPanel .sw-tab-btn.active {
  color: var(--brand);
  background: var(--bs-tertiary-bg);
}

#supportPanel .sw-tab-btn.active:hover {
  color: #fff;
  background: var(--brand);
}

/* Small unread badge for tabs */
#supportPanel .sw-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 6px);
  transform: translateX(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

#supportPanel .sw-chat-messages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, var(--bs-tertiary-bg), var(--bs-body-bg));
}

#supportPanel .sw-chat-messages::-webkit-scrollbar {
  width: 8px;
}

#supportPanel .sw-chat-messages::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 6px;
}

#supportPanel .sw-chat-input {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  z-index: 3;
}

#supportPanel .sw-emoji-panel {
  position: absolute;
  bottom: 68px;
  left: 12px;
  right: 12px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

#supportPanel .sw-convo-item {
  border-radius: 12px;
}

#supportPanel .sw-convo-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bs-tertiary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bubbles quality */
#supportPanel .message-bubble {
  display: inline-block;
  max-width: 72%;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#supportPanel .message-bubble ul,
#supportPanel .message-bubble ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#supportPanel .message-me {
  display: block;
  margin-left: auto;
  background: var(--brand);
  color: white;
  border-bottom-right-radius: 6px;
}

#supportPanel .message-other {
  display: block;
  margin-right: auto;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border-bottom-left-radius: 6px;
}

#supportPanel .message-system {
  display: block;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  margin: 6px auto;
  background: #fff3cd;
  color: #856404;
  text-align: center;
  font-size: 0.85rem;
  border-radius: 12px;
  padding: 6px 10px;
}

#supportPanel .message-bubble a {
  color: var(--brand);
  text-decoration: none;
}

#supportPanel .message-bubble a:hover {
  text-decoration: underline;
}

/* 삭제된 메시지 스타일 */
#supportPanel .message-deleted {
  opacity: 0.6 !important;
}

#supportPanel .message-deleted .message-bubble {
  background: var(--bs-light) !important;
  border: 1px dashed var(--bs-border-color) !important;
  color: var(--bs-secondary) !important;
}

#supportPanel .message-deleted .message-content em {
  font-style: italic;
}

/* Image attachment preview */
#supportPanel .message-attachment {
  margin-top: 4px;
  margin-bottom: 10px;
}

#supportPanel .message-attachment img.message-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}

#supportPanel .attachment-me {
  margin-left: auto;
  max-width: min(360px, 70%);
}

#supportPanel .attachment-other {
  margin-right: auto;
  max-width: min(360px, 70%);
}

/* Admin support page tweaks */
.admin-attachment img.admin-image {
  max-width: 240px;
  width: 100%;
  height: auto;
}

.admin-bubble.image-only {
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.admin-send .btn-attach {
  min-width: 110px;
  white-space: nowrap;
}

.admin-send #fileName {
  max-width: 200px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Admin page separators */
.admin-board {
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  background: var(--bs-body-bg);
}

.admin-row {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.admin-send button[type="submit"] {
  min-width: 82px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.admin-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.admin-send-btn:hover {
  filter: brightness(1.05);
}

.admin-send-btn i {
  font-size: 18px;
}

.admin-send {
  gap: 8px !important;
}

/* Input & buttons */
#supportPanel .sw-chat-input .form-control {
  border-radius: 22px;
  border-color: var(--bs-border-color);
  background: var(--bs-body-bg);
}

#supportPanel .sw-chat-input .form-control:focus {
  box-shadow: 0 0 0 .2rem rgba(147, 51, 234, .15);
  border-color: var(--brand);
}

#supportPanel #attachBtn,
#supportPanel #emojiBtn {
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

#supportPanel #attachBtn:hover,
#supportPanel #emojiBtn:hover {
  background: var(--bs-tertiary-bg);
}

#supportPanel #sendBtn {
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  border: none;
}

#supportPanel #sendBtn:hover {
  filter: brightness(1.05);
}

/* Primary CTA within support widget (e.g., 문의하기 버튼) */
#supportPanel .sw-primary-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  border: none;
  color: #fff;
}

#supportPanel .sw-primary-cta:hover {
  filter: brightness(1.05);
}

/* Brand utilities matching site tone */
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  color: #fff;
  border: none;
}

.btn-brand:hover {
  filter: brightness(1.05);
  color: #fff;
}

.text-brand {
  color: var(--brand) !important;
}

.bg-brand-subtle {
  background: rgba(147, 51, 234, 0.12) !important;
}

/* Chat mode: hide tab bar and expand pages to full height */
#supportPanel.chat-mode .sw-tabbar {
  display: none !important;
}

#supportPanel.chat-mode #sw-pages {
  height: calc(100% - 56px) !important;
}

/* Clearer outlines for light theme elements inside panel */
#supportPanel .card,
#supportPanel .list-group-item,
#supportPanel .border {
  border-color: var(--bs-border-color) !important;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  transition: background .2s ease, color .2s ease;
}

/* Header */
.b-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.b-logo {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .5px;
}

/* Footer */
.b-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
}

/* Sidebar */
.b-sidebar {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.b-sidebar .list-group-item {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.b-sidebar .list-group-item.active {
  background: rgba(147, 51, 234, 0.15);
  color: var(--brand);
  border-color: var(--border);
}

/* Cards */
.b-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.b-thumb {
  background: var(--thumb);
  aspect-ratio: 16/9;
}

/* Live detail page (centralized from inline styles) */
.live-stage {
  display: flex;
  flex-direction: column;
}

.chat-panel {
  position: sticky;
  top: 12px;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.chat-body {
  height: 100%;
  overflow: auto;
  padding: 12px;
  background: var(--bs-body-bg);
}

.chat-input {
  border-top: 1px solid var(--bs-border-color);
  padding: 10px;
}

.message {
  max-width: 80%;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 12px;
  display: inline-block;
}

.me {
  background: var(--bs-primary);
  color: #fff;
  margin-left: auto;
}

.other {
  background: var(--bs-secondary-bg);
}

.system {
  display: block;
  margin: 8px auto;
  color: var(--bs-secondary);
  text-align: center;
}

.video-wrap {
  position: relative;
  background: #000;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.video-overlay {
  display: none;
}

.icon-btn {
  text-decoration: none;
  cursor: default;
}

.icon-btn:active,
.icon-btn:focus {
  outline: none;
}

a.js-live-enter,
a.js-live-enter:hover,
a.js-live-enter:focus {
  color: var(--bs-body-color) !important;
  text-decoration: none;
}

/* Mobile optimizations for live detail */
@media (max-width: 576px) {
  .live-stage .p-3.d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .live-stage .fs-5 {
    font-size: 1.1rem;
  }

  .live-stage img[alt="thumb"] {
    width: 44px !important;
    height: 44px !important;
  }

  .chat-panel {
    position: static;
    height: auto;
  }

  .icon-bar {
    width: 100%;
    justify-content: flex-end !important;
  }
}

/* Utilities */
.rounded-12 {
  border-radius: 12px;
}

/* Featured Carousel */
.carousel-indicators {
  margin-bottom: 1rem;
}

.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
}

.carousel-indicators .active {
  background-color: var(--brand);
}

/* Form controls to match theme */
.form-control,
.form-select,
.input-group-text {
  background-color: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.form-control::placeholder {
  color: var(--muted);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 .25rem rgba(147, 51, 234, 0.15);
  border-color: var(--brand);
}

/* Outline buttons use themed borders */
.btn-outline-secondary {
  color: var(--text);
  border-color: var(--border);
}

.btn-outline-secondary:hover {
  background: var(--border);
  color: var(--text);
}

/* Enhanced visual effects - only for content cards */
.b-card.hover-lift {
  transition: transform 0.2s ease;
}

.b-card.hover-lift:hover {
  transform: translateY(-1px);
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Enhanced carousel indicators */
.carousel-indicators {
  margin-bottom: 1.5rem;
}

.carousel-indicators [data-bs-target] {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.carousel-indicators .active {
  background-color: var(--brand);
  border-color: var(--brand);
  transform: scale(1.2);
}

/* Enhanced badges */
.badge {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Enhanced buttons */
.btn {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Enhanced cards */
.b-card {
  border: 1px solid var(--border);
}

/* Enhanced sidebar */
.b-sidebar .list-group-item {
  border-radius: 8px;
  margin-bottom: 4px;
}

.b-sidebar .list-group-item.active {
  background: rgba(147, 51, 234, 0.2);
  border-left: 3px solid var(--brand);
}

/* Enhanced thumbnails */
.b-thumb {
  transition: all 0.3s ease;
  overflow: hidden;
}

.b-thumb:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Enhanced gradients */
.gradient-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
}

.gradient-secondary {
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
}

/* Enhanced shadows */
.shadow-lg {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.shadow-sm {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

/* Enhanced animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Profile Page Styles */
.page-header {
  background: transparent;
  color: var(--text);
  padding: 2rem 0 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.page-title i {
  margin-right: 0.8rem;
  color: var(--brand);
}

.page-subtitle {
  font-size: 1.1rem;
  margin: 0.5rem 0 0 0;
  color: var(--muted);
  font-weight: 400;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--thumb);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2.5rem;
  transition: all 0.3s ease;
}

.profile-avatar-large:hover {
  background: var(--border);
  color: var(--text);
  transform: scale(1.05);
}

.points-display {
  background: var(--thumb);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 1.1rem;
}

.profile-section {
  margin-bottom: 2rem;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.form-control-plaintext {
  background-color: var(--thumb) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
  font-weight: 500;
}

.form-control-plaintext i {
  color: var(--brand);
}

.profile-info-item {
  background: var(--thumb);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.profile-info-item:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.profile-info-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.profile-info-value {
  color: var(--text);
  font-weight: 500;
}

/* Account info section dividers */
.account-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--thumb);
  transition: all 0.2s ease;
}

.account-section:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.1);
}

.account-section:last-child {
  margin-bottom: 0;
}

.account-section h6 {
  color: var(--text) !important;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem !important;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  margin: 0 auto 1rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.profile-stat {
  text-align: center;
  padding: 1rem;
  background: var(--thumb);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profile-stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--brand);
}

.profile-stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Enhanced form styling for profile */
.profile-form .form-label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.profile-form .form-control {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.profile-form .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(147, 51, 234, 0.15);
}

.profile-form .btn {
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.profile-form .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Alert styling for profile */
.alert {
  border-radius: 8px;
  border: none;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border-left: 4px solid #28a745;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border-left: 4px solid #dc3545;
}

/* User Dropdown Styles */
.user-dropdown {
  min-width: 260px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0;
  margin-top: 8px;
}

.user-dropdown .dropdown-header {
  padding: 1rem;
  background: var(--thumb);
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid var(--border);
}

.user-dropdown .dropdown-item {
  padding: 0.75rem 1rem;
  color: var(--text);
  transition: all 0.2s ease;
  border: none;
  background: transparent;
}

.user-dropdown .dropdown-item:hover {
  background: var(--thumb);
  color: var(--text);
}

.user-dropdown .dropdown-item i {
  width: 16px;
  text-align: center;
}

.user-dropdown .dropdown-divider {
  margin: 0.5rem 0;
  border-color: var(--border);
}

.user-dropdown .user-avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--thumb);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

.user-dropdown .user-avatar-placeholder:hover {
  background: var(--border);
  color: var(--text);
}

/* Dropdown toggle button styling */
.dropdown-toggle::after {
  display: none;
}

/* Custom dropdown arrow styling */
.dropdown-arrow {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Enhanced responsive design */
@media (max-width: 768px) {
  .b-card.hover-lift:hover {
    transform: none;
  }

  .container-xxl {
    padding-left: 15px;
    padding-right: 15px;
  }

  .b-card {
    margin-bottom: 1rem;
  }

  .row-cols-1>* {
    flex: 0 0 auto;
    width: 100%;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .user-dropdown {
    min-width: 200px;
  }

  /* Profile page responsive */
  .page-header {
    padding: 1.5rem 0 1rem 0;
  }

  .page-title {
    font-size: 2rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .profile-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .points-display {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 576px) {
  .page-header {
    padding: 1.2rem 0 1rem 0;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

  .profile-avatar-large {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
  }

  .points-display {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Auth Pages Enhancement */
.auth-container {
  background: linear-gradient(135deg, var(--bg) 0%, rgba(147, 51, 234, 0.05) 100%);
  min-height: 100vh;
}

.auth-card {
  border: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.auth-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Enhanced form styling for auth pages */
.auth-form .form-control {
  border-radius: 12px;
  border: 2px solid var(--border);
  padding: 0.875rem 1rem;
  transition: all 0.3s ease;
  background: var(--card);
}

.auth-form .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.25rem rgba(147, 51, 234, 0.15);
  background: var(--card);
}

.auth-form .btn {
  border-radius: 12px;
  padding: 0.875rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.auth-form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(147, 51, 234, 0.4);
}

/* User management table improvements */
.user-table .btn-group-vertical .btn {
  margin-bottom: 2px;
}

.user-table .btn-group-vertical .btn:last-child {
  margin-bottom: 0;
}

.level-display {
  background: var(--thumb);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ItemShop Package Styles */
.package-card {
  transition: all 0.3s ease;
  border: 2px solid var(--border);
}

.package-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Discount ribbon for itemshop */
.ribbon {
  position: absolute;
  top: 0px;
  right: 0px;
  overflow: hidden;
  width: 120px;
  height: 120px;
}

.ribbon span {
  position: absolute;
  display: block;
  width: 170px;
  padding: 6px 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-secondary));
  color: #fff;
  text-align: center;
  font-weight: 700;
  transform: rotate(45deg);
  top: 22px;
  right: -42px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
}

.package-icon {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.package-badge {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.package-badge.silver {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  border: 3px solid #a0a0a0;
}

.package-badge.gold {
  background: linear-gradient(135deg, #ffd700, #ffed4a);
  border: 3px solid #e6ac00;
}

.package-badge.diamond {
  background: linear-gradient(135deg, #87ceeb, #b9f2ff);
  border: 3px solid #4682b4;
}

.package-badge.vip {
  background: linear-gradient(135deg, #ffd700, #ffed4a);
  border: 3px solid #e6ac00;
}

.package-badge.quick {
  background: linear-gradient(135deg, #17a2b8, #20c997);
  border: 3px solid #138496;
}

.badge-icon {
  text-align: center;
  font-weight: 600;
}

.silver-circle,
.gold-circle,
.diamond-circle,
.vip-circle,
.quick-circle {
  font-size: 0.75rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.silver-circle {
  color: #4a4a4a;
}

.gold-circle,
.vip-circle {
  color: #8b4513;
}

.diamond-circle {
  color: #003d5c;
  font-size: 0.7rem;
}

.quick-circle {
  color: white;
  font-size: 1.5rem;
}

.package-circle {
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

.package-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.package-price {
  margin-bottom: 2rem;
}

.price-amount {
  font-size: 1.5rem;
  font-weight: bold;
  color: #dc3545;
  display: block;
}

.price-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.package-purchase-btn {
  width: 100%;
  padding: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.package-purchase-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments for packages */
@media (max-width: 768px) {
  .package-icon {
    height: 100px;
  }

  .package-badge {
    width: 80px;
    height: 80px;
  }

  .silver-circle,
  .gold-circle,
  .diamond-circle,
  .vip-circle {
    font-size: 0.65rem;
  }

  .quick-circle {
    font-size: 1.2rem;
  }

  .package-title {
    font-size: 1.1rem;
  }

  .price-amount {
    font-size: 1.3rem;
  }
}

/* Live Show Page Styles */
/* 비디오 완전 숨김 - Canvas로 대체 */
#livePlayer,
#livePlayerMobile {
  display: none !important;
}

/* Canvas 기반 비디오 표시 */
#videoCanvas,
#videoCanvasMobile {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
  object-fit: contain;
}

/* 비디오 컨테이너 스타일링 */
.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 비디오 컨테이너 스타일링 - 실시간 방송처럼 */
.video-wrap {
  position: relative;
  background: #000;
  overflow: hidden;
}

/* 비디오 오버레이 - 영상 로드 후에만 표시 */
.video-wrap.video-loaded .video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 49%, rgba(255, 0, 0, 0.1) 50%, transparent 51%);
  background-size: 20px 20px;
  animation: liveIndicator 2s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes liveIndicator {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 20px 20px;
  }
}

/* LIVE 표시 - Canvas 위에 오버레이로 표시 */
.video-wrap.video-loaded::before {
  content: "LIVE";
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ff0000;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10;
  animation: liveBlink 1s infinite;
  pointer-events: none;
}

@keyframes liveBlink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0.7;
  }
}

/* 비디오 컨트롤 완전 숨김 */
.video-controls {
  display: none !important;
}

/* 비디오에 마우스 오버 시에도 컨트롤 숨김 */
.video-wrap:hover .video-controls {
  display: none !important;
}

/* 비디오 컨텍스트 메뉴 비활성화 */
#livePlayer,
#livePlayerMobile {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* 비디오 우클릭 방지 */
#livePlayer::before,
#livePlayerMobile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

/* 모바일에서만 반응형 레이아웃 적용 */
@media (max-width: 1199.98px) {

  /* 모바일/태블릿에서 방송-채팅-게시물 순서로 배치 */
  .col-xl-8.order-1.order-xl-1 {
    order: 1 !important;
  }

  .col-xl-4.order-2.order-xl-2 {
    order: 2 !important;
  }

  .order-3 {
    order: 3 !important;
  }

  /* 모바일에서 데스크톱용 게시물 완전히 숨기기 */
  .col-xl-8.order-1.order-xl-1 .d-none.d-xl-block {
    display: none !important;
  }

  /* 모바일에서 채팅 패널 높이 조정 */
  .chat-panel {
    height: 600px;
  }

  .chat-body {
    height: 200px;
    overflow-y: auto;
  }

  /* 모바일에서 비디오 높이 조정 */
  .video-wrap {
    height: 300px;
  }
}

@media (max-width: 767.98px) {

  /* 모바일에서 더 작은 높이 */
  .video-wrap {
    height: 250px;
  }

  .chat-panel {
    height: 550px;
  }

  .chat-body {
    height: 550px;
  }

  /* 모바일에서 버튼 크기 조정 */
  .btn-group-sm .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  /* 모바일 액션 버튼 호버 효과 */
  .account-required-btn {
    transition: all 0.2s ease;
  }

  .account-required-btn:hover {
    transform: translateY(-2px);
    color: var(--bs-primary) !important;
  }

  /* 모바일에서 비디오 컨테이너 여백 최소화 */
  .b-card {
    margin-bottom: 0.5rem !important;
    border: none !important;
    padding: 0.5rem !important;
  }

  /* 모바일에서 컨테이너 패딩 조정 */
  .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* 모바일에서 메인 컨테이너 패딩 제거 */
  .container-xxl.py-3 {
    padding: 0 !important;
  }

  /* 모바일에서 로고 한 줄 표시 */
  .b-logo {
    white-space: nowrap;
    font-size: 1.2rem !important;
    font-weight: 700;
    flex-shrink: 0;
  }

  /* 모바일에서 캐러셀 인디케이터 숨기기 */
  .carousel-indicators {
    display: none !important;
  }

  /* 하트 아이콘 색상 제거 */
  .bi-heart-fill.text-danger {
    color: var(--bs-secondary-color) !important;
  }

  /* 모바일에서 푸터 하단 고정 */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .b-footer {
    margin-top: auto;
  }

  /* 메인 콘텐츠 영역 확장 */
  .container-xxl {
    flex: 1;
  }

  /* 방송 페이지 모바일 레이아웃 수정 */
  .d-md-none[style*="height: 100vh"] {
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* 방송 페이지에서 body flex 해제 */
  body:has(.live-stage) {
    display: block !important;
    min-height: auto !important;
  }

  body:has(.live-stage) .b-footer {
    margin-top: 0 !important;
  }

  /* 비디오 컨테이너 스타일 */
  .video-wrap {
    min-height: 300px;
    background: #000;
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
  }

  .video-wrap video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    background: #000;
    position: relative;
    z-index: 10;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* 비디오 컨트롤 완전 숨기기 */
  .video-wrap video::-webkit-media-controls {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-panel {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-play-button {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-timeline {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-current-time-display {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-time-remaining-display {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-mute-button {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-volume-slider {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-fullscreen-button {
    display: none !important;
  }

  .video-wrap video::-webkit-media-controls-overlay-play-button {
    display: none !important;
  }

  /* 모바일 비디오 높이 조정 */
  @media (max-width: 767.98px) {
    .video-wrap {
      min-height: 35vh;
    }
  }

  /* 모바일 액션 버튼 영역 스타일 */
  .bg-light {
    background-color: rgba(248, 249, 250, 0.8) !important;
  }

  /* 터치 친화적 버튼 크기 */
  .account-required-btn {
    padding: 0.5rem;
    min-width: 60px;
    min-height: 60px;
    border-radius: 8px;
  }

  .account-required-btn:active {
    transform: scale(0.95);
    background-color: rgba(13, 110, 253, 0.1);
  }

  /* 모바일 채팅 스타일 */
  .chat-body {
    background: #f8f9fa;
  }

  .message.system {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 0.5rem 0;
  }

  /* 모바일 비디오 영역 */
  .d-md-none .video-wrap {
    border-radius: 0;
  }

  /* 채팅 입력 영역 고정 */
  .chat-input {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
  }

  /* 모바일에서 스크롤바 숨기기 */
  .chat-body::-webkit-scrollbar {
    width: 4px;
  }

  .chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
  }

  /* 채팅 애니메이션 */
  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(30px);
    }

    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes slideInLeft {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }

    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
}


/* 삭제된 메시지 스타일 */
.deleted-message {
  opacity: 0.6 !important;
  background-color: #f8f9fa !important;
  color: #6c757d !important;
  font-style: italic !important;
}

/* 관리자 쪽 삭제된 메시지 스타일 */
.admin-bubble.deleted-message {
  opacity: 0.6 !important;
  background-color: #f8f9fa !important;
  border-color: #dee2e6 !important;
}