/**
 * NPS Widget V2 - 1단계 점수 선택 UI
 * 핫덕 디자인 시스템 기반
 * 
 * 브랜드 컬러:
 * - 메인 빨강: #e74c3c
 * - 서브 노랑: #f39c12
 * - 리워드 초록: #27ae60
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --nps-v2-primary: #e74c3c;
    --nps-v2-primary-light: #fef5f4;
    --nps-v2-secondary: #f39c12;
    --nps-v2-reward-green: #27ae60;
    --nps-v2-reward-bg: #e8f8f0;
    --nps-v2-text-dark: #2c3e50;
    --nps-v2-text-gray: #7f8c8d;
    --nps-v2-text-light: #bdc3c7;
    --nps-v2-border: #ecf0f1;
    --nps-v2-white: #ffffff;
    --nps-v2-overlay: rgba(0, 0, 0, 0.6);
}

/* ========================================
   Overlay (배경 딤)
   ======================================== */
#npsWidgetV2-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--nps-v2-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#npsWidgetV2-overlay.nps-v2-visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Container (팝업 박스)
   ======================================== */
#npsWidgetV2 {
    background: var(--nps-v2-white);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    position: relative;
}

#npsWidgetV2-overlay.nps-v2-visible #npsWidgetV2 {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ========================================
   Close Button (닫기 버튼)
   ======================================== */
.nps-v2-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    color: var(--nps-v2-text-gray);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.nps-v2-close-btn:hover {
    background: #eee;
    color: var(--nps-v2-text-dark);
    transform: rotate(90deg);
}

/* ========================================
   Header (헤더 영역)
   ======================================== */
.nps-v2-header {
    padding: 32px 24px 20px;
    text-align: center;
}

.nps-v2-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--nps-v2-text-dark);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.nps-v2-subtitle {
    font-size: 14px;
    color: var(--nps-v2-text-gray);
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   Reward Section (리워드 영역 - 심플하게)
   ======================================== */
.nps-v2-reward {
    margin: 0 24px 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--nps-v2-reward-bg) 0%, #d5f5e3 100%);
    border: 2px solid #a9dfbf;
    border-radius: 14px;
    text-align: center;
}

.nps-v2-reward-amount {
    font-size: 24px;
    font-weight: 800;
    color: #1e8449;
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}

.nps-v2-reward-desc {
    font-size: 12px;
    color: #27ae60;
    margin: 0;
    font-weight: 500;
}

/* ========================================
   Score Section (NPS 점수 선택 - 5점 척도)
   ======================================== */
.nps-v2-score-section {
    padding: 0 20px 24px;
}

.nps-v2-score-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.nps-v2-score-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 4px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    color: var(--nps-v2-text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nps-v2-score-emoji {
    font-size: 28px;
    line-height: 1;
}

.nps-v2-score-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--nps-v2-text-gray);
    white-space: nowrap;
}

.nps-v2-score-btn:hover {
    border-color: var(--nps-v2-primary);
    background: var(--nps-v2-primary-light);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.nps-v2-score-btn:hover .nps-v2-score-emoji {
    transform: scale(1.1);
}

.nps-v2-score-btn.nps-v2-selected {
    background: var(--nps-v2-primary);
    border-color: var(--nps-v2-primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.4);
}

.nps-v2-score-btn.nps-v2-selected .nps-v2-score-emoji {
    filter: grayscale(0) brightness(1.1);
}

.nps-v2-score-btn.nps-v2-selected .nps-v2-score-text {
    color: white;
}

/* ========================================
   Step Container (단계별 컨테이너)
   ======================================== */
.nps-v2-step {
    display: none !important;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

.nps-v2-step-active {
    display: block !important;
    opacity: 1;
}

.nps-v2-step-exit {
    opacity: 0;
}

.nps-v2-step-hidden {
    display: none !important;
}

/* ========================================
   CTA Buttons (스킵 버튼, 다음 버튼)
   ======================================== */
.nps-v2-actions {
    padding: 8px 24px 28px;
    text-align: center;
}

.nps-v2-skip-btn {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--nps-v2-text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    text-align: center;
}

.nps-v2-skip-btn:hover {
    color: var(--nps-v2-text-gray);
}

.nps-v2-next-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    margin-bottom: 12px;
    background: var(--nps-v2-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nps-v2-next-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.nps-v2-next-btn:active {
    transform: translateY(0);
}

/* ========================================
   Step 2: Feedback Section (피드백 입력)
   ======================================== */
.nps-v2-feedback-section {
    padding: 0 24px 20px;
}

.nps-v2-feedback-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--nps-v2-border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--nps-v2-text-dark);
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    line-height: 1.5;
}

.nps-v2-feedback-textarea::placeholder {
    color: var(--nps-v2-text-light);
}

.nps-v2-feedback-textarea:focus {
    outline: none;
    border-color: var(--nps-v2-primary);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* ========================================
   Step 3: Contact Section (연락처 입력)
   ======================================== */
.nps-v2-contact-section {
    padding: 0 24px 20px;
}

.nps-v2-kakao-btn {
    width: 100%;
    padding: 14px 20px;
    background: #FEE500;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #391B1B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nps-v2-kakao-btn:hover {
    background: #F5DC00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

.nps-v2-kakao-btn:active {
    transform: translateY(0);
}

.nps-v2-kakao-icon {
    flex-shrink: 0;
}

.nps-v2-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--nps-v2-text-light);
    font-size: 13px;
}

.nps-v2-divider::before,
.nps-v2-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--nps-v2-border);
}

.nps-v2-divider span {
    padding: 0 12px;
}

.nps-v2-phone-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--nps-v2-border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--nps-v2-text-dark);
    text-align: center;
    letter-spacing: 1px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.nps-v2-phone-input::placeholder {
    color: var(--nps-v2-text-light);
    letter-spacing: 0;
}

.nps-v2-phone-input:focus {
    outline: none;
    border-color: var(--nps-v2-primary);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* Disabled button style */
.nps-v2-btn-disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.nps-v2-btn-disabled:hover {
    background: #ccc !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   Step 4: Interview Section (인터뷰 참여 의사)
   ======================================== */
.nps-v2-interview-reward {
    text-align: center;
    padding: 16px 24px 24px;
    color: var(--nps-v2-text-gray);
    font-size: 15px;
    line-height: 1.6;
}

.nps-v2-interview-reward p {
    margin: 0;
}

.nps-v2-interview-reward strong {
    color: var(--nps-v2-reward-green);
    font-weight: 700;
}

.nps-v2-interview-buttons {
    display: flex;
    gap: 12px;
    padding: 0 24px 28px;
}

.nps-v2-interview-yes,
.nps-v2-interview-no {
    flex: 1;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nps-v2-interview-yes {
    background: var(--nps-v2-primary);
    border: none;
    color: white;
}

.nps-v2-interview-yes:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.nps-v2-interview-no {
    background: white;
    border: 2px solid var(--nps-v2-border);
    color: var(--nps-v2-text-gray);
}

.nps-v2-interview-no:hover {
    border-color: var(--nps-v2-text-light);
    background: #f8f9fa;
    transform: translateY(-2px);
}

/* ========================================
   Complete Section (제출 완료)
   ======================================== */
.nps-v2-complete-icon {
    text-align: center;
    font-size: 64px;
    padding: 32px 0 16px;
    line-height: 1;
}

.nps-v2-step-complete .nps-v2-header {
    padding-top: 0;
}

.nps-v2-subtitle-small {
    font-size: 13px !important;
    margin-top: 16px !important;
    color: var(--nps-v2-text-light) !important;
}

.nps-v2-kakao-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #FEE500;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #391B1B;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.nps-v2-kakao-channel-btn:hover {
    background: #F5DC00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

.nps-v2-step-complete .nps-v2-actions {
    padding-top: 16px;
}

/* ========================================
   Responsive (반응형)
   ======================================== */

/* 태블릿/모바일 (768px 이하) - 하단 시트 스타일 */
@media (max-width: 768px) {
    #npsWidgetV2-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    #npsWidgetV2 {
        max-width: 100%;
        width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 90vh;
    }
    
    #npsWidgetV2-overlay.nps-v2-visible #npsWidgetV2 {
        transform: translateY(0) scale(1);
    }
    
    .nps-v2-header {
        padding: 28px 20px 16px;
    }
    
    .nps-v2-title {
        font-size: 20px;
    }
    
    .nps-v2-subtitle {
        font-size: 14px;
    }
    
    .nps-v2-reward {
        margin: 0 20px 20px;
        padding: 14px 16px;
    }
    
    .nps-v2-score-section {
        padding: 0 16px 20px;
    }
    
    .nps-v2-score-buttons {
        gap: 8px;
    }
    
    .nps-v2-score-btn {
        padding: 12px 4px;
        border-radius: 12px;
    }
    
    .nps-v2-score-emoji {
        font-size: 26px;
    }
    
    .nps-v2-score-text {
        font-size: 11px;
    }
    
    .nps-v2-actions {
        padding: 8px 20px 24px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
    
    /* Step 2 반응형 */
    .nps-v2-feedback-section {
        padding: 0 20px 20px;
    }
    
    .nps-v2-feedback-textarea {
        padding: 14px;
        font-size: 15px;
    }
    
    .nps-v2-next-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    /* Step 3 반응형 */
    .nps-v2-contact-section {
        padding: 0 20px 20px;
    }
    
    .nps-v2-kakao-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .nps-v2-phone-input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    /* Step 4 반응형 */
    .nps-v2-interview-reward {
        padding: 12px 20px 24px;
        font-size: 15px;
    }
    
    .nps-v2-interview-buttons {
        padding: 0 20px 28px;
        gap: 12px;
    }
    
    .nps-v2-interview-yes,
    .nps-v2-interview-no {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    /* Complete 반응형 */
    .nps-v2-complete-icon {
        font-size: 60px;
        padding: 28px 0 16px;
    }
    
    .nps-v2-kakao-channel-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* 작은 모바일 (480px 이하) - 더 작은 폰트 */
@media (max-width: 480px) {
    .nps-v2-title {
        font-size: 18px;
    }
    
    .nps-v2-subtitle {
        font-size: 13px;
    }
    
    .nps-v2-reward {
        margin: 0 16px 16px;
        padding: 12px 14px;
    }
    
    .nps-v2-reward-amount {
        font-size: 20px;
    }
    
    .nps-v2-reward-desc {
        font-size: 11px;
    }
    
    .nps-v2-score-section {
        padding: 0 12px 16px;
    }
    
    .nps-v2-score-buttons {
        gap: 6px;
    }
    
    .nps-v2-score-btn {
        padding: 10px 2px;
        border-radius: 10px;
    }
    
    .nps-v2-score-emoji {
        font-size: 24px;
    }
    
    .nps-v2-score-text {
        font-size: 10px;
    }
}

/* ========================================
   Animation Keyframes
   ======================================== */
@keyframes nps-v2-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.nps-v2-pulse {
    animation: nps-v2-pulse 0.5s ease;
}

@keyframes nps-v2-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.nps-v2-shake {
    animation: nps-v2-shake 0.4s ease;
}

