/* ===================================
   N-Care 2.0 — PRESENTATION MODE
   Full-Page Scroll + Slide Navigation
   =================================== */

/* ===================================
   1. FULL-PAGE SCROLL SNAP
   =================================== */
html.presentation-mode {
    overflow: hidden;
    height: 100vh;
}

html.presentation-mode body {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Each section becomes a slide */
html.presentation-mode .section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding-top: 64px; /* navbar height */
    box-sizing: border-box;
}

/* Sections with naturally tall content: allow internal scroll */
html.presentation-mode .section.slide-overflow {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Inner scroll indicator for overflow sections */
html.presentation-mode .section.slide-overflow::after {
    content: '↓ 스크롤';
    position: sticky;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-block;
    padding: 4px 12px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #0ea5e9;
    z-index: 5;
    pointer-events: none;
    opacity: 0.7;
    animation: scrollHintPulse 2s ease-in-out infinite;
    width: fit-content;
    text-align: center;
    margin: 0 auto;
}

@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.9; transform: translateX(-50%) translateY(-3px); }
}

/* Scrollbar for overflow sections */
html.presentation-mode .section.slide-overflow::-webkit-scrollbar {
    width: 4px;
}
html.presentation-mode .section.slide-overflow::-webkit-scrollbar-track {
    background: transparent;
}
html.presentation-mode .section.slide-overflow::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 4px;
}
html.presentation-mode .section.slide-overflow::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.5);
}

/* Scale content to fit in large sections */
html.presentation-mode .section > .container {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
}

html.presentation-mode .section-header {
    margin-bottom: 2rem;
}

/* Footer hidden in presentation */
html.presentation-mode .footer {
    display: none;
}

/* Scroll-top button hidden in presentation */
html.presentation-mode .scroll-top {
    display: none !important;
}

/* ===================================
   2. DOT INDICATOR (Right Side)
   =================================== */
.slide-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: none;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

html.presentation-mode .slide-dots {
    display: flex;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.15);
    border: 1.5px solid rgba(14, 165, 233, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.slide-dot:hover {
    background: rgba(14, 165, 233, 0.35);
    border-color: rgba(14, 165, 233, 0.5);
    transform: scale(1.3);
}

.slide-dot.active {
    width: 12px;
    height: 12px;
    background: #0ea5e9;
    border-color: #0ea5e9;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

/* Tooltip on hover */
.slide-dot::before {
    content: attr(data-label);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, right 0.2s;
    backdrop-filter: blur(8px);
}

.slide-dot:hover::before {
    opacity: 1;
    right: 28px;
}

/* ===================================
   3. PAGE NUMBER INDICATOR
   =================================== */
.slide-page-info {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1001;
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.12);
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    font-family: var(--font-display);
    transition: all 0.3s;
}

html.presentation-mode .slide-page-info {
    display: flex;
}

.slide-page-current {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0ea5e9;
}

.slide-page-separator {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 400;
}

.slide-page-total {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.slide-page-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    margin-left: 4px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================================
   4. KEYBOARD HINT OVERLAY
   =================================== */
.slide-keyboard-hint {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 1001;
    display: none;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.12);
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    font-size: 0.72rem;
    color: #64748b;
    opacity: 1;
    transition: opacity 0.5s;
}

html.presentation-mode .slide-keyboard-hint {
    display: flex;
}

.slide-keyboard-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.kbd-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===================================
   5. PRESENTATION TOGGLE BUTTON
   =================================== */
.presentation-toggle {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 1002;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

.presentation-toggle:hover {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
    transform: scale(1.05);
}

.presentation-toggle .fa-expand {
    display: inline;
}
.presentation-toggle .fa-compress {
    display: none;
}
html.presentation-mode .presentation-toggle .fa-expand {
    display: none;
}
html.presentation-mode .presentation-toggle .fa-compress {
    display: inline;
}

/* ===================================
   6. SLIDE TRANSITION ANIMATION
   =================================== */
html.presentation-mode .section .container > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

html.presentation-mode .section.slide-visible .container > * {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for children */
html.presentation-mode .section.slide-visible .container > *:nth-child(1) { transition-delay: 0.05s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(2) { transition-delay: 0.12s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(3) { transition-delay: 0.19s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(4) { transition-delay: 0.26s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(5) { transition-delay: 0.33s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(6) { transition-delay: 0.40s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(7) { transition-delay: 0.47s; }
html.presentation-mode .section.slide-visible .container > *:nth-child(8) { transition-delay: 0.54s; }

/* Cover section - direct children animated */
html.presentation-mode .cover-section .cover-content > *,
html.presentation-mode .cover-section .cover-stats {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

html.presentation-mode .cover-section.slide-visible .cover-content > *,
html.presentation-mode .cover-section.slide-visible .cover-stats {
    opacity: 1;
    transform: translateY(0);
}

html.presentation-mode .cover-section.slide-visible .cover-content > *:nth-child(1) { transition-delay: 0.1s; }
html.presentation-mode .cover-section.slide-visible .cover-content > *:nth-child(2) { transition-delay: 0.25s; }
html.presentation-mode .cover-section.slide-visible .cover-content > *:nth-child(3) { transition-delay: 0.4s; }
html.presentation-mode .cover-section.slide-visible .cover-content > *:nth-child(4) { transition-delay: 0.55s; }
html.presentation-mode .cover-section.slide-visible .cover-content > *:nth-child(5) { transition-delay: 0.7s; }
html.presentation-mode .cover-section.slide-visible .cover-stats { transition-delay: 0.85s; }

/* ===================================
   7. PROGRESS BAR UPDATE
   =================================== */
html.presentation-mode .progress-bar {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   8. NAVIGATION BAR IN PRESENTATION
   =================================== */
html.presentation-mode .navbar {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* ===================================
   9. RESPONSIVE ADJUSTMENTS
   =================================== */
@media (max-width: 1024px) {
    .slide-dots {
        right: 12px;
        gap: 6px;
    }
    .slide-dot {
        width: 8px;
        height: 8px;
    }
    .slide-dot.active {
        width: 10px;
        height: 10px;
    }
    .slide-dot::before {
        display: none;
    }
    .slide-page-label {
        display: none;
    }
}

@media (max-width: 640px) {
    .slide-dots {
        right: 8px;
    }
    .slide-keyboard-hint {
        display: none !important;
    }
    .slide-page-info {
        bottom: 16px;
        right: 16px;
        padding: 6px 12px;
    }
    .presentation-toggle {
        top: 14px;
        right: 60px;
        width: 36px;
        height: 36px;
    }
}
