/* 투표 페이지 컨테이너 */
.poll-page { max-width: 960px; margin: 0 auto; padding: 20px; }

/* 통계 바 */
.poll-stats-bar { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.poll-stat-item { flex: 1; min-width: 120px; background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); text-align: center; }
.poll-stat-item .stat-num { font-size: 1.5rem; font-weight: 700; color: #667eea; }
.poll-stat-item .stat-label { font-size: 0.8rem; color: #888; margin-top: 4px; }

/* 하이라이트 카드 */
.poll-highlight { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 16px; padding: 28px; margin-bottom: 24px; color: #fff; position: relative; overflow: hidden; }
.poll-highlight::before { content: ''; position: absolute; top: -50%; right: -30%; width: 300px; height: 300px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.poll-highlight .hl-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; background: rgba(255,255,255,0.2); border-radius: 20px; font-size: 0.78rem; font-weight: 600; margin-bottom: 12px; }
.poll-highlight .hl-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 8px; line-height: 1.4; }
.poll-highlight .hl-desc { font-size: 0.9rem; opacity: 0.85; margin: 0 0 16px; line-height: 1.5; }
.poll-highlight .hl-bar-wrap { margin-bottom: 8px; }
.poll-highlight .hl-bar-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 3px; }
.poll-highlight .hl-bar-bg { height: 8px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; }
.poll-highlight .hl-bar-fill { height: 100%; background: rgba(255,255,255,0.8); border-radius: 4px; transition: width 0.6s; }
.poll-highlight .hl-meta { display: flex; align-items: center; gap: 16px; margin-top: 16px; font-size: 0.85rem; opacity: 0.9; }
.poll-highlight .hl-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 24px; background: #fff; color: #667eea; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-left: auto; transition: transform 0.2s; border: none; cursor: pointer; }
.poll-highlight .hl-btn:hover { transform: translateY(-1px); }

/* 탭 네비게이션 */
.poll-tabs { display: flex; gap: 0; margin-bottom: 24px; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.poll-tab { flex: 1; padding: 14px 16px; text-align: center; font-weight: 600; color: #888; cursor: pointer; border: none; background: transparent; font-size: 0.95rem; transition: all 0.2s; border-bottom: 3px solid transparent; }
.poll-tab:hover { color: #667eea; background: #f8f9ff; }
.poll-tab.active { color: #667eea; border-bottom-color: #667eea; background: #f8f9ff; }
.poll-tab i { margin-right: 6px; }

/* 탭 패널 */
.poll-panel { display: none; }
.poll-panel.active { display: block; }

/* 카테고리 필터 */
.poll-cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.poll-cat-btn { padding: 6px 16px; background: #f1f3f5; border-radius: 20px; border: none; color: #555; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.poll-cat-btn:hover { background: #e2e6ea; }
.poll-cat-btn.active { background: #667eea; color: #fff; }

/* 투표 카드 */
.poll-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 14px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.poll-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.poll-card .card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.poll-card .cat-badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 10px; font-size: 0.72rem; font-weight: 600; color: #fff; }
.poll-card .type-badge { padding: 3px 8px; border-radius: 8px; font-size: 0.72rem; font-weight: 500; background: #f1f3f5; color: #555; }
.poll-card .card-remain { font-size: 0.75rem; color: #10b981; margin-left: auto; font-weight: 500; }
.poll-card .card-title { font-size: 1.05rem; font-weight: 600; color: #333; margin-bottom: 6px; line-height: 1.4; }
.poll-card .card-desc { font-size: 0.85rem; color: #888; margin-bottom: 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poll-card .card-bottom { display: flex; align-items: center; gap: 14px; font-size: 0.8rem; color: #999; }
.poll-card .card-bottom i { margin-right: 3px; }
.poll-card .voted-badge { color: #667eea; font-weight: 600; }

/* 빈 상태 */
.poll-empty { text-align: center; padding: 60px 20px; background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.poll-empty i { font-size: 3rem; color: #ddd; margin-bottom: 12px; display: block; }
.poll-empty p { color: #999; margin: 0 0 16px; font-size: 0.95rem; }
.poll-empty a { color: #667eea; text-decoration: none; font-weight: 500; }

/* 생성 폼 */
.poll-form-card { background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.poll-form-card h3 { font-size: 1.15rem; font-weight: 700; color: #333; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 2px solid #667eea; }
.pf-group { margin-bottom: 18px; }
.pf-group label { display: block; font-size: 0.88rem; font-weight: 600; color: #555; margin-bottom: 6px; }
.pf-group input[type="text"],
.pf-group input[type="date"],
.pf-group input[type="number"],
.pf-group textarea,
.pf-group select { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; box-sizing: border-box; transition: border-color 0.2s; }
.pf-group input:focus, .pf-group textarea:focus, .pf-group select:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.pf-group textarea { resize: vertical; min-height: 80px; }
.pf-row { display: flex; gap: 14px; flex-wrap: wrap; }
.pf-row .pf-group { flex: 1; min-width: 180px; }
.pf-option-list { margin-top: 8px; }
.pf-option-item { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.pf-option-item input { flex: 1; }
.pf-option-item .pf-opt-remove { width: 36px; height: 36px; border: none; background: #fee2e2; color: #ef4444; border-radius: 8px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.pf-option-item .pf-opt-remove:hover { background: #fecaca; }
.pf-opt-add { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #f0f4ff; color: #667eea; border: 1px dashed #667eea; border-radius: 8px; cursor: pointer; font-size: 0.88rem; font-weight: 500; transition: background 0.2s; }
.pf-opt-add:hover { background: #e0e7ff; }
.pf-toggle { display: flex; align-items: center; gap: 10px; }
.pf-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: #667eea; }
.pf-submit { width: 100%; padding: 14px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: transform 0.2s; }
.pf-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.3); }
.pf-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* 모달 */
.poll-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9999; justify-content: center; align-items: center; padding: 20px; }
.poll-modal-overlay.open { display: flex; }
.poll-modal { background: #fff; border-radius: 16px; max-width: 580px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.poll-modal-header { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 10px; }
.poll-modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: #333; flex: 1; }
.poll-modal-close { width: 36px; height: 36px; border: none; background: #f1f3f5; border-radius: 8px; cursor: pointer; font-size: 1.1rem; color: #888; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.poll-modal-close:hover { background: #e2e6ea; }
.poll-modal-body { padding: 24px; }
.poll-modal-desc { font-size: 0.9rem; color: #666; line-height: 1.5; margin-bottom: 20px; padding: 14px; background: #f8f9fa; border-radius: 10px; }

/* 모달: 투표 옵션 */
.poll-opt-list { margin-bottom: 20px; }
.poll-opt-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid #eee; border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.poll-opt-item:hover { border-color: #c5d0f6; background: #fafbff; }
.poll-opt-item.selected { border-color: #667eea; background: #f0f4ff; }
.poll-opt-item input[type="radio"],
.poll-opt-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: #667eea; flex-shrink: 0; }
.poll-opt-item .opt-label { flex: 1; font-size: 0.95rem; color: #333; }
.poll-max-info { font-size: 0.82rem; color: #888; margin-bottom: 12px; }
.poll-text-area { width: 100%; min-height: 100px; padding: 12px; border: 2px solid #eee; border-radius: 10px; font-size: 0.95rem; resize: vertical; box-sizing: border-box; transition: border-color 0.2s; }
.poll-text-area:focus { border-color: #667eea; outline: none; }
.poll-vote-btn { width: 100%; padding: 13px; background: #667eea; color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.poll-vote-btn:hover { background: #5a6fd6; }
.poll-vote-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 모달: 결과 차트 */
.poll-result-section { margin-top: 20px; }
.poll-result-section h4 { font-size: 0.95rem; font-weight: 600; color: #333; margin: 0 0 14px; }
.poll-result-bar { margin-bottom: 12px; }
.poll-result-bar .bar-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.poll-result-bar .bar-text { font-size: 0.9rem; color: #444; font-weight: 500; }
.poll-result-bar .bar-pct { font-size: 0.85rem; color: #667eea; font-weight: 700; }
.poll-result-bar .bar-count { font-size: 0.78rem; color: #999; margin-left: 6px; }
.poll-result-bar .bar-track { height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.poll-result-bar .bar-fill { height: 100%; border-radius: 5px; transition: width 0.8s ease; }
.poll-result-bar .bar-fill.gradient-1 { background: linear-gradient(90deg, #667eea, #764ba2); }
.poll-result-bar .bar-fill.gradient-2 { background: linear-gradient(90deg, #f59e0b, #f97316); }
.poll-result-bar .bar-fill.gradient-3 { background: linear-gradient(90deg, #10b981, #059669); }
.poll-result-bar .bar-fill.gradient-4 { background: linear-gradient(90deg, #ef4444, #dc2626); }
.poll-result-bar .bar-fill.gradient-5 { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.poll-result-bar.is-top .bar-track { border: 2px solid #667eea; background: #f0f4ff; }
.poll-result-bar.is-mine .bar-text::after { content: ' (내 선택)'; font-size: 0.75rem; color: #667eea; font-weight: 400; }
.poll-result-total { font-size: 0.85rem; color: #888; margin-top: 14px; text-align: center; padding-top: 12px; border-top: 1px solid #f0f0f0; }

/* 주관식 응답 목록 */
.text-response-list { margin-top: 16px; }
.text-response-item { padding: 12px; background: #f8f9fa; border-radius: 10px; margin-bottom: 8px; }
.text-response-item .tr-text { font-size: 0.9rem; color: #444; line-height: 1.5; margin-bottom: 4px; }
.text-response-item .tr-meta { font-size: 0.78rem; color: #aaa; }
.text-response-more { text-align: center; padding: 10px; }
.text-response-more button { padding: 8px 20px; background: #f1f3f5; border: none; border-radius: 8px; color: #555; cursor: pointer; font-size: 0.88rem; transition: background 0.2s; }
.text-response-more button:hover { background: #e2e6ea; }

/* 페이지네이션 */
.poll-pagination { display: flex; justify-content: center; gap: 5px; margin-top: 24px; }
.poll-pagination button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: none; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.poll-pagination button { background: #f1f3f5; color: #555; }
.poll-pagination button:hover { background: #e2e6ea; }
.poll-pagination button.current { background: #667eea; color: #fff; font-weight: 600; }
.poll-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 알림 토스트 */
.poll-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: #333; color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 0.9rem; z-index: 10001; transition: transform 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.poll-toast.show { transform: translateX(-50%) translateY(0); }

/* 로그인 안내 */
.poll-login-notice { text-align: center; padding: 20px; background: #fff3cd; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; color: #856404; }
.poll-login-notice a { color: #667eea; font-weight: 600; text-decoration: none; }

/* 반응형 */
@media (max-width: 768px) {
    .poll-page { padding: 12px; }
    .poll-stats-bar { gap: 8px; }
    .poll-stat-item { min-width: 80px; padding: 12px 8px; }
    .poll-stat-item .stat-num { font-size: 1.2rem; }
    .poll-highlight { padding: 20px; }
    .poll-highlight .hl-title { font-size: 1.1rem; }
    .poll-highlight .hl-meta { flex-wrap: wrap; gap: 10px; }
    .poll-highlight .hl-btn { margin-left: 0; width: 100%; justify-content: center; }
    .poll-tabs { font-size: 0.85rem; }
    .poll-tab { padding: 12px 8px; font-size: 0.85rem; }
    .poll-tab i { display: none; }
    .poll-modal { max-height: 90vh; margin: 10px; border-radius: 14px; }
    .pf-row { flex-direction: column; gap: 0; }
    .pf-row .pf-group { min-width: auto; }
}
