/**
 * 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;
    }
}

/* ======================================
   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;
}