/* ============================================================
   11-admin-dashboard.css — 극적인 사이버펑크 통계 관제탑
   ============================================================ */

:root {
    --dash-backdrop: rgba(10, 10, 12, 0.85);
    --dash-bg: rgba(18, 18, 24, 0.7);
    --dash-border: rgba(34, 211, 238, 0.2);
    --dash-card-bg: rgba(255, 255, 255, 0.02);
    --dash-card-border: rgba(255, 255, 255, 0.05);
    --dash-text-1: #ffffff;
    --dash-text-2: rgba(255, 255, 255, 0.5);
    --dash-close-focus: rgba(255, 255, 255, 0.5);
    --dash-close-hover: #ffffff;
}

[data-theme="light"] {
    --dash-backdrop: rgba(255, 255, 255, 0.85);
    --dash-bg: rgba(248, 250, 252, 0.95);
    --dash-border: rgba(0, 0, 0, 0.1);
    --dash-card-bg: #ffffff;
    --dash-card-border: rgba(0, 0, 0, 0.08);
    --dash-text-1: #0f172a;
    --dash-text-2: #64748b;
    --dash-close-focus: rgba(0, 0, 0, 0.5);
    --dash-close-hover: #0f172a;
}

.admin-dashboard-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--dash-backdrop);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-primary, 'SUIT', sans-serif);
}

.admin-dashboard-overlay.open {
    opacity: 1;
}

.admin-dash-window {
    width: 85%;
    max-width: 1200px;
    height: 80vh;
    max-height: 800px;
    background: var(--dash-bg);
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);

    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-dashboard-overlay.open .admin-dash-window {
    transform: scale(1) translateY(0);
}

/* Header */
.admin-dash-header {
    padding: 20px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.05) 0%, transparent 50%);
}

.admin-dash-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-dash-title-icon {
    font-size: 24px;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}

.admin-dash-title-text h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dash-text-1);
    letter-spacing: 0.05em;
}

.admin-dash-title-text p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: var(--dash-text-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.admin-dash-close {
    background: none;
    border: none;
    color: var(--dash-close-focus);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.admin-dash-close:hover {
    color: var(--dash-close-hover);
    transform: scale(1.1) rotate(90deg);
}

/* Grid Layout */
.admin-dash-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 24px 32px;
    overflow-y: auto;
}

/* Global Pulse (Top spanning full width) */
.admin-dash-pulse {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.admin-dash-card {
    background: var(--dash-card-bg);
    border: 1px solid var(--dash-card-border);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 220px; /* add */
}

.admin-dash-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--card-glow, #22d3ee), transparent);
    opacity: 0.5;
}

/* KPI Numbers */
.admin-dash-kpi {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.admin-dash-kpi-label {
    font-size: 0.8rem;
    color: var(--dash-text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-dash-kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Inter', monospace; /* Number style */
    color: var(--dash-text-1);
    line-height: 1;
}

[data-theme="dark"] .admin-dash-kpi-value {
    text-shadow: 0 0 20px var(--card-glow, #22d3ee);
}

.admin-dash-kpi-trend {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chart Containers */
.admin-dash-chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.admin-dash-chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dash-text-1);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-dash-chart-title::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--card-glow, #22d3ee);
    box-shadow: 0 0 10px var(--card-glow, #22d3ee);
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 100%; /* 트 높이 잘림 방지 */
}

/* Animations */
@keyframes pulseBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

.live-indicator {
    display: inline-block;
    width: 6px; height: 6px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: pulseBlink 1.5s infinite;
}

/* add 확장 모듈 스타일 */
.admin-dash-list {
    list-style: none; padding: 0; margin: 0;
}
.admin-dash-list li {
    display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--dash-border);
    font-size: 0.85rem; color: var(--dash-text-2);
}
.admin-dash-list li:last-child { border-bottom: none; }
.admin-dash-list-val { color: var(--dash-text-1); font-weight: 600; font-family: 'Inter', monospace; }

.admin-dash-pulse-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Scrollbar */
.admin-dash-grid::-webkit-scrollbar { width: 6px; }
.admin-dash-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.admin-dash-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.admin-dash-grid::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

@media (max-width: 1024px) {
    .admin-dash-pulse-wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .admin-dash-window { width: 95%; height: 90vh; }
    .admin-dash-pulse { grid-template-columns: 1fr; }
    .admin-dash-pulse-wide { grid-template-columns: 1fr; }
    .admin-dash-grid { grid-template-columns: 1fr; }
}
