/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Malgun Gothic', sans-serif;
}

/* 슬라이더 컨테이너 */
.slider-container {
    position: relative;
    width: 100%;
    height: 600px; /* 고정 높이로 변경 - 메인 화면에서 확실히 보이도록 */
    min-height: 400px; /* 최소 높이 설정 */
    overflow: hidden;
    background-color: #111;
}

/* 개별 슬라이드 */
.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    display: flex;
    align-items: center;
}

/* 슬라이드별 콘텐츠 위치 설정 */
.slide-1 {
    justify-content: flex-end; /* 우측 정렬 */
    padding-right: 40px; /* 우측 여백 */
    text-align: right; /* 텍스트 우측 정렬 */
}

.slide-2 {
    justify-content: flex-start; /* 좌측 정렬 */
    padding-left: 40px; /* 좌측 여백 */
    text-align: left; /* 텍스트 좌측 정렬 */
}

/* 활성화된 슬라이드만 보이게 */
.slide.active {
    opacity: 1;
    z-index: 1;
}

/* --- 반응형 배경 이미지 설정 --- */
/* 화면이 640px 이하일 때 (모바일) */
@media (max-width: 640px) {
    .slide-1 { background-image: url('/imgs/main/newmainimg/mainimg_01_3.png'); }
    .slide-2 { background-image: url('/imgs/main/newmainimg/mainimg_02_3.png'); }
}

/* 화면이 641px ~ 980px 일 때 (태블릿) */
@media (min-width: 641px) and (max-width: 980px) {
    .slide-1 { background-image: url('/imgs/main/newmainimg/mainimg_01_2.png'); }
    .slide-2 { background-image: url('/imgs/main/newmainimg/mainimg_02_2.png'); }
}

/* 화면이 981px 이상일 때 (데스크탑) */
@media (min-width: 981px) {
    .slide-1 { background-image: url('/imgs/main/newmainimg/mainimg_01_1.png'); }
    .slide-2 { background-image: url('/imgs/main/newmainimg/mainimg_02_1.png'); }
}

/* 슬라이드 콘텐츠 (텍스트와 버튼) */
.slide-content {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px;
    border-radius: 10px;
    max-width: 800px;
    margin: 20px;
    z-index: 5; /* 네비게이션 버튼과 겹치지 않게 */
    animation: fadeInContent 1.5s ease-out;
}

@keyframes fadeInContent {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.slogan-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: #ffffff;
}

.slogan-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #ffffff;
}

.cta-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* --- 슬라이드 네비게이션 버튼 스타일 --- */
.slider-nav {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10; /* 항상 위에 표시 */
    display: flex;
    gap: 10px; /* 버튼 사이 간격 */
}

.nav-btn {
    background: rgba(255, 255, 255, 0.7); /* 반투명 배경 */
    border: none;
    padding: 0px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.nav-btn img {
    display: block;
}

/* 모바일 화면을 위한 반응형 디자인 */
@media (max-width: 768px) {
    .slider-container {
        height: 400px; /* 모바일에서는 높이 줄임 */
        min-height: 300px;
    }
    
    /* 모바일에서는 중앙 정렬로 변경 */
    .slide-1, .slide-2 {
        justify-content: center;
        padding-left: 20px;
        padding-right: 20px;
        text-align: center; /* 모바일에서는 텍스트도 중앙 정렬 */
    }
    
    .slide-content {
        padding: 30px;
        max-width: 90%;
    }
    .slogan-title {
        font-size: 1.8rem;
    }
    .slogan-description {
        font-size: 1rem;
    }
    .slider-nav {
        top: 10px;
        right: 10px;
    }
}

/* 태블릿 크기에서의 높이 조정 */
@media (min-width: 641px) and (max-width: 980px) {
    .slider-container {
        height: 500px;
        min-height: 350px;
    }
    
    /* 태블릿에서 슬라이드별 여백 조정 */
    .slide-1 {
        padding-right: 40px;
    }
    
    .slide-2 {
        padding-left: 40px;
    }
}