/* V2 메인 페이지 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; }

.v2-main-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: #fff;
    color: #333;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.v2-header-logo img { vertical-align: middle; }

.v2-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.v2-header-user {
    font-size: 13px;
    color: #6b7280;
}

.v2-header-btn {
    padding: 6px 16px;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.v2-header-btn:hover { background: #e5e7eb; }

.v2-header-btn.admin {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.v2-header-btn.admin:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.v2-header-btn.nav-pricing,
.v2-header-btn.nav-mypage {
    text-decoration: none;
    background: #faf5ff;
    color: #6d28d9;
    border-color: #e9d5ff;
    display: inline-flex;
    align-items: center;
}
.v2-header-btn.nav-pricing:hover,
.v2-header-btn.nav-mypage:hover {
    background: #f3e8ff;
    border-color: #d8b4fe;
}

.v2-header-btn-icon {
    vertical-align: -2px;
    margin-right: 3px;
}

.v2-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.v2-sidebar {
    width: 220px;
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
}

.v2-menu-list {
    list-style: none;
    padding: 8px 0;
}

.v2-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.v2-menu-item:hover {
    background: #e5e7eb;
    color: #1a1a2e;
}

.v2-menu-item.active {
    background: #dbeafe;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.v2-menu-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    background: #9ca3af;
    border-radius: 4px;
    flex-shrink: 0;
}

.v2-menu-item.active .v2-menu-icon { background: #3b82f6; }

.v2-menu-empty {
    padding: 20px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

.v2-content {
    flex: 1;
    overflow: hidden;
    padding: 0;
    background: #fff;
    position: relative;
}

/* 지도 모드: 패딩 없이 전체 영역 사용 */
.v2-content[style*="padding: 0"] {
    overflow: hidden;
}

.v2-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
}

.v2-welcome h2 { font-size: 28px; margin-bottom: 8px; }
.v2-welcome p { font-size: 14px; }

.v2-content-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.v2-content-header h3 {
    font-size: 18px;
    color: #1a1a2e;
}

.v2-content-body {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.8;
}

/* ===== 공통: date input 클릭 시 캘린더 오픈 ===== */
input[type="date"] {
    cursor: pointer;
    position: relative;
}

/* ===== 게스트 배너 ===== */
.v2-guest-banner {
    background: linear-gradient(135deg, #1e3a5f, #1e40af);
    flex-shrink: 0;
}

.v2-guest-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
}

.v2-guest-banner-inner svg { opacity: 0.7; flex-shrink: 0; }

.v2-guest-banner-inner span { flex: 1; }

.v2-guest-banner-btn {
    padding: 5px 16px;
    background: #fff;
    color: #1d4ed8;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.v2-guest-banner-btn:hover { background: #dbeafe; }

.v2-guest-banner-login {
    padding: 5px 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.v2-guest-banner-login:hover { background: rgba(255,255,255,0.25); }

.v2-guest-banner-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.v2-guest-banner-close:hover { color: #fff; }

/* ===== 잠긴 메뉴 ===== */
.v2-menu-item.v2-menu-locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.v2-menu-item.v2-menu-locked:hover {
    background: #f9fafb;
    opacity: 0.6;
}
.v2-menu-lock-badge {
    margin-left: auto;
    font-size: 12px;
    line-height: 1;
}
.v2-menu-credit-badge {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1px 6px;
    line-height: 14px;
}

/* ===== 잠금 모달 ===== */
.v2-guest-lock-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: guestFadeIn 0.15s;
}

.v2-guest-lock-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 380px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: guestSlideUp 0.2s ease-out;
}

.v2-guest-lock-icon {
    margin-bottom: 16px;
}

.v2-guest-lock-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.v2-guest-lock-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}

.v2-guest-lock-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.v2-guest-lock-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.v2-guest-lock-btn.primary {
    background: #3b82f6;
    color: #fff;
}
.v2-guest-lock-btn.primary:hover { background: #2563eb; }

.v2-guest-lock-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}
.v2-guest-lock-btn.secondary:hover { background: #e2e8f0; }

.v2-guest-lock-btn.close {
    background: none;
    color: #94a3b8;
    padding: 10px 16px;
}
.v2-guest-lock-btn.close:hover { color: #64748b; }

@keyframes guestFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes guestSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 크레딧 인디케이터 (헤더) ===== */
.v2-credit-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.v2-credit-indicator:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.v2-credit-indicator.v2-credit-pulse {
    animation: creditPulse 0.6s ease-out;
}
@keyframes creditPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(59,130,246,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}
.v2-credit-icon { display: flex; align-items: center; }
.v2-credit-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.5px;
}
.v2-credit-text {
    font-size: 11px;
    font-weight: 700;
}

/* ===== 크레딧 상세 팝오버 ===== */
.v2-credit-popover {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    padding: 16px;
    width: 280px;
    z-index: 9999;
    animation: guestSlideUp 0.15s ease-out;
}
.v2-credit-popover-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.v2-credit-popover-item {
    margin-bottom: 10px;
}
.v2-credit-popover-item:last-of-type {
    margin-bottom: 0;
}
.v2-credit-popover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.v2-credit-popover-menu {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
}
.v2-credit-popover-val {
    font-size: 12px;
    font-weight: 700;
}
.v2-credit-popover-bar {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    overflow: hidden;
}
.v2-credit-popover-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}
.v2-credit-popover-tip {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ===== 크레딧 경고 배너 ===== */
.v2-credit-warning-banner {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    flex-shrink: 0;
}
.v2-credit-warning-banner.exhausted {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}
.v2-credit-warning-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    font-size: 12px;
    color: #92400e;
}
.v2-credit-warning-banner.exhausted .v2-credit-warning-inner {
    color: #991b1b;
}
.v2-credit-warning-inner svg { flex-shrink: 0; }
.v2-credit-warning-inner span { flex: 1; }
.v2-credit-warning-close {
    background: none;
    border: none;
    color: #d97706;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}
.v2-credit-warning-banner.exhausted .v2-credit-warning-close { color: #dc2626; }
.v2-credit-warning-close:hover { opacity: 0.7; }

/* ===== 크레딧 소진 모달 ===== */
.v2-credit-exhaust-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: guestFadeIn 0.15s;
}
.v2-credit-exhaust-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: guestSlideUp 0.2s ease-out;
}

/* ===== 메뉴 호버 툴팁 ===== */
.v2-menu-tooltip {
    position: fixed;
    z-index: 9990;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
    max-width: 260px;
}

.v2-menu-tooltip.visible {
    opacity: 1;
    transform: translateX(0);
}

.v2-menu-tooltip-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.v2-menu-tooltip-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.v2-menu-tooltip-icon svg {
    display: block;
}

.v2-menu-tooltip-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}
