/**
 * TRIGGER BLACK — Cybernetic UI overlay
 * 되돌리기: index/study/analysis.html 에서 이 파일 link 한 줄 제거
 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;800&family=Share+Tech+Mono&display=swap');

:root {
    --cyber-radius: 4px;
    --cyber-radius-md: 6px;
    --cyber-radius-lg: 8px;
    --font-display: 'Orbitron', 'Pretendard', sans-serif;
    --font-mono: 'Share Tech Mono', 'Pretendard', monospace;
    --cyber-grid: rgba(0, 243, 255, 0.04);
    --cyber-scan: rgba(0, 243, 255, 0.025);
}

/* ── 배경: 그리드 + 스캔라인 ── */
body.dashboard-bg,
body.study-bg,
body.analysis-page {
    position: relative;
    background-color: var(--bg-color, #050505) !important;
}

body.dashboard-bg::before,
body.study-bg::before,
body.analysis-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--cyber-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--cyber-grid) 1px, transparent 1px);
    background-size: 28px 28px;
}

body.dashboard-bg::after,
body.study-bg::after,
body.analysis-page::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--cyber-scan) 2px,
        var(--cyber-scan) 4px
    );
    opacity: 0.6;
}

.dashboard-container,
#app,
.analysis-page > .dashboard-container {
    position: relative;
    z-index: 2;
}

/* ── 디스플레이 타이포 ── */
.logo,
.login-title,
.brand-tab-module,
.module-grammar-badge,
.module-grammar-title,
#session-tag,
.stat-label,
.nav-item > span:last-child,
.cyber-label,
.cyber-splash-boot,
.cyber-splash-line {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
}

.stat-value,
.info-count,
.day-label {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

/* ── HUD 카드 (코너 브래킷) ── */
.card,
.login-card,
.info-card,
.module-scan-card,
.module-grammar-card,
#praise-popup-inner,
#share-result-popup-inner,
.stats-row,
.routine-scroll-box {
    border-radius: var(--cyber-radius-lg) !important;
    position: relative;
    background-image: linear-gradient(135deg, rgba(0, 243, 255, 0.02) 0%, transparent 50%) !important;
}

.card::before,
.login-card::before,
.info-card::before,
.stats-row::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--neon-blue, #00f3ff);
    border-left: 2px solid var(--neon-blue, #00f3ff);
    opacity: 0.55;
    pointer-events: none;
}

.card::after,
.login-card::after,
.info-card::after,
.stats-row::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--neon-blue, #00f3ff);
    border-right: 2px solid var(--neon-blue, #00f3ff);
    opacity: 0.55;
    pointer-events: none;
}

.module-scan-card::before { border-color: var(--neon-orange, #ff9900); }
.module-scan-card::after { border-color: var(--neon-orange, #ff9900); }
.module-grammar-card::before { border-color: var(--neon-purple, #bc13fe); }
.module-grammar-card::after { border-color: var(--neon-purple, #bc13fe); }

/* ── 버튼·입력: 각진 HUD ── */
.neon-input,
.login-btn,
.start-btn,
.level-btn,
.routine-action-btn,
.choice-btn,
.praise-copy-btn,
.module-grammar-btn {
    border-radius: var(--cyber-radius-md) !important;
}

.level-btn.active,
.routine-action-btn.active {
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.25), inset 0 0 12px rgba(0, 243, 255, 0.05) !important;
}

/* ── 하단 네비 ── */
.bottom-nav {
    border-top-left-radius: var(--cyber-radius-lg) !important;
    border-top-right-radius: var(--cyber-radius-lg) !important;
    border-top: 1px solid rgba(0, 243, 255, 0.25) !important;
    background: rgba(5, 5, 5, 0.92) !important;
    box-shadow: 0 -4px 24px rgba(0, 243, 255, 0.06);
}

.nav-item > span:last-child {
    font-size: 0.68rem;
    text-transform: uppercase;
}

/* CSS 글리프 아이콘 (이모지 대체) */
.nav-icon-glyph {
    width: 22px;
    height: 22px;
    display: block;
    position: relative;
    font-size: 0 !important;
    line-height: 0;
}

.nav-icon--voca {
    border: 1.5px solid currentColor;
    border-radius: 2px;
    box-shadow: 0 0 8px currentColor;
}

.nav-icon--voca::after {
    content: '';
    position: absolute;
    left: 3px;
    right: 3px;
    top: 50%;
    height: 1.5px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
    transform: translateY(-50%);
    opacity: 0.85;
}

.nav-icon--scan {
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.nav-icon--scan::before,
.nav-icon--scan::after {
    content: '';
    position: absolute;
    background: currentColor;
    opacity: 0.9;
}

.nav-icon--scan::before {
    width: 1.5px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.nav-icon--scan::after {
    height: 1.5px;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
}

.nav-icon--grammar {
    width: 0;
    height: 0;
    border: none;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 20px solid currentColor;
    filter: drop-shadow(0 0 6px currentColor);
    top: 1px;
}

/* ── 에너지 / 프로그레스 ── */
.energy-slot,
.energy-slot-vert {
    border-radius: 2px !important;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
}

.energy-slot.active,
.energy-slot-vert.active {
    animation: cyberPulse 1.8s ease-in-out infinite;
}

.progress-box,
.report-bar-bg {
    border-radius: 2px !important;
    border: 1px solid rgba(0, 243, 255, 0.15);
}

#bar,
.report-bar-fill {
    border-radius: 1px !important;
}

@keyframes cyberPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; filter: brightness(1.15); }
}

@keyframes cyberBoot {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes cyberScanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* ── 스플래시 ── */
body.splash-active .dashboard-container,
body.splash-active .bottom-nav,
body.splash-active .main-tab-swipe-hint {
    visibility: hidden;
}

#splash-screen.cyber-splash {
    background: #000 !important;
    overflow: hidden;
}

#splash-screen.cyber-splash::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue, #00f3ff), transparent);
    animation: cyberScanLine 2.2s linear infinite;
    opacity: 0.35;
    pointer-events: none;
}

.cyber-splash-logo {
    border-radius: var(--cyber-radius-md) !important;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.35), 0 0 80px rgba(0, 243, 255, 0.12);
    animation: cyberBoot 0.6s ease-out;
}

.cyber-splash-boot {
    margin-top: 28px;
    text-align: center;
    color: var(--neon-blue, #00f3ff);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.5);
    animation: cyberBoot 0.8s ease-out 0.2s both;
}

.cyber-splash-line {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #fff;
    letter-spacing: 0.15em;
}

/* ── 학습 화면 ── */
.study-bg .back-btn {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: var(--neon-blue, #00f3ff) !important;
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 6px 10px;
    border-radius: var(--cyber-radius);
}

#target:not(.system-msg) {
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}

.charge-label {
    font-family: var(--font-mono) !important;
    color: var(--neon-blue, #00f3ff) !important;
    letter-spacing: 0.15em !important;
    font-size: 0.62rem !important;
}

/* ── 카톡 버튼: 노란색 유지 + HUD 프레임 ── */
#btn-study-kakao-share,
.kakao-btn,
#btn-admin-kakao-complete {
    border: 1px solid rgba(254, 229, 0, 0.6) !important;
    box-shadow: 0 0 14px rgba(254, 229, 0, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.15) !important;
    border-radius: var(--cyber-radius-md) !important;
    font-family: var(--font-display) !important;
    letter-spacing: 0.04em !important;
}

/* ── 칭찬 팝업 ── */
#praise-emoji,
#share-result-emoji {
    font-size: 3rem !important;
    filter: drop-shadow(0 0 12px var(--neon-green, #39ff14));
}

#praise-main-title {
    font-family: var(--font-display) !important;
    letter-spacing: 0.05em !important;
}

@keyframes cyberBadgeGlow {
    0% { transform: translateY(0); text-shadow: 0 0 10px var(--neon-green, #39ff14); }
    100% { transform: translateY(-8px); text-shadow: 0 0 22px var(--neon-green, #39ff14), 0 0 36px rgba(0, 243, 255, 0.4); }
}

#praise-emoji {
    animation: cyberBadgeGlow 0.9s infinite alternate !important;
}

/* ── 가이드 모달 확인 버튼 (흰색 → HUD) ── */
#guide-modal .login-btn[style*="background: #fff"],
#guide-modal button.login-btn {
    background: transparent !important;
    color: var(--neon-blue, #00f3ff) !important;
    border-color: var(--neon-blue, #00f3ff) !important;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.2) !important;
    font-family: var(--font-display) !important;
}

/* ── 메인 대시보드: 코너 브래킷 제거 (모달 login-card 제외) ── */
body.dashboard-bg .dashboard-container .card::before,
body.dashboard-bg .dashboard-container .card::after,
body.dashboard-bg .dashboard-container .info-card::before,
body.dashboard-bg .dashboard-container .info-card::after,
body.dashboard-bg .dashboard-container .stats-row::before,
body.dashboard-bg .dashboard-container .stats-row::after,
body.dashboard-bg .dashboard-container .module-scan-card::before,
body.dashboard-bg .dashboard-container .module-scan-card::after,
body.dashboard-bg .dashboard-container .module-grammar-card::before,
body.dashboard-bg .dashboard-container .module-grammar-card::after,
body.dashboard-bg .dashboard-container .routine-scroll-box::before,
body.dashboard-bg .dashboard-container .routine-scroll-box::after {
    display: none !important;
}

/* ── 메인: 별빛 (레이어 + 개별 별) ── */
body.dashboard-bg .cyber-stars {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

body.dashboard-bg .cyber-star {
    position: absolute;
    width: 3px;
    height: 3px;
    margin: -1.5px 0 0 -1.5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.35), 0 0 8px rgba(0, 243, 255, 0.2);
    animation: cyberStarBlink ease-in-out infinite;
    opacity: 0.22;
}

body.dashboard-bg .cyber-star:nth-child(3n) {
    background: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.4), 0 0 10px rgba(0, 243, 255, 0.18);
}

body.dashboard-bg .cyber-star:nth-child(5n) {
    background: rgba(200, 160, 255, 0.45);
    box-shadow: 0 0 4px rgba(188, 19, 254, 0.35), 0 0 8px rgba(188, 19, 254, 0.15);
    width: 2px;
    height: 2px;
    margin: -1px 0 0 -1px;
}

@keyframes cyberStarBlink {
    0%, 100% { opacity: 0.08; transform: scale(0.65); }
    45% { opacity: 0.5; transform: scale(1.1); }
    55% { opacity: 0.4; transform: scale(1); }
}

/* ── 메인: 좌우 스와이프 힌트 화살표 ── */
.main-tab-swipe-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 80px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(0, 243, 255, 0.4);
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 0 14px rgba(0, 243, 255, 0.35);
    transition: color 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.main-tab-swipe-hint--prev { left: 2px; }
.main-tab-swipe-hint--next { right: 2px; }

.main-tab-swipe-hint:hover,
.main-tab-swipe-hint:focus-visible {
    color: rgba(0, 243, 255, 0.65);
    outline: none;
}

.main-tab-swipe-hint.is-hidden {
    opacity: 0;
    pointer-events: none;
}

body.dashboard-bg.praise-receiver-flow .main-tab-swipe-hint {
    opacity: 0;
    pointer-events: none;
}

/* ── 메인: 탭 슬라이드 트랙 ── */
body.dashboard-bg .dashboard-container,
body.dashboard-bg .main-tab-viewport {
    touch-action: pan-y;
}

body.dashboard-bg .main-tab-viewport {
    overflow: hidden;
    width: 100%;
}

body.dashboard-bg .main-tab-track {
    display: flex;
    align-items: flex-start;
    width: 300%;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

body.dashboard-bg .main-tab-track.no-transition {
    transition: none !important;
}

body.dashboard-bg .main-tab-track .tab-content {
    display: block !important;
    flex: 0 0 33.333333%;
    width: 33.333333%;
    box-sizing: border-box;
    min-width: 0;
}

body.dashboard-bg .main-tab-track .tab-content:not(.active) {
    height: 0 !important;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

body.dashboard-bg .main-tab-track.is-sliding .tab-content:not(.active) {
    height: auto !important;
    overflow: visible;
    visibility: visible;
    pointer-events: none;
}
