/* 나와라보험 - 컴포넌트 스타일 (Select2, SweetAlert2 커스터마이징) */

/* ================================
   Select2 커스터마이징
   ================================ */

/* Select2 기본 컨테이너 */
.select2-container--default .select2-selection--single {
    height: auto;
    min-height: clamp(36px, 5vh, 52px);
    border: 1px solid #E5E7EB;
    border-radius: clamp(6px, 0.8vh, 12px);
    background-color: #fff;
    padding: 0;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single:focus {
    outline: none;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #2563EB;
}

/* Select2 선택된 값 표시 */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333;
    line-height: 1.4;
    padding: clamp(8px, 1.3vh, 20px) clamp(10px, 1vw, 24px);
    padding-right: clamp(30px, 3vw, 50px);
    font-size: clamp(11px, 1.4vh, 18px);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9CA3AF;
    font-size: clamp(11px, 1.4vh, 18px);
}

/* Select2 화살표 */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    width: clamp(30px, 3vw, 50px);
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #9CA3AF transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-top: -3px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #2563EB transparent;
    border-width: 0 5px 6px 5px;
}

/* Select2 드롭다운 */
.select2-dropdown {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    z-index: 9999;
}

/* Select2 컨테이너 z-index */
.select2-container--open {
    z-index: 9999;
}

.select2-container--default .select2-results__option {
    padding: clamp(4px, 0.6vh, 8px) clamp(12px, 1vw, 20px);
    font-size: clamp(11px, 1.4vh, 18px);
    color: #333;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #EFF6FF;
    color: #2563EB;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #2563EB;
    color: #fff;
}

/* Select2 검색 박스 (사용시) */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #2563EB;
}

/* Select2 에러 상태 */
.form-group.has-error .select2-container--default .select2-selection--single {
    border-color: #EF4444;
}


/* ================================
   SweetAlert2 커스터마이징
   ================================ */

/* 팝업 기본 스타일 */
.swal2-popup {
    border-radius: 16px;
    padding: 30px 24px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 타이틀 */
.swal2-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
}

/* 내용 텍스트 */
.swal2-html-container {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
}

/* 아이콘 */
.swal2-icon {
    margin: 0 auto 20px;
    width: 60px;
    height: 60px;
}

.swal2-icon.swal2-success {
    border-color: #10B981;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: #10B981;
}

.swal2-icon.swal2-success [class^=swal2-success-line] {
    background-color: #10B981;
}

.swal2-icon.swal2-error {
    border-color: #EF4444;
}

.swal2-icon.swal2-error [class^=swal2-x-mark-line] {
    background-color: #EF4444;
}

.swal2-icon.swal2-warning {
    border-color: #F59E0B;
    color: #F59E0B;
}

.swal2-icon.swal2-info {
    border-color: #2563EB;
    color: #2563EB;
}

.swal2-icon.swal2-question {
    border-color: #6B7280;
    color: #6B7280;
}

/* 버튼 공통 */
.swal2-actions {
    margin-top: 24px;
    gap: 12px;
}

.swal2-styled {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    min-width: 100px;
}

/* 확인 버튼 */
.swal2-styled.swal2-confirm {
    background-color: #2563EB;
    color: #fff;
    box-shadow: none;
}

.swal2-styled.swal2-confirm:hover {
    background-color: #1D4ED8;
}

.swal2-styled.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* 취소 버튼 */
.swal2-styled.swal2-cancel {
    background-color: #F3F4F6;
    color: #6B7280;
}

.swal2-styled.swal2-cancel:hover {
    background-color: #E5E7EB;
}

.swal2-styled.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.2);
}

/* 거부/삭제 버튼 */
.swal2-styled.swal2-deny {
    background-color: #EF4444;
    color: #fff;
}

.swal2-styled.swal2-deny:hover {
    background-color: #DC2626;
}

.swal2-styled.swal2-deny:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* Toast 스타일 */
.swal2-popup.swal2-toast {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.swal2-popup.swal2-toast .swal2-title {
    font-size: 14px;
    margin: 0;
}

.swal2-popup.swal2-toast .swal2-icon {
    width: 28px;
    height: 28px;
    margin: 0 12px 0 0;
}

/* 닫기 버튼 */
.swal2-close {
    color: #9CA3AF;
    font-size: 28px;
}

.swal2-close:hover {
    color: #6B7280;
}

/* 입력 필드 (프롬프트 사용시) */
.swal2-input,
.swal2-textarea,
.swal2-select {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 배경 오버레이 */
.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.5);
}

/* 애니메이션 커스텀 */
.swal2-show {
    animation: swal2-show 0.25s ease-out;
}

.swal2-hide {
    animation: swal2-hide 0.2s ease-in;
}

@keyframes swal2-show {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes swal2-hide {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* 모바일 대응 */
@media (max-width: 480px) {
    .swal2-popup {
        padding: 24px 20px;
        width: calc(100% - 40px) !important;
        max-width: 340px;
    }

    .swal2-title {
        font-size: 18px;
    }

    .swal2-actions {
        flex-direction: column-reverse;
        width: 100%;
    }

    .swal2-styled {
        width: 100%;
        margin: 0;
    }
}
