/**
 * React Island Styles
 * 섬 아키텍처 관련 스타일
 */

/* 섬 로딩 상태 */
[data-island].island-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

[data-island].island-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: island-spin 1s linear infinite;
    z-index: 1000;
}

/* 섬 하이드레이션 완료 */
[data-island].island-hydrated {
    animation: island-fade-in 0.3s ease-out;
}

/* 섬 에러 상태 */
[data-island].island-error {
    border: 2px dashed #ff6b6b;
    padding: 20px;
    background-color: #fff5f5;
}

[data-island].island-error::after {
    content: '⚠️ React 컴포넌트 로딩 실패. 폴백 HTML을 표시합니다.';
    display: block;
    padding: 10px;
    margin-top: 10px;
    background-color: #ff6b6b;
    color: white;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
}

/* 애니메이션 */
@keyframes island-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes island-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* 섬 디버그 모드 (개발 시 사용) */
[data-island][data-debug="true"] {
    outline: 2px dashed #4ecdc4;
    position: relative;
}

[data-island][data-debug="true"]::before {
    content: attr(data-island);
    position: absolute;
    top: -24px;
    left: 0;
    background-color: #4ecdc4;
    color: white;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
    z-index: 1000;
}

/* 반응형 로딩 인디케이터 */
@media (max-width: 768px) {
    [data-island].island-loading::before {
        width: 30px;
        height: 30px;
        margin: -15px 0 0 -15px;
        border-width: 3px;
    }
}

/* ======================================
   InquiryForm 신규 JSON 폼
   ====================================== */

.questionnaire .inquiry-radio-label {
    letter-spacing: -0.32px;
}

.questionnaire [id^="q-"] {
    scroll-margin-top: 16px;
}

.questionnaire .inquiry-option-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 12px !important;
    margin: 0 !important;
}

.questionnaire .inquiry-option-list>li {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.questionnaire .inquiry-option-list>li+li {
    margin-top: 0 !important;
}

.questionnaire ol>li+li {
    border-top: 0 !important;
}

.questionnaire .inquiry-radio-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid #111827;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
}

.questionnaire .inquiry-radio-visual.is-disabled {
    border-color: #C7D0D8;
}

.questionnaire .inquiry-radio-visual.is-selected {
    border: 0;
    background: #0078D4;
}

.questionnaire .inquiry-question-disabled .inquiry-radio-visual {
    border-color: #C7D0D8;
}

.questionnaire .inquiry-question-disabled .inquiry-radio-visual.is-selected {
    border: 0;
}

.questionnaire .inquiry-radio-center {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
}

.questionnaire .inquiry-radio-input:focus-visible+.inquiry-radio-visual {
    outline: 2px solid rgba(0, 120, 212, 0.6);
    outline-offset: 2px;
}

.questionnaire .inquiry-option-with-fields {
    display: block;
}

.questionnaire .inquiry-option-main {
    flex-wrap: wrap;
}

.questionnaire .inquiry-field-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 8px 0 0 32px;
}

.questionnaire .inquiry-field-list.is-inline {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 0 0 12px;
}

.questionnaire .inquiry-field-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #000;
    font-size: 16px;
    line-height: 28px;
}

.questionnaire .inquiry-field-list.is-option-disabled .inquiry-field-item,
.questionnaire .inquiry-field-list.is-option-disabled .inquiry-integer-unit {
    color: #D9D9D9;
}

/* prefix 라벨이 없는 단위(예: "일주일에 __ 번"의 "번")는 옵션 문장의 일부이므로
   선택 안 된(비활성) 상태에서도 검정 유지 */
.questionnaire .inquiry-field-list.is-option-disabled .inquiry-integer-unit.is-persistent {
    color: #000;
}

.questionnaire .inquiry-field-label {
    white-space: nowrap;
}

.questionnaire .inquiry-integer-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
}

.questionnaire .inquiry-integer-input {
    width: 70px;
    height: 28px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: #eef2f5;
    box-sizing: border-box;
    color: #1f2933;
    font-size: 16px;
    line-height: 28px;
    text-align: right;
    transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.questionnaire .inquiry-integer-input:disabled {
    cursor: not-allowed;
    background: #e8edf1;
    color: #1f2933;
}

.questionnaire .inquiry-integer-input.is-readonly-value {
    background: #d9ebf7;
    color: #0f1720;
}

.questionnaire .inquiry-integer-input.is-editable-value {
    background: #d9ebf7;
}

.questionnaire .inquiry-integer-input.is-editable-value:not(.is-error) {
    box-shadow: none;
}

.questionnaire .inquiry-integer-input.is-error {
    box-shadow: inset 0 0 0 1px rgba(255, 115, 115, 0.75);
}

.questionnaire .inquiry-integer-input.is-editable-value:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 117, 189, 0.12);
}

.questionnaire .inquiry-integer-unit {
    color: #000;
    font-size: 16px;
    line-height: 28px;
}

.questionnaire .inquiry-question-disabled .inquiry-field-item,
.questionnaire .inquiry-question-disabled .inquiry-integer-unit {
    color: #000;
}

.questionnaire .inquiry-checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    flex-shrink: 0;
    border: 1px solid #111827 !important;
    border-radius: 4px;
    background-color: #fff;
    accent-color: #0078D4;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.questionnaire .inquiry-checkbox-input:checked {
    border: 0 !important;
    background-color: #0078D4;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7.2 5.8 10 11 4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px 14px;
}

.questionnaire .inquiry-checkbox-input:focus-visible {
    outline: 2px solid rgba(0, 120, 212, 0.6);
    outline-offset: 2px;
}

.questionnaire .inquiry-question-disabled .inquiry-checkbox-input {
    border-color: #C7D0D8 !important;
}

.questionnaire .inquiry-question-disabled .inquiry-checkbox-input:checked {
    border: 0 !important;
}

@media (max-width: 600px) {
    .questionnaire .inquiry-field-list.is-inline {
        width: 100%;
        margin: 10px 0 0 32px;
    }
}

/* ======================================
   BannerSlider 컴포넌트 스타일
   ====================================== */

/* 배너 슬라이더 컨테이너 */
#visual {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.banner-slider .swipe,
#visual .swipe {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

/* 배너 아이템 */
.banner-slider .item {
    display: none;
    width: 100%;
    min-height: 400px;
    background-size: cover;
    transition: opacity 0.6s ease-in-out;
}

.banner-slider .item.active {
    display: block;
    animation: banner-fade-in 0.6s ease-in-out;
}

/* 배너 내부 컨텐츠 */
.banner-slider .wfix {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

.banner-slider .inner {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-slider .inner strong {
    display: block;
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.3;
}

.banner-slider .inner .emph {
    color: #4ecdc4;
    font-style: normal;
}

.banner-slider .inner p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.95;
}

/* Slick 스타일 dots */
.banner-slider .slick-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.banner-slider .slick-dots button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    font-size: 0;
    transition: all 0.3s ease;
}

.banner-slider .slick-dots button.active {
    background-color: white;
    width: 32px;
    border-radius: 6px;
}

.banner-slider .slick-dots button:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* 배너 페이드인 애니메이션 */
@keyframes banner-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 반응형 */
@media (max-width: 768px) {
    .banner-slider .item {
        min-height: 300px;
    }

    .banner-slider .wfix {
        padding: 40px 15px;
    }

    .banner-slider .inner strong {
        font-size: 28px;
    }

    .banner-slider .inner p {
        font-size: 14px;
    }

    .banner-slider .slick-dots {
        bottom: 15px;
    }
}

/* ======================================
   스켈레톤 로딩 애니메이션
   ====================================== */

/* 스켈레톤 공통 애니메이션 */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    animation: skeleton-fade-out 0.3s ease-out forwards;
}

@keyframes skeleton-fade-out {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* 스켈레톤 기본 스타일 */
.skeleton>* {
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

/* ============================================
   공지사항 스켈레톤
   ============================================ */
.skeleton-notice ul.list_notice {
    padding: 0;
    margin: 0;
}

.skeleton-notice ul.list_notice li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.skeleton-notice ul.list_notice li:last-child {
    margin-bottom: 0;
}

.skeleton-badge {
    width: 40px;
    height: 20px;
    background: linear-gradient(90deg, #ffe0e0 0px, #fff0f0 40px, #ffe0e0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 10px;
    flex-shrink: 0;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    flex: 1;
}

.skeleton-text-long {
    width: 70%;
}

.skeleton-text-medium {
    width: 50%;
}

.skeleton-text-short {
    width: 30%;
}

.skeleton-text-mini {
    width: 60px;
}

.skeleton-date {
    width: 80px;
    height: 14px;
    background: linear-gradient(90deg, #e8e8e8 0px, #f0f0f0 40px, #e8e8e8 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ============================================
   사용자 정보 스켈레톤
   ============================================ */
.skeleton-userinfo {
    padding: 0;
}

.skeleton-userinfo .hd_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
}

.skeleton-userinfo .cont {
    padding: 0 15px 15px;
}

.skeleton-userinfo dl {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.skeleton-userinfo dt {
    width: 80px;
}

.skeleton-userinfo dd {
    flex: 1;
}

.skeleton-label {
    width: 60px;
    height: 14px;
    background: linear-gradient(90deg, #e0e0e0 0px, #f0f0f0 40px, #e0e0e0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-value {
    width: 100px;
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-value-price {
    width: 120px;
    height: 20px;
    background: linear-gradient(90deg, #e8f5e9 0px, #f1f8f4 40px, #e8f5e9 80px);
    background-size: 200px 100%;
}

.skeleton-value-long {
    width: 180px;
}

/* ============================================
   테이블 스켈레톤
   ============================================ */
.skeleton-table {
    padding: 0;
}

.skeleton-table table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table thead tr {
    background-color: #fafafa;
}

.skeleton-table th,
.skeleton-table td {
    padding: 12px 8px;
    text-align: center;
}

.skeleton-th {
    width: 80%;
    height: 14px;
    margin: 0 auto;
    background: linear-gradient(90deg, #e0e0e0 0px, #f0f0f0 40px, #e0e0e0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-td {
    width: 70%;
    height: 14px;
    margin: 0 auto;
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-td-long {
    width: 85%;
}

.skeleton-td-btn {
    width: 60px;
    height: 28px;
    margin: 0 auto;
    background: linear-gradient(90deg, #e3f2fd 0px, #f1f8ff 40px, #e3f2fd 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

/* 배너 스켈레톤 */
.skeleton-banner {
    width: 100%;
    height: 400px;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.skeleton-banner-item {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            #e0e0e0 0%,
            #f0f0f0 20%,
            #e8e8e8 40%,
            #f0f0f0 60%,
            #e0e0e0 100%);
    background-size: 400% 100%;
    animation: skeleton-banner-loading 2s infinite;
}

@keyframes skeleton-banner-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 반응형 스켈레톤 */
@media (max-width: 768px) {
    .skeleton-banner {
        height: 300px;
    }

    .skeleton-text-long {
        width: 80%;
    }

    .skeleton-text-medium {
        width: 60%;
    }


    .skeleton-value-long {
        width: 150px;
    }

    .skeleton-td {
        width: 80%;
        font-size: 12px;
    }

    .skeleton-th {
        width: 85%;
        font-size: 11px;
    }
}

/* React Island 테이블 최소 높이 설정 */
.tbl_div {
    min-height: 200px;
}

/* 예약 테이블과 검진이력 테이블은 더 큰 최소 높이 */
#reserveTableIsland .tbl_div,
#resultTableIsland .tbl_div {
    min-height: 150px;
}