/* 축의금 계산기 전용 스타일 */
/* 앱 UI와 동일한 디자인 시스템 */

/* 계산기 앱 레이아웃 */
.calculator-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

/* 헤더 */
.calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--bg-light);
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-spacer {
    width: 40px;
}

/* 메인 콘텐츠 */
.calc-main {
    flex: 1;
    overflow-y: auto;
}

.calc-step {
    display: none;
    padding: 24px 20px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.calc-step.active {
    display: block;
}

/* 타이틀 섹션 */
.title-section {
    text-align: center;
    margin-bottom: 40px;
}

.main-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.main-title .highlight {
    color: var(--primary-dark);
}

.sub-title {
    font-size: 16px;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.5;
}

/* 애니메이션 */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.4s ease forwards;
}

.animate-in.hidden {
    display: none;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 질문/답변 블록 */
.qa-block {
    margin-bottom: 24px;
}

/* 말풍선 (질문) */
.question-bubble {
    background: var(--bg-white);
    border-radius: 20px 20px 20px 4px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: inline-block;
    margin-bottom: 12px;
}

.question-bubble p {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

/* 답변 카드 */
.answer-card {
    background: var(--primary-light);
    border-radius: 4px 20px 20px 20px;
    padding: 16px;
}

/* 칩 그룹 */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 12px 20px;
    border-radius: 24px;
    border: 2px solid var(--border-light);
    background: var(--bg-white);
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chip:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 209, 102, 0.2);
}

.chip.selected {
    border-color: var(--primary-dark);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-primary);
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 209, 102, 0.35);
}

/* 선택 버튼 그룹 */
.btn-group {
    display: flex;
    gap: 12px;
}

.select-btn {
    flex: 1;
    padding: 16px 18px;
    border-radius: 16px;
    border: 2px solid var(--border-light);
    background: var(--bg-white);
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.select-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.select-btn.selected {
    border-color: var(--primary-dark);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 209, 102, 0.35);
}

/* 친밀도 슬라이더 */
.closeness-slider {
    padding: 8px 0;
}

.closeness-slider input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-white);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.closeness-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--bg-white);
}

.closeness-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.closeness-value {
    text-align: center;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 제출 버튼 */
.submit-section {
    margin-top: 32px;
    padding-bottom: 40px;
}

.submit-section.hidden {
    display: none;
}

.primary-btn {
    width: 100%;
    padding: 18px 24px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 209, 102, 0.4);
}

.primary-btn:active {
    transform: scale(0.98);
}

/* ===== 로딩 화면 ===== */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    padding: 40px 20px;
}

/* CSS 스피너 */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    margin-bottom: 16px;
}

.loading-title p {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.dots {
    display: inline-block;
    width: 24px;
    text-align: left;
}

.loading-message {
    font-size: 15px;
    color: var(--text-tertiary);
    margin: 0 0 40px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* 광고 영역 개선 */
.ad-placeholder {
    width: 100%;
    max-width: 360px;
    margin-top: 24px;
}

.ad-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 251, 240, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    border: 1px solid rgba(255, 209, 102, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.ad-box p {
    margin: 0 0 18px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ad-cta {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--text-primary) 0%, #1a1816 100%);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ad-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

/* ===== 결과 화면 ===== */
.result-content {
    padding-bottom: 40px;
}

.result-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 20px;
}

.result-label {
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.8;
    margin-bottom: 8px;
}

.result-amount {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.result-reason {
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.85;
    line-height: 1.5;
}

/* 계산 상세 */
.result-breakdown {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 액션 버튼 */
.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.share-btn,
.retry-btn {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.share-btn {
    background: var(--primary);
    border: none;
    color: var(--text-primary);
}

.share-btn:hover {
    transform: translateY(-2px);
}

.retry-btn {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    color: var(--text-primary);
}

.retry-btn:hover {
    border-color: var(--text-tertiary);
}

/* 앱 프로모션 */
.app-promo {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 24px;
}

.promo-card {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.promo-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.promo-text strong {
    display: block;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.promo-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.store-buttons {
    display: flex;
    gap: 12px;
}

.store-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
}

.store-btn.apple {
    background: #000;
    color: #fff;
}

.store-btn.google {
    background: var(--text-primary);
    color: #fff;
}

.store-btn:hover {
    transform: translateY(-2px);
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: toastIn 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .calc-step {
        padding: 20px 16px;
    }

    .main-title {
        font-size: 22px;
    }

    .result-amount {
        font-size: 36px;
    }

    .store-buttons {
        flex-direction: column;
    }
}