﻿/* 슬라이브 디자인 토큰 + 공용 스타일 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
    --primary: #2563EB;
    --deep: #15307A;
    --ink: #141B33;
    --bg: #F2F6FE;
    --soft: #E2ECFD;
    --line: #D4E1F7;
    --live: #FF4D4D;
    --success: #22A35B;
    --success-bg: #EAF7EF;
    --warn: #F59E0B;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

button { font-family: inherit; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 스크롤바 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(20,27,51,.15); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* 카드 */
.card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 16px rgba(20,33,58,.07);
}

/* 버튼 기본 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform .08s, filter .12s;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-deep    { background: var(--deep); color: #fff; }
.btn-ghost   { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-soft    { background: var(--soft); color: var(--deep); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-lg { height: 52px; font-size: 16px; }

/* LIVE 배지 */
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success-bg);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 800;
    color: #0E7A3D;
    letter-spacing: .03em;
}
.badge-live::before {
    content: '';
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
}

/* 진행바 */
.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--soft);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width .12s ease;
}

/* 입력 */
.input {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 0 13px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color .12s;
}
.input:focus { border-color: var(--primary); }

/* 성공 배너 */
.banner-success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--success-bg);
    border-radius: 11px;
    padding: 12px 16px;
    color: #0E7A3D;
    font-size: 14px;
    font-weight: 700;
}

/* 사이트 헤더 */
.site-header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    flex-shrink: 0;
}

/* 드롭존 */
.dropzone {
    border-radius: 18px;
    border: 2px dashed var(--line);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all .15s;
    min-height: 300px;
    text-align: center;
    padding: 40px;
}
.dropzone.drag-over {
    border-color: var(--primary);
    background: var(--soft);
}

/* 슬라이드 뷰어 */
.slide-wrap {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 16px rgba(20,33,58,.08);
}
.slide-wrap img { display: block; width: 100%; height: auto; user-select: none; }
.slide-wrap svg.annotations {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 도구 막대 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 14px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.toolbar-sep {
    width: 1px;
    height: 28px;
    background: var(--line);
}
.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #5B6472;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
}
.tool-btn:hover { background: var(--soft); }
.tool-btn.active { background: var(--primary); color: #fff; }

/* 팔레트 색상 버튼 */
.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
    cursor: pointer;
    transition: transform .1s;
}
.color-dot.active {
    border-color: var(--ink);
    transform: scale(1.12);
}

/* 썸네일 레일 */
.thumb-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
}
.thumb-btn {
    flex-shrink: 0;
    width: 96px;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
    position: relative;
}
.thumb-btn.active { border: 2.5px solid var(--primary); }
.thumb-btn img { display: block; width: 100%; height: auto; }
.thumb-page-num {
    position: absolute;
    bottom: 3px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,.5);
    border-radius: 4px;
    padding: 0 4px;
}

/* 네비 버튼 */
.nav-btn {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--deep);
    cursor: pointer;
    flex-shrink: 0;
}
.nav-btn:disabled { color: #CBD5E1; cursor: default; }

/* QR 박스 */
.qr-box {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: inline-block;
}
.qr-box img { display: block; }

/* 링크 복사 줄 */
.link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-radius: 10px;
    padding: 10px 14px;
}
.link-row span {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--deep);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 투표 모달 */
.poll-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,27,51,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(3px);
}
.poll-modal {
    width: 480px;
    max-width: 96vw;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(20,33,58,.28);
    padding: 28px;
}

/* 투표 패널 (발표자 슬라이드 위) */
.poll-panel {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 300px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(20,33,58,.24);
    border: 1px solid var(--line);
    padding: 16px;
    z-index: 20;
}

/* 투표 카드 (청중 하단 시트) */
.poll-card {
    background: #fff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 30px rgba(20,33,58,.16);
    border-top: 1px solid var(--line);
    padding: 18px 18px 22px;
}

/* 결과 막대 */
.result-bar-track {
    height: 11px;
    border-radius: 999px;
    background: var(--soft);
    overflow: hidden;
    margin-top: 5px;
}
.result-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .5s cubic-bezier(.22,1,.36,1);
}

/* 미니 토글 */
.mini-toggle {
    width: 36px;
    height: 21px;
    border-radius: 11px;
    position: relative;
    transition: background .18s;
    display: inline-block;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
}
.mini-toggle-knob {
    position: absolute;
    top: 2.5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: left .18s;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* 모바일 청중 화면 */
.audience-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 18px 12px;
}

/* 그리드 미리보기 */
.grid-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px 16px;
    overflow-y: auto;
}
.grid-thumb {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    position: relative;
}
.grid-thumb.current { border: 2px solid var(--primary); }
.grid-thumb img { display: block; width: 100%; height: auto; }

/* 알림톡 카드 */
.alimtalk-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(20,33,58,.16);
    max-width: 320px;
}
.alimtalk-header {
    background: #FEE500;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 청중 수 뱃지 */
.audience-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--success-bg);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 13px;
    font-weight: 700;
    color: #0E7A3D;
}

/* 청중 전체화면 모드 */
:fullscreen #audienceHeader,
:-webkit-full-screen #audienceHeader,
:fullscreen #statusBar,
:-webkit-full-screen #statusBar,
:fullscreen #bottomBar,
:-webkit-full-screen #bottomBar { display: none !important; }

:fullscreen #slideContainer,
:-webkit-full-screen #slideContainer { padding: 0; background: #000; }

:fullscreen #fsOverlayBtn,
:-webkit-full-screen #fsOverlayBtn { display: flex !important; }

/* 반응형 */
@media (max-width: 768px) {
    .site-header { padding: 0 16px; }
    .poll-modal { width: 96vw; padding: 20px; }
}
