/* ==============================================
   AQM 점검 가이드 - quests.css
   그룹 단위 해금 + 프리미엄 디자인
   ============================================== */

/* 기본 래퍼 */
.gp-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 60px;
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
}

/* ── 헤더 ── */
.gp-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}
.gp-header-title { font-size: 1.45rem; font-weight: 900; color: #0f0f0f; margin: 0 0 4px; }
.gp-header-sub   { font-size: .85rem; color: #888; margin: 0; }
.gp-progress-pill {
    background: linear-gradient(135deg, #facc15, #f59e0b);
    color: #111; font-weight: 800; font-size: .82rem;
    padding: 7px 18px; border-radius: 30px;
    box-shadow: 0 2px 10px rgba(250,204,21,.4);
    white-space: nowrap;
}

/* 게스트 티저 UI */
.gp-guide-list.guest-teaser {
    position: relative;
    max-height: 400px;
    overflow: hidden;
}

.gp-guide-list.guest-teaser::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent, #fff);
    z-index: 10;
}

.guest-item-blur {
    filter: blur(4px);
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

.gp-locked-teaser-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 90%;
    max-width: 320px;
}

.teaser-cta-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid #f1f5f9;
}

.teaser-cta-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.teaser-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #facc15;
    color: #000;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    margin-top: 0.5rem;
}

/* ── 비회원 안내 ── */
.gp-locked-wrap {
    text-align: center;
    padding: 70px 20px;
    border: 2px dashed #e5e5e5;
    border-radius: 20px;
    margin-top: 10px;
}
.gp-locked-icon { font-size: 4rem; margin-bottom: 18px; }
.gp-locked-wrap h3 { font-size: 1.3rem; font-weight: 900; color: #111; margin: 0 0 10px; }
.gp-locked-wrap p  { color: #999; font-size: .9rem; margin: 0 0 24px; line-height: 1.7; }
.gp-locked-wrap a {
    display: inline-block;
    background: linear-gradient(135deg, #facc15, #f59e0b);
    color: #111; font-weight: 800; font-size: .92rem;
    padding: 13px 32px; border-radius: 12px; text-decoration: none;
    box-shadow: 0 4px 16px rgba(250,204,21,.4);
    transition: transform .15s, box-shadow .15s;
}
.gp-locked-wrap a:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(250,204,21,.5); }

/* ── 로딩 ── */
.gp-loading {
    text-align: center; padding: 60px 20px; color: #aaa;
}
.gp-loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #facc15;
    border-radius: 50%;
    animation: gp-spin .7s linear infinite;
    margin: 0 auto 14px;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   그룹 카드 (핵심 UI)
   ══════════════════════════════════════════════ */
.gp-group {
    margin-bottom: 18px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: box-shadow .25s;
}
.gp-group:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); }

/* 그룹 헤더 — 잠긴 상태 */
.gp-group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    transition: background .3s;
    position: relative;
    overflow: hidden;
}
.gp-group-header::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(250,204,21,.1) 0%, transparent 60%);
    pointer-events: none;
}

/* 그룹 헤더 — 해금된 상태 */
.gp-group.unlocked .gp-group-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #1a3a2a 50%, #0a2a1a 100%);
}
.gp-group.unlocked .gp-group-header::before {
    background: radial-gradient(ellipse at 80% 50%, rgba(34,197,94,.15) 0%, transparent 60%);
}

/* 자물쇠 아이콘 */
.gp-lock-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: all .3s;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.15);
}
.gp-group.unlocked .gp-lock-icon {
    background: rgba(34,197,94,.15);
    border-color: rgba(34,197,94,.4);
}

/* 그룹 텍스트 */
.gp-group-info { flex: 1; min-width: 0; }
.gp-group-name {
    font-size: 1rem; font-weight: 800; color: #fff; margin: 0 0 3px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.gp-group-count {
    font-size: .72rem; font-weight: 700;
    padding: 2px 9px; border-radius: 30px;
    background: rgba(255,255,255,.12); color: rgba(255,255,255,.7);
}
.gp-group.unlocked .gp-group-count {
    background: rgba(34,197,94,.2); color: #86efac;
}
.gp-group-hint {
    font-size: .77rem; color: rgba(255,255,255,.5); margin: 0;
}

/* 해금 토글 버튼 */
.gp-toggle-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,.1);
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: 10px;
    color: #fff; font-size: .78rem; font-weight: 700;
    padding: 8px 16px; cursor: pointer;
    transition: all .2s; white-space: nowrap;
}
.gp-toggle-btn:hover { background: rgba(255,255,255,.18); }
.gp-group.unlocked .gp-toggle-btn {
    background: rgba(34,197,94,.2);
    border-color: rgba(34,197,94,.4);
    color: #86efac;
}

/* ── 그룹 가이드 목록 (아코디언 — .open 클래스로 제어) ── */
.gp-guide-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
    background: #fafafa;
}
.gp-group.open .gp-guide-list { max-height: 5000px; }

/* 섹션 헤더 (0단계, 1단계 등) */
.gp-guide-section-header {
    background: #fdfdfd;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
}
.gp-group.completed .gp-guide-section-header {
    background: #fffdf0;
    border-bottom-color: #fde68a;
    color: #a16207 !important;
}

/* 가이드 아이템 */
.gp-guide-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-top: 1px solid #efefef;
    transition: background .15s;
}
.gp-guide-item:hover { background: #fff; }
.gp-guide-item.done  { background: #f0fdf4; }
.gp-guide-item.locked { opacity: 0.6; background: #f1f5f9; cursor: not-allowed; }
.gp-guide-item.locked .gp-guide-title { color: #94a3b8; text-decoration: none; }
.gp-guide-item.locked .gp-guide-desc { color: #cbd5e1; }
.gp-guide-item.locked .gp-check-btn.locked { background: #e2e8f0; color: #94a3b8; border-color: #cbd5e1; cursor: not-allowed; }
.gp-guide-item.locked .gp-check-label.locked { color: #94a3b8; background: #f8fafc; }

/* 체크 버튼 래퍼 (원+완료 라벨) */
.gp-check-wrap {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; flex-shrink: 0; cursor: pointer; padding-top: 4px;
    width: 60px;
}
.gp-check-btn {
    width: 36px; height: 36px;
    border-radius: 50%; border: 2px solid #e2e8f0;
    background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.gp-check-icon {
    font-size: 1.1rem; font-weight: 800; color: #fff;
    animation: gpBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gpBounceIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.gp-check-wrap:hover .gp-check-btn { 
    border-color: #22c55e; 
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(34,197,94,0.15);
}
.gp-guide-item.done .gp-check-btn { 
    background: #22c55e; border-color: #22c55e; 
    box-shadow: 0 4px 12px rgba(34,197,94,0.2);
}

.gp-check-label {
    font-size: .65rem; font-weight: 800; color: #94a3b8;
    background: #f1f5f9; padding: 3px 8px; border-radius: 20px;
    transition: all 0.3s;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.gp-check-wrap:hover .gp-check-label { 
    color: #22c55e; background: #f0fdf4;
}
.gp-check-label.done { 
    color: #fff; background: #22c55e;
}

/* 해금 취소 버튼 */
.gp-toggle-btn.gp-lock-action {
    background: rgba(239,68,68,.15);
    border-color: rgba(239,68,68,.4);
    color: #fca5a5;
}
.gp-toggle-btn.gp-lock-action:hover { background: rgba(239,68,68,.3); }

.gp-guide-body { flex: 1; min-width: 0; }
.gp-guide-title-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.gp-guide-title { font-size: .93rem; font-weight: 700; color: #111; }
.gp-guide-item.done .gp-guide-title { color: #999; text-decoration: line-through; }
.gp-savings-badge {
    font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px;
    background: #d1fae5; color: #065f46;
}
.gp-guide-desc { font-size: .8rem; color: #888; margin: 0 0 6px; line-height: 1.5; }
.gp-guide-tip {
    background: #fff;
    border: 1px solid #f1f5f9;
    padding: 24px;
    border-radius: 16px;
    font-size: .88rem;
    color: #334155;
    line-height: 1.8;
    margin-top: 20px;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.04), 0 8px 10px -6px rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gp-guide-tip:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.06), 0 10px 10px -5px rgba(0,0,0,0.04);
    border-color: #e2e8f0;
}
.gp-guide-tip strong { 
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem; 
    font-weight: 700;
    color: #0f172a; 
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}
.gp-guide-tip strong::before {
    content: '✦';
    color: #facc15;
    font-size: 1.1rem;
}
.gp-guide-tip strong::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #f1f5f9, transparent);
    margin-left: 10px;
}

/* ═══ 그룹 전체 완료 — 골드 셀러브레이션 ═══ */
.gp-group.completed {
    box-shadow: 0 0 0 2px #facc15, 0 8px 30px rgba(250,204,21,.3);
    animation: gp-group-appear .5s ease;
}
@keyframes gp-group-appear {
    from { transform: scale(.97); opacity: .6; }
    to   { transform: scale(1);   opacity: 1; }
}

.gp-group.completed .gp-group-header {
    background: linear-gradient(135deg, #7c5f00 0%, #a07800 40%, #c9960a 70%, #f5c50a 100%);
    position: relative; overflow: hidden;
}

/* 반짝이는 shimmer 스트라이프 */
.gp-group.completed .gp-group-header::after {
    content: '';
    position: absolute; top: -50%; left: -75%;
    width: 50%; height: 200%;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.25) 50%, transparent 60%);
    animation: gp-shimmer 2.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes gp-shimmer {
    0%   { left: -75%; }
    60%  { left: 125%; }
    100% { left: 125%; }
}

/* 헤더 전체 glow pulse */
.gp-group.completed .gp-group-header::before {
    background: radial-gradient(ellipse at 80% 50%, rgba(255,255,255,.12) 0%, transparent 65%);
    animation: gp-glow-pulse 2s ease-in-out infinite;
}
@keyframes gp-glow-pulse {
    0%, 100% { opacity: .7; }
    50%       { opacity: 1; }
}

/* 완료된 그룹의 글자 색 */
.gp-group.completed .gp-group-name { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.gp-group.completed .gp-group-hint { color: rgba(255,255,255,.65); }
.gp-group.completed .gp-toggle-btn {
    background: rgba(0,0,0,.2);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}

/* DONE 뱃지 — 고급 */
.gp-group-done-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff; font-size: .68rem; font-weight: 900;
    padding: 3px 10px; border-radius: 20px; letter-spacing: .8px;
    text-transform: uppercase;
}

/* 완료된 그룹 안의 가이드 아이템 */
.gp-group.completed .gp-guide-list { background: #fffdf0; }
.gp-group.completed .gp-guide-item { border-top-color: #fde68a; }
.gp-group.completed .gp-guide-item:hover { background: #fffbea; }
.gp-group.completed .gp-guide-title { color: #78716c; text-decoration: line-through; }
.gp-group.completed .gp-check-btn  { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* 파티클 — confetti 점 */
.gp-particle {
    position: fixed; width: 7px; height: 7px;
    border-radius: 2px;
    pointer-events: none; z-index: 9998;
    animation: gp-particle-fly 0.9s ease-out forwards;
}
@keyframes gp-particle-fly {
    0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--px), var(--py)) rotate(var(--pr)) scale(.3); opacity: 0; }
}


/* ── 완료 해제 모달 ── */
.gp-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.gp-modal-overlay.open { display: flex; }
.gp-modal {
    background: #fff; border-radius: 18px;
    padding: 32px 28px; max-width: 340px; width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: gp-modal-in .25s ease;
}
@keyframes gp-modal-in { from { opacity:0; transform:scale(.92) translateY(10px); } }
.gp-modal h4 { font-size: 1.05rem; font-weight: 900; color: #111; margin: 0 0 10px; }
.gp-modal p  { font-size: .87rem; color: #666; margin: 0 0 24px; line-height: 1.6; }
.gp-modal-btns { display: flex; gap: 10px; }
.gp-modal-btns button {
    flex: 1; padding: 11px; border-radius: 10px; border: none;
    font-weight: 700; font-size: .88rem; cursor: pointer; transition: opacity .15s;
}
.gp-modal-btns button:hover { opacity: .85; }
.gp-modal-cancel { background: #f0f0f0; color: #555; }
.gp-modal-confirm { background: #ef4444; color: #fff; }

/* --- [추가] 숨겨진 가이드 요약 안내 박스 (노랑 파스텔) --- */
.gp-hidden-summary-box {
    margin: 12px 16px 16px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.5s ease-out;
}

.gp-hidden-summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-hidden-summary-icon {
    font-size: 1.2rem;
    line-height: 1.4;
}

.gp-hidden-summary-text {
    font-size: 0.85rem;
    color: #b45309;
    font-weight: 500;
}

.gp-hidden-summary-text strong {
    color: #d97706;
    font-weight: 800;
}

.gp-hidden-unlock-hint {
    font-size: 0.75rem;
    color: #d97706;
    margin: 0;
    opacity: 0.8;
}

.gp-hidden-unlock-hint b {
    color: #ef4444;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- [추가] 잠금 안내 커스텀 팝업 (프리미엄 디자인) --- */
.gp-lock-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gp-lock-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.gp-lock-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 320px;
    padding: 32px 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gp-lock-modal-overlay.open .gp-lock-modal-content {
    transform: translateY(0);
}

.gp-lock-modal-icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.gp-lock-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.gp-lock-modal-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 24px;
}

.gp-lock-modal-desc strong {
    color: #ef4444;
}

.gp-lock-modal-btn {
    width: 100%;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.gp-lock-modal-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.gp-lock-modal-btn:active {
    transform: translateY(0);
}

/* --- 기존 스타일 --- */
.gp-stats {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.gp-stat-card {
    background: #fff; border: 1.5px solid #eee;
    border-radius: 14px; padding: 14px 20px;
    display: flex; align-items: center; gap: 12px;
    flex: 1; min-width: 130px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.gp-stat-dot {
    width: 36px; height: 36px; border-radius: 10px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; font-weight: 900;
}
.gp-stat-dot.yellow { background: #fef9c3; color: #92400e; }
.gp-stat-dot.green  { background: #d1fae5; color: #065f46; }
.gp-stat-dot.blue   { background: #dbeafe; color: #1e40af; }
.gp-stat-label { font-size: .71rem; color: #aaa; font-weight: 600; margin: 0 0 2px; }
.gp-stat-val   { font-size: 1.2rem; font-weight: 900; color: #111; }
