/**
 * iOS 스타일 물방울 버튼 효과
 * 계산하기 버튼에 적용
 */

/* 기본 버튼 스타일 개선 */
.btn_calculate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: pointer;
}

/* 클릭 후 파란색 제거 */
.btn_calculate:active,
.btn_calculate:focus {
    outline: none;
    background-color: var(--primary-color, #3B82F6);
}

/* 물방울 효과 컨테이너 */
.btn_calculate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

/* 클릭 시 물방울 확장 */
.btn_calculate.ripple::before {
    width: 300px;
    height: 300px;
}

/* 로딩 상태 */
.btn_calculate.loading {
    pointer-events: none;
    opacity: 0.7;
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 50%, #3B82F6 100%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 로딩 스피너 */
.btn_calculate.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* 성공 상태 */
.btn_calculate.success {
    background-color: #10B981;
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 오류 상태 */
.btn_calculate.error {
    background-color: #EF4444;
    animation: error-shake 0.5s ease-out;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 다시하기 버튼 호버 효과 */
.btn_reset {
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn_reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn_reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .btn_calculate::before {
        transition: width 0.4s, height 0.4s;
    }

    .btn_calculate.ripple::before {
        width: 200px;
        height: 200px;
    }
}

/* 오류 토스트 메시지 */
.error_toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #EF4444;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    max-width: 90%;
    animation: toast-slide-down 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toast-slide-down {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

.error_toast.hide {
    animation: toast-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toast-slide-up {
    to {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

/* 성공 토스트 메시지 */
.success_toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #10B981;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    max-width: 90%;
    animation: toast-slide-down 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.success_toast.hide {
    animation: toast-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 모달 팝업 오버레이 */
.modal_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: modal-fade-in 0.3s ease-out forwards;
}

@keyframes modal-fade-in {
    to {
        opacity: 1;
    }
}

.modal_overlay.hide {
    animation: modal-fade-out 0.3s ease-out forwards;
}

@keyframes modal-fade-out {
    to {
        opacity: 0;
    }
}

/* 모달 팝업 박스 */
.modal_popup {
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    animation: modal-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modal-scale-in {
    to {
        transform: scale(1);
    }
}

.modal_overlay.hide .modal_popup {
    animation: modal-scale-out 0.3s ease-out forwards;
}

@keyframes modal-scale-out {
    to {
        transform: scale(0.9);
    }
}

/* 모달 아이콘 */
.modal_icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal_icon.error {
    color: #EF4444;
}

.modal_icon.info {
    color: #3B82F6;
}

.modal_icon.warning {
    color: #F59E0B;
}

/* 모달 타이틀 */
.modal_title {
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 12px;
}

/* 모달 메시지 */
.modal_message {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* 모달 확인 버튼 */
.modal_btn_confirm {
    width: 100%;
    padding: 14px 24px;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal_btn_confirm:hover {
    background: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.modal_btn_confirm:active {
    transform: translateY(0);
}
