/**
 * 구글 애널리틱스 동의 팝업 스타일
 * 다낭 바다색을 활용한 깔끔한 디자인
 */

/* 팝업 기본 스타일 */
.analytics-consent-popup {
    position: fixed;
    bottom: -300px; /* 초기 위치 (숨김) */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08), 0 -2px 10px rgba(0, 0, 0, 0.04);
    padding: 16px 20px; /* 줄임: 24px → 16px */
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", sans-serif;
    border-top: 2px solid #0EA5E9; /* 줄임: 3px → 2px */
}

.analytics-consent-popup.show {
    bottom: 0; /* 표시 위치 */
}

/* 컨텐츠 래퍼 */
.consent-content {
    max-width: 800px;
    margin: 0 auto;
}

/* 텍스트 영역 */
.consent-text {
    text-align: center;
    margin-bottom: 16px; /* 줄임: 24px → 16px */
}

/* 제목 스타일 - 요리사 이모지 포함 */
.consent-title {
    font-size: 17px; /* 줄임: 20px → 17px */
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0; /* 줄임: 12px → 8px */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* 줄임: 8px → 6px */
}

.consent-title::before {
    content: '✨';
    font-size: 20px; /* 줄임: 24px → 20px */
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

/* 설명 텍스트 */
.consent-desc {
    font-size: 14px; /* 줄임: 15px → 14px */
    color: #475569;
    line-height: 1.5; /* 줄임: 1.6 → 1.5 */
    margin: 0 0 8px 0; /* 줄임: 10px → 8px */
}

/* 개인정보 안내 */
.consent-privacy {
    font-size: 13px; /* 줄임: 14px → 13px */
    color: #64748b;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e0f2fe;
    padding: 6px 12px; /* 줄임: 8px 16px → 6px 12px */
    border-radius: 16px; /* 줄임: 20px → 16px */
}

/* 액션 영역 */
.consent-actions {
    text-align: center;
}

/* 버튼 컨테이너 */
.consent-buttons {
    display: flex;
    gap: 10px; /* 줄임: 12px → 10px */
    justify-content: center;
    margin-bottom: 12px; /* 줄임: 16px → 12px */
}

/* 버튼 공통 스타일 */
.btn-consent {
    padding: 10px 24px; /* 줄임: 12px 28px → 10px 24px */
    border-radius: 6px; /* 줄임: 8px → 6px */
    font-size: 14px; /* 줄임: 15px → 14px */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 110px; /* 줄임: 120px → 110px */
    position: relative;
    overflow: hidden;
}

/* 동의 버튼 */
.btn-accept {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-accept:active {
    transform: translateY(0);
}

/* 물결 효과 */
.btn-accept::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-accept:hover::after {
    width: 300px;
    height: 300px;
}

/* 거부 버튼 */
.btn-decline {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.btn-decline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* 체크박스 영역 */
.consent-checkbox {
    display: inline-block;
}

.consent-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px; /* 줄임: 14px → 13px */
    color: #64748b;
    user-select: none;
    padding: 6px 10px; /* 줄임: 8px 12px → 6px 10px */
    border-radius: 6px;
    transition: background 0.2s;
}

.consent-checkbox label:hover {
    background: #f1f5f9;
}

/* 체크박스 커스텀 */
.consent-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 16px; /* 줄임: 18px → 16px */
    height: 16px; /* 줄임: 18px → 16px */
    border: 2px solid #cbd5e1;
    border-radius: 3px; /* 줄임: 4px → 3px */
    margin-right: 8px; /* 줄임: 10px → 8px */
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.consent-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: #0EA5E9;
    border-color: #0EA5E9;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 체크 마크 */
.consent-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkMark 0.3s ease;
}

@keyframes checkMark {
    0% { opacity: 0; transform: rotate(45deg) scale(0); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

.checkbox-text {
    font-size: 13px; /* 줄임: 14px → 13px */
    color: #64748b;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .analytics-consent-popup {
        padding: 14px 12px; /* 줄임: 20px 16px → 14px 12px */
    }
    
    .consent-title {
        font-size: 16px; /* 줄임: 18px → 16px */
        flex-direction: row; /* 변경: 가로 유지 */
        gap: 4px;
    }
    
    .consent-title::before {
        font-size: 18px; /* 줄임: 28px → 18px */
    }
    
    .consent-desc {
        font-size: 14px;
    }
    
    .consent-privacy {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .consent-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-consent {
        width: 100%;
        padding: 14px;
    }
    
    .consent-desc br {
        display: none;
    }
}

/* 태블릿 */
@media (max-width: 1024px) and (min-width: 769px) {
    .consent-content {
        max-width: 90%;
    }
}

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .analytics-consent-popup {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        color: #f1f5f9;
        border-top-color: #0284C7;
    }
    
    .consent-title {
        color: #f1f5f9;
    }
    
    .consent-desc {
        color: #cbd5e1;
    }
    
    .consent-privacy {
        color: #e2e8f0;
        background: rgba(14, 165, 233, 0.2);
    }
    
    .btn-decline {
        background: #334155;
        color: #e2e8f0;
        border-color: #475569;
    }
    
    .btn-decline:hover {
        background: #475569;
        border-color: #64748b;
    }
    
    .checkbox-custom {
        background: #334155;
        border-color: #475569;
    }
    
    .checkbox-text {
        color: #cbd5e1;
    }
    
    .consent-checkbox label:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* 애니메이션 부드러움 개선 */
@media (prefers-reduced-motion: reduce) {
    .analytics-consent-popup,
    .btn-consent,
    .checkbox-custom {
        transition: none;
    }
    
    @keyframes sparkle { 0%, 100% { transform: none; } }
    @keyframes checkPop { 0%, 100% { transform: none; } }
    @keyframes checkMark { 0%, 100% { opacity: 1; transform: rotate(45deg); } }
}

/* 고대비 모드 */
@media (prefers-contrast: high) {
    .analytics-consent-popup {
        border-top-width: 5px;
    }
    
    .btn-accept {
        background: #0284C7;
        box-shadow: none;
    }
    
    .btn-decline {
        border-width: 3px;
    }
}
