/* KAICE Slider Frontend Styles - 최적화된 구조 */

/* S-CoreDream 웹폰트 로드 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* S-CoreDream 예비 폰트 (Noto Sans KR로 대체) */
@font-face {
    font-family: 'S-CoreDream-3';
    src: local('Noto Sans KR Light'), local('NotoSansKR-Light');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* 배경 래퍼 - 페이지 전체 배경 */
.kaice-slider-background-wrapper {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: #c4d0d7;
    height: 600px; /* 고정 높이 */
    overflow: hidden;
}

/* 슬라이더 컨테이너 - 중심 컨테이너 */
.kaice-slider-container {
    position: relative;
    width: 100%;
    max-width: 1920px; /* 슬라이더 배경은 1920px 유지 */
    height: 100%; /* 부모(wrapper)의 높이 상속 */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 콘텐츠 영역 제한을 위한 래퍼 */
.kaice-slider-container .swiper-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.kaice-slider-container .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center; /* 콘텐츠 중앙 정렬 */
}

/* 슬라이드 내부 콘텐츠를 1200px로 제한 */
.kaice-slider-slide .kaice-slider-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Swiper 래퍼 */
.kaice-slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Swiper 컨테이너 */
.kaice-slider-wrapper .swiper-container {
    width: 100%;
    height: 100%;
}

.kaice-slider-wrapper .swiper-wrapper {
    height: 100%;
}

/* 슬라이드 */
.kaice-slider-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    background: #fff;
    color: #fff;
    overflow: hidden;
}

.kaice-slider-slide.has-image {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* 배경 오버레이 */
.kaice-slider-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/bg-scaled.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.83;
    z-index: 1;
}

/* 마크 이미지 */
.kaice-slider-slide .kaice-slider-mark {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background-image: url('../img/mark.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 50;
    opacity: 0.2;
    pointer-events: none;
}

/* 슬라이드 콘텐츠 */
.kaice-slider-content {
    position: relative;
    z-index: 100;
    text-align: left;
    padding: 2rem 2rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto; /* 중앙 정렬을 위해 추가 */
    width: 100%;
    box-sizing: border-box;
    /* 기본 상태: 보임 - JavaScript가 로드되지 않아도 콘텐츠가 보이도록 */
    transform: translateX(0);
    opacity: 1;
    transition: all 0.8s ease-in-out;
    transition-delay: 0s;
}

/* Swiper loop 모드로 인한 문제 해결: CSS 선택자 대신 JavaScript로만 제어 */
/* .js-loaded .kaice-slider-slide:not(.swiper-slide-active) .kaice-slider-content 규칙 제거 */

/* 활성 슬라이드 콘텐츠 */
.swiper-slide-active .kaice-slider-content {
    transform: translateX(0) !important;
    opacity: 1 !important;
    transition: all 0.8s ease-out !important;
    transition-delay: 0.2s !important;
}

.kaice-slider-title {
    font-family: 'S-CoreDream-3', 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-weight: 300;
    font-size: 0.938em;
    letter-spacing: 0.25em;
    margin-left: 0.25em;
    margin-bottom: 0.5em;
    color: #000000;
}

.kaice-slider-subtitle {
    font-size: 3.5em;
    font-weight: 300;
    line-height: 1.1;
    margin: 0.5em 0;
}

.kaice-slider-subtitle .kaice-slider-highlight {
    font-weight: 800;
    color: #408090;
}

.kaice-slider-description {
    font-size: 1.5em;
    color: #000000;
    margin-left: 0.063em;
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

/* 링크 호버 효과 */
a.kaice-slider-description:hover {
    color: #408090;
    text-decoration: none;
}

a.kaice-slider-description:hover::before {
    background-color: rgba(64, 128, 144, 0.9);
}

.kaice-slider-description::before {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    background-color: #408090;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.8em;
    flex-shrink: 0;
}



/* 컨트롤들 - 콘텐츠와 정확한 정렬 */
.kaice-slider-container .kaice-slider-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px; /* 콘텐츠 영역과 동일한 최대 너비 */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 2rem; /* 콘텐츠와 동일한 패딩 */
    padding-right: 2rem;
    box-sizing: border-box;
    z-index: 1001;
}

/* 내비게이션 버튼 */
.kaice-slider-btn {
    width: 37.5px;
    height: 37.5px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 0.75rem;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 3px 11.25px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.kaice-slider-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4.5px 15px rgba(0, 0, 0, 0.3);
}

.kaice-slider-btn:before {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'dashicons';
    font-weight: 900;
    font-size: 13.5px;
}

.kaice-slider-btn.kaice-slider-play:before {
    content: '\f04b'; /* Font Awesome play icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'dashicons';
}

.kaice-slider-btn.kaice-slider-pause:before {
    content: '\f04c'; /* Font Awesome pause icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'dashicons';
}

.kaice-slider-btn.kaice-slider-prev:before {
    content: '\f053'; /* Font Awesome chevron-left icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'dashicons';
}

.kaice-slider-btn.kaice-slider-next:before {
    content: '\f054'; /* Font Awesome chevron-right icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'dashicons';
}

/* Dashicons fallback */
.kaice-slider-btn.kaice-slider-play.fallback:before {
    content: '\f522';
    font-family: 'dashicons';
}

.kaice-slider-btn.kaice-slider-pause.fallback:before {
    content: '\f523';
    font-family: 'dashicons';
}

.kaice-slider-btn.kaice-slider-prev.fallback:before {
    content: '\f341';
    font-family: 'dashicons';
}

.kaice-slider-btn.kaice-slider-next.fallback:before {
    content: '\f345';
    font-family: 'dashicons';
}

/* Pagination */
.kaice-slider-pagination {
    margin-left: 1.5rem;
    display: flex;
    align-items: center;
    z-index: 1000;
}

.kaice-slider-pagination .swiper-pagination-bullet {
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    width: 45px;
    height: 3px;
    border-radius: 1.5px;
    margin: 0 0.375rem;
    transition: all 0.3s ease;
    opacity: 1;
    cursor: pointer;
    overflow: hidden;
}

.kaice-slider-pagination .swiper-pagination-bullet .bullet-number {
    position: absolute;
    right: 100%;
    top: 50%;
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.375rem;
    transform: translateY(-50%);
    color: #ffffff !important;
    font-size: 0.75em !important;
    font-weight: 700 !important;
    z-index: 1001 !important;
    text-shadow: 1.5px 1.5px 3px rgba(0, 0, 0, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-align: center;
    line-height: 1;
    font-family: 'Noto Sans KR', sans-serif;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 50% !important;
}

.kaice-slider-pagination .swiper-pagination-bullet .progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background-color: #ffffff !important;
    background: #ffffff !important;
    transition: none;
    border-radius: 1.5px;
    z-index: 999 !important;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    box-shadow: 0 0 2.25px rgba(255, 255, 255, 0.8) !important;
    pointer-events: none;
}

.swiper-pagination-bullet-active .progress-fill {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.swiper-pagination-bullet:not(.swiper-pagination-bullet-active) .progress-fill {
    width: 0% !important;
    transition: none !important;
}

.kaice-slider-pagination .swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scaleY(1.5);
}

/* 속도 설정 */
.kaice-slider-container[data-speed="slow"] .swiper-slide {
    transition-duration: 1000ms !important;
}

.kaice-slider-container[data-speed="normal"] .swiper-slide {
    transition-duration: 600ms !important;
}

.kaice-slider-container[data-speed="fast"] .swiper-slide {
    transition-duration: 300ms !important;
}

.kaice-slider-container .swiper-container {
    --swiper-theme-color: #007aff;
    --swiper-navigation-size: 44px;
}

.kaice-slider-container .swiper-wrapper {
    transition-timing-function: ease-in-out;
}

/* 배경 그라디언트 */
@media (min-width: 1200px) {
    .kaice-slider-background-wrapper {
        background: linear-gradient(135deg, #bcc8d1 0%, #c8d4db 50%, #b8c6d0 100%);
    }
}

@media (min-width: 2560px) {
    .kaice-slider-background-wrapper {
        background: linear-gradient(to right, #bcc8d1 0%, #c8d4db 20%, #c4d0d7 40%, #c4d0d7 60%, #c8d4db 80%, #bcc8d1 100%);
    }
}

/* 1020px 이하에서 회원 폼 숨기기 */
@media (max-width: 1020px) {
    .kaice-slider-member-form-area {
        display: none;
    }

    .kaice-slider-background-wrapper {
        height: 400px;
    }
    
    .kaice-slider-container .kaice-slider-controls {
        left: auto;
        right: 2rem;
        transform: none;
        padding-left: 0;
        padding-right: 0;
        width: auto;
        max-width: none;
        justify-content: flex-end;
    }
}

/* 1020px 이하에서 회원 폼 레이아웃 변경 */
@media (max-width: 1020px) {
    /* 기존 우측 회원 폼 숨기기 */
    .kaice-slider-member-form-area {
        display: none;
    }
    
    /* 배경 래퍼 오버플로우 보이도록 설정 */
    .kaice-slider-background-wrapper {
        overflow: visible;
    }
}

/* 1020px 이하에서만 보이는 하단 회원 폼 */
.kaice-slider-bottom-form {
    display: none; /* 기본적으로 숨김 */
    margin: 0; /* 기본 마진 제거 */
}

@media (max-width: 1020px) {
    .kaice-slider-bottom-form {
        display: block;
        position: relative;
        width: 100%;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        width: 100vw; /* 전체 뷰포트 너비 */
        background: #ffffff;
        clear: both;
        padding: 0.1px 0; /* 아주 작은 패딩으로 공간 확보 */
        margin-bottom: 2rem;
        box-sizing: border-box;
    }
    
    .kaice-slider-bottom-form-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0;
        text-align: center;
        color: #333;
        font-family: 'Noto Sans KR', sans-serif;
        min-height: 1px; /* 최소 높이 보장 */
    }
    
    /* 콘텐츠가 있을 때만 패딩과 높이 적용 */
    .kaice-slider-bottom-form-content:not(:empty) {
        padding: 2rem;
        min-height: 100px;
    }
    
    .kaice-slider-bottom-form-content h3 {
        margin: 0 0 1.5rem 0;
        font-size: 1.5rem;
        font-weight: 600;
        color: #408090;
    }
    
    .kaice-slider-bottom-form-content .form-row {
        display: flex;
        gap: 1rem;
        max-width: 600px;
        margin: 0 auto;
        align-items: center;
    }
    
    .kaice-slider-bottom-form-content .form-input {
        flex: 1;
        padding: 0.875rem 1rem;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.3s ease;
        box-sizing: border-box;
    }
    
    .kaice-slider-bottom-form-content .form-input:focus {
        outline: none;
        border-color: #408090;
    }
    
    .kaice-slider-bottom-form-content .form-button {
        padding: 0.875rem 2rem;
        background: #408090;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.3s ease;
        white-space: nowrap;
    }
    
    .kaice-slider-bottom-form-content .form-button:hover {
        background: #356b78;
    }

    /* 모바일에서 pagination 숨기기 */
    .kaice-slider-pagination {
        display: none;
    }
}

/* 모바일에서 하단 폼 조정 */
@media (max-width: 768px) {
    .kaice-slider-bottom-form-content .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .kaice-slider-bottom-form-content .form-button {
        width: 100%;
        padding: 1rem;
    }
}

/* 모바일 최적화 */
@media (max-width: 768px) {

    .kaice-slider-controls {
        display: none;
    }

    .kaice-slider-background-wrapper {
        height: 250px; /* 모바일 고정 높이 */
    }
    
    .kaice-slider-content {
        padding: 1rem 1rem 1rem 2rem;
    }
    
    /* 모바일에서 배너 스타일로 글자 크기 대폭 축소 */
    .kaice-slider-title {
        font-size: 0.6em; /* 0.875em -> 0.6em */
        margin-bottom: 0.2em;
    }
    
    .kaice-slider-subtitle {
        font-size: 1.8em; /* 2.5em -> 1.8em */
        line-height: 1.1;
        margin: 0.2em 0;
    }
    
    .kaice-slider-description {
        font-size: 1em; /* 1.4em -> 1em */
        margin-top: 0.3em;
    }
    
    .kaice-slider-description::before {
        width: 28px; /* 32px -> 28px */
        height: 28px;
        margin-right: 0.6rem;
        font-size: 0.65em; /* 0.7em -> 0.65em */
    }
    
    /* 모바일에서 컨트롤을 오른쪽 기준으로 정렬 */
    .kaice-slider-container .kaice-slider-controls {
        left: auto;
        right: 2rem;
        transform: none;
        padding-left: 0;
        padding-right: 0;
        width: auto;
        max-width: none;
        justify-content: flex-end;
    }
    
    .kaice-slider-btn {
        width: 32px;
        height: 32px;
        margin-right: 0.5rem;
    }
    
    .kaice-slider-btn:last-child {
        margin-right: 0; /* 마지막 버튼은 오른쪽 여백 제거 */
    }
    
    .kaice-slider-btn:before {
        font-size: 14px;
    }
    
    .kaice-slider-slide .kaice-slider-mark {
        width: 200px;
        height: 200px;
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .kaice-slider-background-wrapper {
        height: 220px; /* 작은 모바일 고정 높이 */
    }
    
    .kaice-slider-content {
        padding: 1rem;
    }
    
    /* 작은 모바일에서도 배너 스타일로 글자 크기 축소 */
    .kaice-slider-title {
        font-size: 0.55em; /* 0.8em -> 0.55em */
        margin-bottom: 0.2em;
    }
    
    .kaice-slider-subtitle {
        font-size: 1.6em; /* 2.2em -> 1.6em */
        line-height: 1.1;
        margin: 0.2em 0;
    }
    
    .kaice-slider-description {
        font-size: 0.9em; /* 1.2em -> 0.9em */
        margin-top: 0.3em;
    }
    
    .kaice-slider-description::before {
        width: 24px; /* 28px -> 24px */
        height: 24px;
        margin-right: 0.5rem; /* 0.6rem -> 0.5rem */
        font-size: 0.6em;
    }
    
    /* 작은 모바일에서도 컨트롤을 오른쪽 기준으로 정렬 */
    .kaice-slider-container .kaice-slider-controls {
        left: auto;
        right: 1rem;
        transform: none;
        padding-left: 0;
        padding-right: 0;
        width: auto;
        max-width: none;
        justify-content: flex-end;
    }
    
    .kaice-slider-btn {
        width: 30px;
        height: 30px;
        margin-right: 0.4rem;
    }
    
    .kaice-slider-btn:last-child {
        margin-right: 0; /* 마지막 버튼은 오른쪽 여백 제거 */
    }
    
    .kaice-slider-btn:before {
        font-size: 12px;
    }
    
    /* 작은 모바일에서도 pagination 숨기기 */
    .kaice-slider-pagination {
        display: none;
    }
    
    .kaice-slider-slide .kaice-slider-mark {
        width: 80px;
        height: 80px;
    }
}

/* 회원 폼 영역 - 슬라이더 우측에 고정된 영역 */
.kaice-slider-member-form-area {
    position: absolute;
    top: 2rem;
    right: calc((100% - 1200px) / 2 + 2rem); /* 1200px 콘텐츠 영역 기준으로 우측에 배치 */
    bottom: 2rem;
    width: 320px;
    z-index: 1002;
    pointer-events: auto;
}

/* 화면이 1200px보다 작을 때 회원 폼 위치 조정 */
@media (max-width: 1240px) {
    .kaice-slider-member-form-area {
        right: 2rem; /* 기본 우측 여백으로 복귀 */
    }
}

.kaice-slider-member-form-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 100%;
    min-height: 536px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.kaice-slider-member-form-box:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kaice-slider-member-form-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
    font-family: 'Noto Sans KR', sans-serif;
}

.kaice-slider-member-form-content h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #408090;
    text-align: center;
}

.kaice-slider-member-form-content .form-group {
    width: 100%;
    margin-bottom: 1rem;
}

.kaice-slider-member-form-content .form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.kaice-slider-member-form-content .form-input:focus {
    outline: none;
    border-color: #408090;
}

.kaice-slider-member-form-content .form-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #408090;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
}

.kaice-slider-member-form-content .form-button:hover {
    background: #356b78;
}

/* Loading state */
.kaice-slider-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 600px;
    min-height: 600px;
    background: #f5f5f5;
    color: #666;
}

.kaice-slider-loading:after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #408090;
    border-radius: 50%;
    animation: kaice-slider-spin 1s linear infinite;
}

@keyframes kaice-slider-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 모바일 반응형 디자인 */
@media (max-width: 768px) {
    /* 모바일에서 컨트롤 완전 숨김 */
    .kaice-slider-container .kaice-slider-controls {
        display: none !important;
    }
    
    /* 모바일에서 pagination도 숨김 */
    .kaice-slider-pagination {
        display: none !important;
    }
    
    /* 모바일에서 슬라이드 높이 조정 */
    .kaice-slider-background-wrapper {
        height: 300px;
    }
    
    /* 모바일에서 콘텐츠 패딩 조정 */
    .kaice-slider-content {
        padding: 1rem 1rem 1rem 2rem;
    }
    
    /* 모바일에서 글자 크기 조정 */
    .kaice-slider-title {
        font-size: 0.7em;
        margin-bottom: 0.3em;
    }
    
    .kaice-slider-subtitle {
        font-size: 2em;
        line-height: 1.2;
        margin: 0.3em 0;
    }
    
    .kaice-slider-description {
        font-size: 1.1em;
        margin-top: 0.4em;
    }
    
    .kaice-slider-description::before {
        width: 30px;
        height: 30px;
        margin-right: 0.7rem;
        font-size: 0.7em;
    }
    
    /* 모바일에서 마크 이미지 크기 조정 */
    .kaice-slider-slide .kaice-slider-mark {
        width: 150px;
        height: 150px;
        bottom: 1rem;
        right: 1rem;
    }
    
    /* 모바일에서 회원 폼 영역 숨김 */
    .kaice-slider-member-form-area {
        display: none;
    }
}
