/* Universal box-sizing for consistent layout */
* {
    box-sizing: border-box !important;
}

/* Ensure full width for body and wrapper to prevent outer margins */
html, body {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important; /* 가로 스크롤 방지 */
}

#wrap, .wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Also ensure main-area doesn't have any limiting styles */
.main-area, .main-content, .container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 메인 슬라이더 스타일 - app.css 충돌 방지 */
.main-area .main-slider {
    position: relative !important;
    width: 100% !important;
    margin: 160px 0 0 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-width: none !important; /* PC에서도 100% 너비 사용 */
}

/* app.css의 이미지 스타일 오버라이드 - 더 강력한 선택자 사용 */
.main-area .main-slider .slide-image img,
.main-slider .slide-image img,
.slide-image img {
    max-height: none !important;
    object-fit: cover !important; /* 이미지가 컨테이너를 완전히 채우도록 */
    object-position: top !important; /* 이미지 최상단이 컨테이너 최상단에 정확히 맞도록 */
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
}

.slider-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 0 !important; /* 높이를 0으로 설정 */
    padding-bottom: 35% !important; /* 2000:700 비율 = 35% */
    max-width: none !important; /* PC에서도 100% 너비 사용 */
    margin: 0 !important;
    border-radius: 0 !important; /* fullsize에서는 모서리 둥글게 하지 않음 */
    box-shadow: none !important; /* fullsize에서는 그림자 제거 */
    overflow: hidden !important; /* 배너 이미지가 영역을 벗어나지 않도록 */
}

.slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    position: relative;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: none;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.active {
    display: block;
    opacity: 1;
}

.slide-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    text-decoration: none;
    display: block;
}

.slide-image {
    position: relative;
    width: 100%;
    height: 100%;
    padding-bottom: 20px; /* 하단 여백 추가 */
    box-sizing: border-box;
}

/* app.css 충돌 방지를 위한 추가 오버라이드 */
.main-slider__bg img,
.main-slider .slide-image img,
.main-area .main-slider .slide-image img {
    max-height: none !important;
    object-fit: cover !important;
    object-position: top !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    vertical-align: top !important;
}

.mobile-img {
    display: none !important;
}

.desktop-img {
    display: block !important;
}

/* 하단 네비게이션 바 - 탭 형태 */
.slider-navigation {
    position: relative !important;
    width: 100% !important;
    max-width: none !important; /* PC에서도 100% 너비 사용 */
    height: 80px !important;
    margin: -20px 0 0 0 !important; /* 배너와 겹치도록 음수 마진 */
    background: #f5f5f5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    padding: 0 2rem !important;
    z-index: 10 !important;
    border-radius: 0 !important; /* fullsize에서는 모서리 둥글게 하지 않음 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important; /* 그림자 효과 추가 */
}

.nav-item {
    flex: 1;
    height: 60px;
    background: transparent;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.nav-item.active {
    background: #333;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    z-index: 2;
}

.nav-item span {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    padding: 0 1rem;
    color: #333;
}

.nav-item.active span {
    color: #fff;
}

.slider-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-weight: 600;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.pause-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pause-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    /* 모바일에서 슬라이더 - 100% 너비 사용 */
    .main-area .main-slider {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important; /* 모바일에서만 최대 너비 제한 제거 */
    }
    
    /* app.css의 이미지 스타일 오버라이드 */
    .main-area .main-slider .slide-image img {
        max-height: none !important;
        object-fit: contain !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    
    .slider-wrapper {
        padding-bottom: 120% !important; /* 모바일에서 더 높은 세로형 비율로 조정 */
        width: 100% !important;
        margin: 0 !important;
        max-width: none !important; /* 모바일에서만 최대 너비 제한 제거 */
        border-radius: 0 !important; /* 모바일에서는 모서리 둥글게 하지 않음 */
        box-shadow: none !important; /* 모바일에서는 그림자 제거 */
    }
    
    .slide-image {
        padding-bottom: 15px; /* 모바일에서 하단 여백 조정 */
    }
    
    .slide-image img {
        object-fit: cover !important; /* 모바일에서 이미지가 컨테이너를 꽉 채우도록 */
        object-position: top !important; /* 이미지 최상단이 컨테이너 최상단에 정확히 맞도록 */
    }
    
    .main-slider .slide .slide-image .desktop-img {
        display: none !important;
    }
    
    .main-slider .slide .slide-image .mobile-img {
        display: block !important;
    }
    
    .slider-navigation {
        height: 70px;
        padding: 0 1rem;
        margin: -15px auto 0 auto; /* 모바일에서 살짝 덜 올림 */
        max-width: none !important; /* 모바일에서만 최대 너비 제한 제거 */
        width: 100% !important; /* 모바일에서 100% 너비 사용 */
        border-radius: 0 !important; /* 모바일에서는 모서리 둥글게 하지 않음 */
    }
    
    .nav-item {
        height: 50px;
        margin: 0 0.2rem;
    }
    
    .nav-item span {
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }
    
    .slider-counter {
        font-size: 0.8rem;
        margin-left: 0.5rem;
    }
    
    /* 모바일에서 '윈터스쿨' 텍스트 숨기기 */
    .slider-navigation .nav-item span .mobile-hide {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* 작은 모바일에서 슬라이더 - 100% 너비 사용 */
    .main-area .main-slider {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important; /* 모바일에서만 최대 너비 제한 제거 */
    }
    
    /* app.css의 이미지 스타일 오버라이드 */
    .main-area .main-slider .slide-image img {
        max-height: none !important;
        object-fit: contain !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    
    .slider-wrapper {
        padding-bottom: 130% !important; /* 작은 모바일에서 더 높은 세로형 비율로 조정 */
        width: 100% !important;
        margin: 0 !important;
        max-width: none !important; /* 모바일에서만 최대 너비 제한 제거 */
        border-radius: 0 !important; /* 모바일에서는 모서리 둥글게 하지 않음 */
        box-shadow: none !important; /* 모바일에서는 그림자 제거 */
    }
    
    .slide-image {
        padding-bottom: 10px; /* 작은 모바일에서 하단 여백 조정 */
    }
    
    .slide-image img {
        object-fit: cover !important; /* 모바일에서 이미지가 컨테이너를 꽉 채우도록 */
        object-position: top !important; /* 이미지 최상단이 컨테이너 최상단에 정확히 맞도록 */
    }
    
    .main-slider .slide .slide-image .desktop-img {
        display: none !important;
    }
    
    .main-slider .slide .slide-image .mobile-img {
        display: block !important;
    }
    
    .nav-item span {
        font-size: 0.7rem;
        line-height: 1.1;
        padding: 0 0.3rem;
    }
    
    .slider-navigation {
        height: 60px;
        padding: 0 0.5rem;
        margin: -10px auto 0 auto; /* 작은 모바일에서 더 적게 올림 */
        max-width: none !important; /* 모바일에서만 최대 너비 제한 제거 */
        width: 100% !important; /* 모바일에서 100% 너비 사용 */
        border-radius: 0 !important; /* 모바일에서는 모서리 둥글게 하지 않음 */
    }
    
    .nav-item {
        height: 45px;
        margin: 0 0.1rem;
    }
    
    /* 모바일에서 '윈터스쿨' 텍스트 숨기기 */
    .slider-navigation .nav-item span {
        font-size: 0.8rem !important;
    }
    
    .slider-navigation .nav-item span .mobile-hide {
        display: none !important;
    }
}

/* 매우 큰 화면에서의 최적화 */
@media (min-width: 1400px) {
    .main-slider {
        max-width: none; /* fullsize 유지 */
    }
    
    .slide-image {
        padding-bottom: 0; /* 큰 화면에서 더 많은 하단 여백 */
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .slide {
        transition: none;
    }
}

/* 고대비 모드 */
@media (prefers-contrast: high) {
    .nav-item.active {
        background: #000;
        color: #fff;
    }
    
    .nav-item span {
        color: #000;
    }
    
    .nav-item.active span {
        color: #fff;
    }
}
