/* ==========================================================================
   dashboard.css — 통계 대시보드
   통계 카드, 랭킹 영역, 차트 컨테이너, 애니메이션 카운터,
   도넛 차트 배치, 인용문 영역
   ========================================================================== */

/* ------------------------------------------------------------------
   교구 로고 (.diocese-logo-sm)
   ------------------------------------------------------------------ */
.diocese-logo-sm {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}
/* ------------------------------------------------------------------
   테이블 모바일 텍스트 줄바꿈
   ------------------------------------------------------------------ */
.diocese-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
}

/* ------------------------------------------------------------------
   통계 카드 (.stat-card)
   숫자 + 라벨 + 아이콘 조합
   ------------------------------------------------------------------ */
.stat-card {
  background-color: var(--wyd-surface);
  border: 1px solid var(--wyd-border-light);
  border-radius: var(--wyd-radius-lg);
  padding: var(--wyd-space-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--wyd-space-md);
  transition: box-shadow var(--wyd-transition-base),
              transform var(--wyd-transition-base);
}

.stat-card:hover {
  box-shadow: var(--wyd-shadow-md);
  transform: translateY(-2px);
}

/* 통계 텍스트 영역 */
.stat-card .stat-info {
  display: flex;
  flex-direction: column;
  gap: var(--wyd-space-xs);
}

/* 통계 숫자 (크게 표시) */
.stat-card .stat-number {
  font-family: var(--wyd-font-heading);
  font-size: var(--wyd-fs-3xl);
  font-weight: var(--wyd-fw-bold);
  color: var(--wyd-text);
  line-height: 1;
}

/* 통계 라벨 */
.stat-card .stat-label {
  font-size: var(--wyd-fs-sm);
  color: var(--wyd-text-secondary);
  font-weight: var(--wyd-fw-medium);
}

/* 변동률 표시 (+/-) */
.stat-card .stat-change {
  font-size: var(--wyd-fs-xs);
  font-weight: var(--wyd-fw-semibold);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: var(--wyd-space-xs);
}

.stat-card .stat-change.up {
  color: var(--wyd-success);
}

.stat-card .stat-change.down {
  color: var(--wyd-danger);
}

/* 통계 아이콘 영역 */
.stat-card .stat-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--wyd-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--wyd-fs-xl);
}

/* 아이콘 색상 변형 */
.stat-icon.primary {
  background-color: rgba(var(--wyd-primary-rgb), 0.1);
  color: var(--wyd-primary);
}

.stat-icon.secondary {
  background-color: rgba(var(--wyd-secondary-rgb), 0.1);
  color: var(--wyd-secondary);
}

.stat-icon.success {
  background-color: rgba(var(--wyd-success-rgb), 0.1);
  color: var(--wyd-success);
}

.stat-icon.accent {
  background-color: rgba(var(--wyd-accent-rgb), 0.12);
  color: var(--wyd-accent-dark);
}

.stat-icon.goodnews {
  background-color: rgba(var(--wyd-goodnews-rgb), 0.1);
  color: var(--wyd-goodnews);
}

/* 통계 카드 그리드 레이아웃 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--wyd-space-lg);
}

/* ------------------------------------------------------------------
   랭킹 영역 (.ranking-area)
   순위 테이블이 포함된 랭킹 컴포넌트
   ------------------------------------------------------------------ */
.ranking-area {
  background-color: var(--wyd-surface);
  border: 1px solid var(--wyd-border-light);
  border-radius: var(--wyd-radius-lg);
  padding: var(--wyd-space-lg);
}

.ranking-area .ranking-title {
  font-family: var(--wyd-font-heading);
  font-size: var(--wyd-fs-lg);
  font-weight: var(--wyd-fw-semibold);
  color: var(--wyd-text);
  margin-bottom: var(--wyd-space-md);
  display: flex;
  align-items: center;
  gap: var(--wyd-space-sm);
}

/* 랭킹 테이블 (.list-area) */
.ranking-area .list-area {
  width: 100%;
}

.ranking-area .list-area table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-area .list-area th {
  padding: var(--wyd-space-sm) var(--wyd-space-md);
  font-size: var(--wyd-fs-xs);
  font-weight: var(--wyd-fw-semibold);
  color: var(--wyd-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 2px solid var(--wyd-border);
  background-color: var(--wyd-bg);
}

.ranking-area .list-area td {
  padding: var(--wyd-space-sm) var(--wyd-space-md);
  font-size: var(--wyd-fs-sm);
  color: var(--wyd-text);
  border-bottom: 1px solid var(--wyd-border-light);
  vertical-align: middle;
}

.ranking-area .list-area tr:hover td {
  background-color: var(--wyd-surface-hover);
}

/* 순위 번호 스타일 */
.ranking-area .rank-num {
  font-family: var(--wyd-font-heading);
  font-weight: var(--wyd-fw-bold);
  font-size: var(--wyd-fs-base);
  color: var(--wyd-text-secondary);
  min-width: 32px;
  text-align: center;
}

/* 상위 3위 강조 */
.ranking-area .rank-num.top-1 { color: var(--wyd-accent-dark); }
.ranking-area .rank-num.top-2 { color: var(--wyd-text-secondary); }
.ranking-area .rank-num.top-3 { color: #CD7F32; }  /* 동메달 색 */

/* 랭킹 사용자 정보 */
.ranking-area .rank-user {
  display: flex;
  align-items: center;
  gap: var(--wyd-space-sm);
}

.ranking-area .rank-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--wyd-radius-full);
  background-color: var(--wyd-border-light);
}

.ranking-area .rank-user-name {
  font-weight: var(--wyd-fw-medium);
}

/* 더보기 링크 */
.ranking-area .ranking-more {
  display: flex;
  justify-content: center;
  margin-top: var(--wyd-space-md);
  padding-top: var(--wyd-space-md);
  border-top: 1px solid var(--wyd-border-light);
}

.ranking-area .ranking-more a {
  font-size: var(--wyd-fs-sm);
  color: var(--wyd-primary);
  text-decoration: none;
  font-weight: var(--wyd-fw-medium);
  transition: opacity var(--wyd-transition-base);
}

.ranking-area .ranking-more a:hover {
  opacity: 0.7;
}

/* ------------------------------------------------------------------
   차트 컨테이너 (.circles)
   원형 차트 / 그래프 래퍼
   ------------------------------------------------------------------ */
.circles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wyd-space-xl);
  flex-wrap: wrap;
  padding: var(--wyd-space-lg);
}

.circles .circle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wyd-space-sm);
}

.circles .circle-chart {
  position: relative;
  width: 120px;
  height: 120px;
}

.circles .circle-label {
  font-size: var(--wyd-fs-sm);
  color: var(--wyd-text-secondary);
  font-weight: var(--wyd-fw-medium);
  text-align: center;
}

.circles .circle-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--wyd-font-heading);
  font-size: var(--wyd-fs-xl);
  font-weight: var(--wyd-fw-bold);
  color: var(--wyd-text);
}

/* ------------------------------------------------------------------
   애니메이션 카운터 (.countBlock)
   숫자가 올라가는 카운트 블록
   ------------------------------------------------------------------ */
.countBlock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wyd-space-2xl);
  flex-wrap: wrap;
  padding: var(--wyd-space-2xl) 0;
}

.countBlock .count-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wyd-space-sm);
  min-width: 150px;
}

/* 카운트 숫자 */
.countBlock .count-number {
  font-family: var(--wyd-font-heading);
  font-size: var(--wyd-fs-4xl);
  font-weight: var(--wyd-fw-extrabold);
  color: var(--wyd-primary);
  line-height: 1;
}

/* 카운트 숫자 뒤 단위 */
.countBlock .count-number .unit {
  font-size: var(--wyd-fs-xl);
  font-weight: var(--wyd-fw-semibold);
  color: var(--wyd-text-secondary);
  margin-left: var(--wyd-space-xs);
}

/* 카운트 라벨 */
.countBlock .count-label {
  font-size: var(--wyd-fs-sm);
  color: var(--wyd-text-secondary);
  font-weight: var(--wyd-fw-medium);
}

/* 카운터 애니메이션 클래스 (JS에서 토글) */
.countBlock .count-number.animated {
  animation: countPulse 0.3s ease-out;
}

@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------------
   도넛 차트 배치 (Progress Donut)
   SVG 기반 도넛 차트의 위치 설정
   ------------------------------------------------------------------ */
.donut-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.donut-container svg {
  transform: rotate(-90deg);
}

/* 도넛 중앙 텍스트 */
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .donut-value {
  font-family: var(--wyd-font-heading);
  font-size: var(--wyd-fs-2xl);
  font-weight: var(--wyd-fw-bold);
  color: var(--wyd-text);
  line-height: 1;
}

.donut-center .donut-label {
  font-size: var(--wyd-fs-xs);
  color: var(--wyd-text-secondary);
  margin-top: 2px;
}

/* 도넛 그리드 (여러 도넛 나란히) */
.donut-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--wyd-space-lg);
  padding: var(--wyd-space-md);
}

/* ------------------------------------------------------------------
   인용문 영역 (Quote Area)
   교황 말씀, 성경 구절 등 인용 스타일
   ------------------------------------------------------------------ */
.quote-area {
  position: relative;
  background: linear-gradient(135deg,
    rgba(var(--wyd-primary-rgb), 0.04) 0%,
    rgba(var(--wyd-accent-rgb), 0.04) 100%
  );
  border-left: 4px solid var(--wyd-accent);
  border-radius: 0 var(--wyd-radius-lg) var(--wyd-radius-lg) 0;
  padding: var(--wyd-space-xl) var(--wyd-space-2xl);
  margin: var(--wyd-space-xl) 0;
}

.quote-area .quote-mark {
  position: absolute;
  top: var(--wyd-space-md);
  left: var(--wyd-space-lg);
  font-size: var(--wyd-fs-4xl);
  color: var(--wyd-accent);
  opacity: 0.3;
  font-family: Georgia, serif;
  line-height: 1;
}

/* ------------------------------------------------------------------
   봉헌 현황 테이블 개선
   ------------------------------------------------------------------ */
/* 행간격 넓히기 */
.table td, .table th {
  padding: 12px 16px;
  vertical-align: middle;
}

/* 테이블 너비 유틸리티 */
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-70 { width: 70%; }

/* 봉헌 단수 컬럼 우측 정렬 + 고정 폭 */
.table td:last-child,
.table th:last-child {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .table td:last-child {
    text-align: right;
    white-space: nowrap;
    padding-left: 12px;
  }
  .table th:last-child {
    text-align: center;
  }
  .table td:first-child {
    word-break: keep-all;
  }
}

/* 첫 번째 컬럼 (교구/본당명) 약간 넓게 */
.table td:first-child,
.table th:first-child {
  font-weight: 500;
}

/* 짝수 행 배경 (Bootstrap striped 보완) */
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: #f8f9fa;
}

/* 합계 행 강조 */
.table .table-secondary td {
  font-weight: 700;
  font-size: 1.05rem;
}

/* 카드 안의 테이블 모서리 */
.card .table {
  margin-bottom: 0;
}
.card .table thead th {
  border-top: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quote-area .quote-text {
  font-size: var(--wyd-fs-lg);
  font-style: italic;
  color: var(--wyd-text);
  line-height: var(--wyd-lh-relaxed);
  margin-bottom: var(--wyd-space-md);
}

.quote-area .quote-author {
  font-size: var(--wyd-fs-sm);
  color: var(--wyd-text-secondary);
  font-weight: var(--wyd-fw-semibold);
  font-style: normal;
}

.quote-area .quote-source {
  font-size: var(--wyd-fs-xs);
  color: var(--wyd-text-muted);
  margin-top: var(--wyd-space-xs);
}

/* ------------------------------------------------------------------
   대시보드 레이아웃 헬퍼
   ------------------------------------------------------------------ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--wyd-space-lg);
}

.dashboard-section {
  margin-bottom: var(--wyd-space-xl);
}

.dashboard-section-title {
  font-family: var(--wyd-font-heading);
  font-size: var(--wyd-fs-lg);
  font-weight: var(--wyd-fw-semibold);
  color: var(--wyd-text);
  margin-bottom: var(--wyd-space-md);
  display: flex;
  align-items: center;
  gap: var(--wyd-space-sm);
}

/* ------------------------------------------------------------------
   반응형: 태블릿
   ------------------------------------------------------------------ */
@media (max-width: 1023.98px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .countBlock {
    gap: var(--wyd-space-lg);
  }

  .countBlock .count-number {
    font-size: var(--wyd-fs-3xl);
  }
}

/* ------------------------------------------------------------------
   반응형: 모바일
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-card .stat-number {
    font-size: var(--wyd-fs-2xl);
  }

  .circles {
    gap: var(--wyd-space-md);
  }

  .circles .circle-chart {
    width: 90px;
    height: 90px;
  }

  .countBlock .count-item {
    min-width: 120px;
  }

  .countBlock .count-number {
    font-size: var(--wyd-fs-2xl);
  }

  .quote-area {
    padding: var(--wyd-space-md) var(--wyd-space-lg);
  }

  .quote-area .quote-text {
    font-size: var(--wyd-fs-base);
  }
}

/* ==================================================================
   작업중 페이지 (.wip-*)
   ================================================================== */
.wip-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: var(--wyd-space-2xl) var(--wyd-space-md);
}
.wip-icon {
    font-size: 5rem;
    color: var(--wyd-primary);
    margin-bottom: var(--wyd-space-lg);
    animation: wip-pulse 2s ease-in-out infinite;
}
@keyframes wip-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}
.wip-title {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--wyd-text);
    margin-bottom: var(--wyd-space-sm);
}
.wip-desc {
    font-size: 1rem;
    color: var(--wyd-text-secondary);
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: var(--wyd-space-xl);
}
.wip-btn {
    display: inline-block;
    padding: var(--wyd-space-sm) var(--wyd-space-xl);
    background: var(--wyd-primary);
    color: var(--wyd-text-inverse);
    border-radius: var(--wyd-radius-full);
    text-decoration: none;
    font-weight: 600;
    transition: background var(--wyd-transition-base), transform var(--wyd-transition-base);
}
.wip-btn:hover {
    background: var(--wyd-primary-dark);
    transform: translateY(-2px);
    color: var(--wyd-text-inverse);
}
