/* ========================================
   SOOP Chat Crawler - HadesChart Style
   Based on hadeschart.com design system
   ======================================== */

/* Pretendard 폰트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css');

/* Material Icons 기본 스타일 */
.material-icons {
  font-size: 18px;
  vertical-align: middle;
  margin-right: 4px;
  opacity: 0.8;
}

h1 .material-icons,
h2 .material-icons,
h3 .material-icons {
  font-size: 24px;
  margin-right: 8px;
}

.stat-label .material-icons {
  font-size: 16px;
  margin-right: 4px;
}

.btn .material-icons {
  font-size: 16px;
  margin-right: 4px;
}

.tab-btn .material-icons {
  font-size: 18px;
  margin-right: 6px;
}

.nav-toggle .material-icons {
  font-size: 24px;
  margin: 0;
}

.view-toggle-btn .material-icons {
  font-size: 18px;
  margin: 0;
}

.search-icon.material-icons {
  font-size: 18px;
  margin: 0;
}

.amount-cell .material-icons,
.viewer-cell .material-icons{
  font-size: 14px;
  margin-right: 2px;
  color: var(--warning);
}

.viewer-cell .material-icons.pink {
  font-size: 14px;
  margin-right: 2px;
  color: var(--accent-pink);
}

.broadcast-card-viewers .material-icons {
  font-size: 14px;
  margin-right: 4px;
}

/* 네비게이션 로고 */
.nav-logo {
  height: 22px;
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
  background: white;
  padding: 4px 6px;
  border-radius: 4px;
}

/* CSS 변수 - 하데스차트 색상 시스템 */
:root {
  /* 배경 색상 */
  --bg-primary: #0a0a0a;
  --bg-secondary: #0f0f0f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-overlay: rgba(255, 255, 255, 0.05);

  /* 테두리 색상 */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.08);

  /* 텍스트 색상 */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* 액센트 색상 */
  --accent-pink: #ff207d;
  --accent-blue: #ff207d;
  --accent-gradient: linear-gradient(135deg, #f6339a 0%, #3080ff 100%);

  /* 상태 색상 */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);

  /* Zinc 색상 */
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --zinc-950: #09090b;

  /* 그림자 - 하데스차트 스타일 */
  --shadow-card: 0 0 0 1px rgba(255,255,255,0.08), 0 2px 8px rgba(0,0,0,0.9), 0 8px 32px rgba(0,0,0,0.8);
  --shadow-lg: 0 0 0 1px rgba(255,255,255,0.08), 0 2px 8px rgba(0,0,0,0.9), 0 8px 32px rgba(0,0,0,0.8), 0 16px 64px rgba(0,0,0,0.6);

  /* 반경 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 트랜지션 */
  --transition: all 0.2s ease;
}

/* 기본 스타일 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-feature-settings: 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--text-primary);
}

/* 스크롤바 - 미니멀 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   네비게이션 - 하데스차트 스타일
   ======================================== */
.navbar {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

/* .nav-brand::before {
  content: '';
  width: 24px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: 6px;
} */

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text-secondary);
  background: var(--bg-overlay);
}

.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-overlay);
}

.nav-user {
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-user::before {
  content: '아이디 : ';
  font-size: 12px;
}

.nav-logout {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.nav-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}

/* ========================================
   컨테이너
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* ========================================
   통계 카드 - 하데스차트 스타일
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.stat-card.highlight {
  background: linear-gradient(135deg, rgba(246, 51, 154, 0.1) 0%, rgba(48, 128, 255, 0.1) 100%);
  border-color: rgba(246, 51, 154, 0.3);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

/* ========================================
   섹션 & 카드 - 하데스차트 스타일
   ======================================== */
.section, .card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.section {
  padding: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header.compact {
  margin-bottom: 0.5rem;
}

/* 8시 기준 표시 */
.time-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.time-indicator .material-icons {
  font-size: 1rem;
}

/* 섹션 헤더 액션 영역 */
.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h2,
.section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section h2 {
  margin-bottom: 16px;
}

/* ========================================
   테이블 - 미니멀 스타일
   ======================================== */
.table-container {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-overlay);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.title-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.time-cell {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.amount-cell {
  font-weight: 600;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
}

.viewer-cell {
  font-weight: 600;
  color: var(--accent-blue);
  font-variant-numeric: tabular-nums;
}

.message-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

/* ========================================
   상태 배지
   ======================================== */
.status-badge {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.status-connected {
  background: var(--success-bg);
  color: var(--success);
}

.status-connected::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

.status-disconnected {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ========================================
   버튼 - 하데스차트 스타일
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 0 20px rgba(246, 51, 154, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(246, 51, 154, 0.4);
}

.btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* ========================================
   폼 & 입력
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(246, 51, 154, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 16px;
}

.form-message.success {
  background: var(--success-bg);
  color: var(--success);
}

.form-message.error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ========================================
   툴바 & 검색
   ======================================== */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  flex: 1;
  max-width: 400px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent-pink);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  color: var(--text-muted);
  font-size: 14px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* Select 요소 스타일 */
select.form-input,
.toolbar-actions select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 36px 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.7)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select.form-input:hover,
.toolbar-actions select:hover {
  border-color: var(--accent-pink);
}

select.form-input:focus,
.toolbar-actions select:focus {
  outline: none;
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(246, 51, 154, 0.1);
}

select.form-input option,
.toolbar-actions select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

/* ========================================
   페이지네이션
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

#pageNumbers,
#gridPageNumbers {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 16px;
}

/* ========================================
   탭
   ======================================== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-pink);
}

.tab-content {
  display: none !important;
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

.tab-content.active {
  display: block !important;
  visibility: visible;
  height: auto;
  overflow: visible;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   알림
   ======================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ========================================
   세션 통계 행
   ======================================== */
.stats-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.stats-row span {
  color: var(--text-muted);
  font-size: 14px;
}

.stats-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========================================
   검색 페이지
   ======================================== */
.search-page {
  max-width: 600px;
  margin: 0 auto;
  padding-top: 40px;
}

.search-page h1 {
  text-align: center;
  margin-bottom: 32px;
}

.search-page .search-box {
  max-width: 100%;
  padding: 14px 20px;
}

.search-page .search-box input {
  font-size: 16px;
}

.search-help {
  padding: 24px;
}

.search-help h3 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}

.search-help ul {
  margin-left: 20px;
  color: var(--text-secondary);
}

.search-help li {
  margin-bottom: 8px;
  font-size: 14px;
}

/* ========================================
   사용자 & 모니터링 페이지
   ======================================== */
.user-page h1,
.monitors-page h1 {
  font-size: 24px;
  margin-bottom: 24px;
}

.add-form {
  padding: 24px;
  margin-bottom: 24px;
}

.add-form h2 {
  margin-bottom: 16px;
  font-size: 15px;
}

.add-form form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.add-form input {
  padding: 10px 16px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  min-width: 180px;
}

.add-form input:focus {
  outline: none;
  border-color: var(--accent-pink);
}

.help-section {
  padding: 24px;
  margin-top: 24px;
}

.help-section h3 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}

.help-section ul {
  margin-left: 20px;
  color: var(--text-secondary);
}

.help-section li {
  margin-bottom: 8px;
  font-size: 14px;
}

/* ========================================
   빈 상태
   ======================================== */
.no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

/* ========================================
   푸터
   ======================================== */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-light);
  margin-top: 48px;
}

/* ========================================
   로딩 스피너
   ======================================== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-pink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   브로드캐스트 카드 그리드
   ======================================== */
.broadcast-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1400px) {
  .broadcast-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1200px) {
  .broadcast-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .broadcast-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .broadcast-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.broadcast-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}

.broadcast-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.broadcast-card-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-overlay);
  overflow: hidden;
}

.broadcast-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.broadcast-card-thumbnail .broadcast-card-viewers {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.broadcast-card-info {
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.broadcast-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-overlay);
}

.broadcast-card-text {
  flex: 1;
  min-width: 0;
}

.broadcast-card-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.broadcast-card-bj {
  font-size: 13px;
  color: var(--text-muted);
}

.broadcast-card-bj a {
  color: var(--text-secondary);
}

.broadcast-card-viewers {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 14px;
}

/* ========================================
   뷰 토글
   ======================================== */
.view-toggle {
  display: flex;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border-color);
}

.view-toggle-btn {
  padding: 6px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 14px;
}

.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ========================================
   정렬 토글
   ======================================== */
.sort-toggle {
  display: flex;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border-color);
}

.sort-toggle-btn {
  padding: 6px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sort-toggle-btn .material-icons {
  font-size: 18px;
  margin: 0;
}

.sort-toggle-btn:hover {
  color: var(--text-secondary);
}

.sort-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ========================================
   반응형 - 태블릿
   ======================================== */
@media (max-width: 1024px) {
  .container {
    padding: 24px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   반응형 - 모바일
   ======================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    display: none;
    backdrop-filter: blur(20px);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
  }

  .nav-toggle {
    display: block;
  }

  .container {
    padding: 20px 16px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 11px;
  }

  .section {
    padding: 20px 16px;
  }

  .table-container {
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 후원 내역/받은 후원 테이블: 모바일에서 가로 스크롤 */
  #donationsTable,
  #receivedTable {
    min-width: 500px;
    white-space: nowrap;
  }

  #donationsTable td,
  #donationsTable th,
  #receivedTable td,
  #receivedTable th {
    white-space: nowrap;
    padding: 10px 12px;
  }

  #donationsTable .message-cell,
  #receivedTable .message-cell {
    white-space: normal;
    min-width: 120px;
    max-width: 200px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

  .toolbar-actions {
    margin-left: 0;
    justify-content: flex-end;
  }

  .form-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .form-row > div {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .form-row .form-input {
    width: 100%;
  }

  .form-row .btn {
    width: 100%;
    margin-top: 8px;
  }

  /* 키워드/모니터링 추가 폼 모바일 최적화 */
  .keywords-page .form-row,
  .monitors-page .form-row {
    gap: 8px;
  }

  .keywords-page .form-row > div,
  .monitors-page .form-row > div {
    position: relative;
  }

  .keywords-page .form-row .btn,
  .monitors-page .form-row .btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .stats-row {
    flex-direction: column;
    gap: 8px;
  }

  .tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    margin: 8px 0;
    order: -1;
  }

  .add-form form {
    flex-direction: column;
  }

  .add-form input {
    width: 100%;
  }

  .broadcast-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 12px;
  }

  .title-cell {
    max-width: 150px;
  }

  .message-cell {
    max-width: 100px;
  }

  /* 세션 통계 반응형 */
  .stats-row {
    font-size: 13px;
    padding: 12px;
  }

  /* 네비게이션 유저/로그아웃 */
  .nav-user {
    font-size: 12px;
  }

  .nav-logout {
    font-size: 12px;
  }

  /* LIVE 인디케이터 */
  .live-indicator {
    font-size: 10px;
    padding: 2px 6px;
  }

  .live-dot {
    width: 5px;
    height: 5px;
  }

  /* 상태 배지 반응형 - 항상 가로 유지 */
  .status-badge {
    display: inline-flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
}

/* ========================================
   반응형 - 소형 모바일
   ======================================== */
@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .stat-card {
    padding: 12px 10px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-label .material-icons {
    font-size: 12px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .page-header h1 .material-icons {
    font-size: 20px;
  }

  .subtitle {
    font-size: 12px;
  }

  .section {
    padding: 16px 12px;
  }

  .section h2,
  .section-header h2 {
    font-size: 13px;
  }

  .section-header h2 .material-icons {
    font-size: 16px;
  }

  /* 버튼 반응형 */
  .btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .btn-small {
    padding: 4px 8px;
    font-size: 10px;
  }

  .btn .material-icons {
    font-size: 14px;
  }

  /* 테이블 반응형 */
  .data-table {
    font-size: 11px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }

  .title-cell {
    max-width: 100px;
  }

  .message-cell {
    max-width: 80px;
  }

  /* 탭 반응형 */
  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* 페이지네이션 반응형 */
  .pagination-btn {
    min-width: 28px;
    height: 28px;
    font-size: 11px;
  }

  /* 세션 통계 반응형 */
  .stats-row {
    font-size: 12px;
  }

  .stats-row strong {
    font-size: 13px;
  }

  /* footer 반응형 */
  .footer {
    font-size: 11px;
    padding: 16px;
  }

  /* 알림 반응형 */
  .alert {
    font-size: 12px;
    padding: 10px 12px;
  }

  /* 툴바 반응형 */
  .toolbar {
    gap: 8px;
  }

  .search-box {
    padding: 8px 12px;
  }

  .search-box input {
    font-size: 12px;
  }

  /* 폼 반응형 소형 모바일 */
  .form-row {
    gap: 6px;
  }

  .form-row .btn {
    padding: 10px 16px;
    font-size: 13px;
    margin-top: 6px;
  }

  .form-input {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* 키워드/모니터링 페이지 소형 모바일 */
  .keywords-page .section,
  .monitors-page .section {
    padding: 14px 12px;
  }

  .keywords-page .form-row .btn,
  .monitors-page .form-row .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .keywords-page .section-header h2,
  .monitors-page .section-header h2 {
    font-size: 13px;
  }

  .keywords-page .section-header h2 .material-icons,
  .monitors-page .section-header h2 .material-icons {
    font-size: 16px;
  }

  /* 방송 카드 반응형 */
  .broadcast-card {
    padding: 12px;
  }

  .broadcast-card .title {
    font-size: 13px;
  }

  .broadcast-card .meta {
    font-size: 11px;
  }

  /* 상태 배지 소형 모바일 - 항상 가로 유지 */
  .status-badge {
    display: inline-flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    font-size: 10px;
    padding: 3px 8px;
    gap: 4px;
  }
}

/* ========================================
   유틸리티 클래스
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ========================================
   스켈레톤 UI
   ======================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-overlay) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    var(--bg-overlay) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text.large {
  height: 28px;
  width: 200px;
}

.skeleton-text.small {
  height: 14px;
  width: 120px;
}

.skeleton-stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.skeleton-stat-value {
  height: 32px;
  width: 80px;
  margin-bottom: 8px;
}

.skeleton-stat-label {
  height: 14px;
  width: 100px;
}

.skeleton-table-row {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.skeleton-table-cell {
  height: 20px;
}

.skeleton-avatar {
  width: 80px;
  height: 80px;
}

.skeleton-btn {
  height: 32px;
  width: 120px;
}

/* ========================================
   랭킹 UI
   ======================================== */
.ranking-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.ranking-tab {
  padding: 5px 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.ranking-tab:hover {
  color: var(--text-secondary);
  border-color: var(--accent-pink);
}

.ranking-tab.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.ranking-item:hover {
  background: var(--bg-card-hover);
}

.ranking-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ranking-rank.rank-medal {
  font-size: 18px;
}

.ranking-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-overlay);
  flex-shrink: 0;
}

.ranking-user {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ranking-user a {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-user a:hover {
  color: var(--accent-pink);
}

.ranking-count {
  font-size: 12px;
  color: var(--text-muted);
}

.ranking-amount {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--warning);
  flex-shrink: 0;
}

.ranking-amount .material-icons {
  font-size: 14px;
}

.ranking-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 13px;
}

.ranking-stats strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ranking-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
}

/* 랭킹 상세 페이지 */
.ranking-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.ranking-page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ranking-page-tab {
  padding: 5px 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.ranking-page-tab:hover {
  color: var(--text-secondary);
  border-color: var(--accent-pink);
}

.ranking-page-tab.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.time-range-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem 0;
}

.time-range-info .material-icons {
  font-size: 1rem;
  vertical-align: middle;
}

.ranking-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.ranking-summary-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-align: center;
}

.ranking-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.ranking-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ranking-table {
  width: 100%;
}

.ranking-table-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.ranking-table-row:hover {
  background: var(--bg-overlay);
}

.ranking-table-row:last-child {
  border-bottom: none;
}

.ranking-table-rank {
  width: 40px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

.ranking-table-rank.top-3 {
  font-size: 20px;
}

.ranking-table-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-overlay);
  flex-shrink: 0;
}

.ranking-table-user {
  flex: 1;
  min-width: 0;
}

.ranking-table-user a {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 15px;
}

.ranking-table-user-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ranking-table-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.ranking-table-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--warning);
}

.ranking-table-count {
  font-size: 14px;
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
}

.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  margin-top: 16px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.load-more-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-more-btn .spinner {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .ranking-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .ranking-tab {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 12px;
  }

  /* 랭킹 리스트 아이템 모바일 최적화 */
  .ranking-list {
    gap: 6px;
  }

  .ranking-item {
    gap: 8px;
    padding: 10px 12px;
  }

  .ranking-rank {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .ranking-rank.rank-medal {
    font-size: 16px;
  }

  .ranking-avatar {
    width: 32px;
    height: 32px;
  }

  .ranking-user a {
    font-size: 13px;
  }

  .ranking-count {
    font-size: 11px;
  }

  .ranking-amount {
    font-size: 13px;
  }

  .ranking-amount .material-icons {
    font-size: 12px;
  }

  .ranking-stats {
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
  }

  .ranking-table-stats {
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
  }

  .ranking-table-count {
    min-width: auto;
  }

  /* 섹션 헤더 반응형 */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* 8시 기준 표시 반응형 */
  .time-indicator {
    font-size: 0.7rem;
  }

  .time-indicator .material-icons {
    font-size: 0.85rem;
  }

  /* 랭킹 페이지 반응형 */
  .time-range-info {
    font-size: 0.8rem;
  }

  .time-range-info .material-icons {
    font-size: 0.9rem;
  }

  .ranking-page-tabs {
    gap: 6px;
    flex-wrap: wrap;
  }

  .ranking-page-tab {
    padding: 4px 8px;
    font-size: 12px;
  }

  .ranking-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .ranking-summary-card {
    padding: 12px 8px;
  }

  .ranking-summary-value {
    font-size: 18px;
  }

  .ranking-summary-label {
    font-size: 10px;
  }

  .ranking-table-row {
    gap: 10px;
    padding: 12px 8px;
  }

  .ranking-table-rank {
    width: 30px;
    font-size: 14px;
  }

  .ranking-table-rank.top-3 {
    font-size: 18px;
  }

  .ranking-table-avatar {
    width: 36px;
    height: 36px;
  }

  .ranking-table-user a {
    font-size: 13px;
  }

  .ranking-table-user-id {
    font-size: 11px;
  }

  .ranking-table-amount {
    font-size: 14px;
  }

  .ranking-table-count {
    font-size: 12px;
  }

  .load-more-btn {
    padding: 12px;
    font-size: 13px;
  }

  /* 랭킹 컬럼 반응형 */
  .ranking-column {
    padding: 12px;
  }

  .ranking-column-header {
    font-size: 13px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .ranking-column-header .material-icons {
    font-size: 16px;
  }
}

/* 2열 레이아웃 랭킹 */
.ranking-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ranking-column {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.ranking-column-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.ranking-column-header .material-icons {
  font-size: 18px;
  color: var(--accent-pink);
}

@media (max-width: 768px) {
  .ranking-columns {
    grid-template-columns: 1fr;
  }
}

/* 랭킹 페이지 소형 모바일 */
@media (max-width: 480px) {
  .time-range-info {
    font-size: 0.7rem;
    margin: -0.25rem 0 0.75rem 0;
  }

  .time-range-info .material-icons {
    font-size: 0.8rem;
  }

  .ranking-page-tabs {
    gap: 4px;
  }

  .ranking-page-tab {
    padding: 4px 6px;
    font-size: 11px;
  }

  .ranking-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .ranking-summary-card {
    padding: 10px 6px;
  }

  .ranking-summary-value {
    font-size: 15px;
  }

  .ranking-summary-label {
    font-size: 9px;
  }

  .ranking-table-row {
    gap: 8px;
    padding: 10px 6px;
  }

  .ranking-table-rank {
    width: 24px;
    font-size: 12px;
  }

  .ranking-table-rank.top-3 {
    font-size: 16px;
  }

  .ranking-table-avatar {
    width: 32px;
    height: 32px;
  }

  .ranking-table-user a {
    font-size: 12px;
  }

  .ranking-table-user-id {
    font-size: 10px;
  }

  .ranking-table-amount {
    font-size: 12px;
  }

  .ranking-table-amount .material-icons {
    font-size: 14px;
  }

  .ranking-table-count {
    font-size: 10px;
  }

  .load-more-btn {
    padding: 10px;
    font-size: 12px;
  }

  .ranking-column {
    padding: 10px;
  }

  .ranking-column-header {
    font-size: 12px;
    gap: 4px;
  }

  .ranking-column-header .material-icons {
    font-size: 14px;
  }

  /* 랭킹 리스트 아이템 소형 모바일 */
  .ranking-list {
    gap: 4px;
  }

  .ranking-item {
    gap: 6px;
    padding: 8px 10px;
  }

  .ranking-rank {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .ranking-rank.rank-medal {
    font-size: 14px;
  }

  .ranking-avatar {
    width: 28px;
    height: 28px;
  }

  .ranking-user {
    gap: 1px;
  }

  .ranking-user a {
    font-size: 12px;
  }

  .ranking-count {
    font-size: 10px;
  }

  .ranking-amount {
    font-size: 11px;
    gap: 2px;
  }

  .ranking-amount .material-icons {
    font-size: 11px;
  }

  .ranking-stats {
    gap: 6px;
    font-size: 11px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .ranking-item-info {
    font-size: 12px;
  }

  .ranking-item-amount {
    font-size: 12px;
  }
}

/* ========================================
   반응형 테이블 - 모바일 카드 변환
   ======================================== */

/* 테이블 래퍼 (스크롤 가능) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 모바일에서 테이블을 카드로 변환하는 클래스 */
.table-card-mobile {
  width: 100%;
}

@media (max-width: 768px) {
  /* 카드형 테이블 변환 */
  .table-card-mobile thead {
    display: none;
  }

  .table-card-mobile tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .table-card-mobile tbody tr {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    gap: 0;
  }

  .table-card-mobile tbody tr:hover {
    background: var(--bg-card-hover);
  }

  .table-card-mobile tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--border-light);
    min-height: 32px;
  }

  .table-card-mobile tbody td:last-child {
    border-bottom: none;
  }

  .table-card-mobile tbody td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
  }

  /* 첫번째 셀(BJ 이름)은 헤더 스타일 */
  .table-card-mobile tbody td:first-child {
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 2px solid var(--primary);
  }

  .table-card-mobile tbody td:first-child::before {
    color: var(--primary);
    font-weight: 600;
  }

  /* 값(오른쪽) 스타일 */
  .table-card-mobile tbody td > a,
  .table-card-mobile tbody td > span:not(.material-icons) {
    font-size: 13px;
    font-weight: 500;
  }

  /* amount-cell: 아이콘과 숫자를 하나로 묶어서 표시 */
  .table-card-mobile .amount-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .table-card-mobile .amount-value .material-icons {
    font-size: 14px;
  }

  /* 카드 내 셀 정렬 */
  .table-card-mobile .time-cell,
  .table-card-mobile .amount-cell {
    max-width: none;
    white-space: nowrap;
  }

  .table-card-mobile .message-cell {
    max-width: none;
    text-align: right;
    word-break: break-word;
  }

  .table-card-mobile .title-cell {
    max-width: none;
    white-space: normal;
    word-break: break-word;
    text-align: right;
  }

  /* 상태 배지 정렬 */
  .table-card-mobile .status-badge {
    flex-shrink: 0;
  }

  /* 버튼 그룹 정렬 */
  .table-card-mobile td .btn {
    flex-shrink: 0;
  }
}

/* ========================================
   모바일 가로 스크롤 테이블 (카드 변환 없이)
   ======================================== */
.table-scroll-mobile {
  width: 100%;
}

.table-scroll-mobile th,
.table-scroll-mobile td {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .table-scroll-mobile-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }

  .table-scroll-mobile {
    min-width: 600px;
  }

  .table-scroll-mobile th,
  .table-scroll-mobile td {
    font-size: 12px;
    padding: 8px 6px;
    white-space: nowrap;
  }

  .table-scroll-mobile td {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  /* BJ 프로필 이미지 작게 */
  .table-scroll-mobile .bj-profile-img {
    width: 28px !important;
    height: 28px !important;
  }

  /* 제목 셀 최대 너비 */
  .table-scroll-mobile .title-cell {
    max-width: 120px;
  }
}

@media (max-width: 480px) {
  .table-scroll-mobile {
    min-width: 500px;
  }

  .table-scroll-mobile th,
  .table-scroll-mobile td {
    font-size: 11px;
    padding: 6px 4px;
  }
}

/* ========================================
   데이터 테이블 반응형 개선
   ======================================== */

/* 테이블 헤더 고정 */
.data-table-sticky thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-secondary);
}

/* 컬럼 너비 제어 */
.col-time { width: 15%; min-width: 80px; }
.col-user { width: 20%; min-width: 100px; }
.col-amount { width: 15%; min-width: 80px; }
.col-message { width: auto; min-width: 100px; }
.col-status { width: 10%; min-width: 70px; }
.col-action { width: 10%; min-width: 60px; }

@media (max-width: 768px) {
  .col-time { width: auto; min-width: 70px; }
  .col-user { width: auto; min-width: 80px; }
  .col-amount { width: auto; min-width: 70px; }
  .col-message { display: none; } /* 모바일에서 메시지 숨김 */
  .col-status { width: auto; min-width: 60px; }
}

@media (max-width: 480px) {
  .col-time { min-width: 60px; }
  .col-user { min-width: 70px; }
  .col-amount { min-width: 60px; }
}

/* ========================================
   모바일 데이터 카드
   ======================================== */
.data-card-list {
  display: none;
}

@media (max-width: 600px) {
  /* 테이블 숨기고 카드 표시 옵션 */
  .hide-table-mobile .table-container {
    display: none;
  }

  .hide-table-mobile .data-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: var(--transition);
}

.data-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.data-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  margin-right: 12px;
}

.data-card-badge {
  flex-shrink: 0;
}

.data-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.data-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.data-card-label {
  color: var(--text-muted);
}

.data-card-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.data-card-value.highlight {
  color: var(--warning);
}

.data-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.data-card-time {
  font-size: 12px;
  color: var(--text-muted);
}

.data-card-actions {
  display: flex;
  gap: 8px;
}

/* ========================================
   후원 테이블 모바일 최적화
   ======================================== */
@media (max-width: 600px) {
  /* 후원 테이블 - 핵심 정보만 표시 */
  .donation-table-mobile th:nth-child(5),
  .donation-table-mobile td:nth-child(5) {
    display: none; /* 메시지 숨김 */
  }

  .donation-table-mobile th,
  .donation-table-mobile td {
    padding: 10px 6px;
    font-size: 12px;
  }

  .donation-table-mobile .amount-cell {
    font-size: 13px;
  }

  .donation-table-mobile .amount-cell .material-icons {
    font-size: 12px;
  }
}

/* ========================================
   키워드/모니터 테이블 모바일
   ======================================== */
@media (max-width: 768px) {
  .keyword-table,
  .monitor-table {
    font-size: 13px;
  }

  .keyword-table th,
  .keyword-table td,
  .monitor-table th,
  .monitor-table td {
    padding: 10px 8px;
  }

  /* 액션 버튼 정렬 */
  .keyword-table .btn,
  .monitor-table .btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .keyword-table,
  .monitor-table {
    font-size: 12px;
  }

  .keyword-table th,
  .keyword-table td,
  .monitor-table th,
  .monitor-table td {
    padding: 8px 6px;
  }

  .keyword-table .btn,
  .monitor-table .btn {
    padding: 5px 8px;
    font-size: 10px;
  }
}

/* ========================================
   사용자 상세 테이블 모바일
   ======================================== */
@media (max-width: 768px) {
  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .user-detail-table th,
  .user-detail-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .user-stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .user-detail-table {
    font-size: 11px;
  }

  .user-detail-table th,
  .user-detail-table td {
    padding: 8px 6px;
  }

  /* 일부 컬럼 숨김 */
  .user-detail-table .col-hide-mobile {
    display: none;
  }
}

/* ========================================
   스크롤 인디케이터 (테이블이 스크롤 가능할 때)
   ======================================== */
.table-scroll-indicator {
  position: relative;
}

.table-scroll-indicator::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--bg-card));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.table-scroll-indicator.has-scroll::after {
  opacity: 1;
}

@media (max-width: 768px) {
  .table-scroll-indicator::after {
    width: 30px;
  }
}

/* ========================================
   빈 상태 카드
   ======================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 300px;
}

@media (max-width: 480px) {
  .empty-state {
    padding: 32px 16px;
  }

  .empty-state-icon {
    font-size: 40px;
  }

  .empty-state-title {
    font-size: 14px;
  }

  .empty-state-desc {
    font-size: 12px;
  }
}

/* ========================================
   로딩 오버레이
   ======================================== */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   터치 친화적 요소
   ======================================== */
@media (max-width: 768px) {
  /* 터치 타겟 최소 크기 확보 */
  .btn,
  .pagination-btn,
  .tab-btn,
  .ranking-tab,
  .nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* 링크 터치 영역 확대 */
  .data-table a,
  .ranking-item a {
    padding: 4px 0;
  }

  /* 체크박스/라디오 크기 증가 */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
  }
}

/* ========================================
   프린트 스타일
   ======================================== */
@media print {
  .navbar,
  .footer,
  .pagination,
  .toolbar,
  .btn,
  .nav-toggle {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .section,
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .data-table {
    font-size: 10px;
  }

  body {
    background: white;
    color: black;
  }
}
