/* ===========================================
   암텍 홈페이지 메인 페이지 전용 스타일
   common.css와 함께 사용됩니다.
   =========================================== */

/* ===========================================
   1. 캐러셀 스타일
   =========================================== */

/* 캐러셀 컨테이너 */
.carousel-container {
    max-width: 1800px;
    margin: 65px auto 0;
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.carousel-item {
    min-width: 0;
    transition: transform 1s ease-in-out;
}

.carousel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    filter: brightness(0.9);
    transition: transform 1s ease-in-out;
}

/* 캐러셀 전환 애니메이션 개선 */
.carousel-item.active {
    transform: translateX(0);
}

.carousel-item-next,
.carousel-item-prev {
    transform: translateX(0);
}

.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
    transform: translateX(100%);
}

.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
    transform: translateX(-100%);
}

/* 캐러셀 프로그레스 바 */
.carousel-progress {
    position: absolute;
    bottom: 40px;
    left: 80px;
    right: 80px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 10;
    border-radius: 2px;
}

.carousel-progress-bar {
    height: 100%;
    background-color: #fff;
    width: 0%;
    transition: width 5s linear;
    border-radius: 2px;
}

/* 캐러셀 숫자 인디케이터 */
.carousel-number-indicator {
    position: absolute;
    bottom: 55px;
    right: 100px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-family: 'GmarketSansMedium', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.carousel-number-indicator:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.current-slide {
    font-weight: 600;
    color: #fff;
}

.slide-separator {
    margin: 0 2px;
    color: rgba(255, 255, 255, 0.7);
}

.total-slides {
    color: rgba(255, 255, 255, 0.7);
}

/* 캐러셀 컨트롤 버튼 */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3.5rem;
    height: 3.5rem;
    background-size: 1.8rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: linear-gradient(90deg, rgba(0,0,0,0.1), transparent);
}

.carousel-control-next:hover {
    background: linear-gradient(270deg, rgba(0,0,0,0.1), transparent);
}

/* 캐러셀 텍스트 스타일 */
.carousel-caption {
    position: absolute;
    right: 30%;
    bottom: 20%;
    left: 10%;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    color: #fff;
    text-align: left;
    animation: fadeInUp 0.8s ease-out;
}

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

.carousel-caption h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    color: #e0e0e0;
    animation: slideInLeft 0.8s ease-out 0.2s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-caption p {
    font-size: 1.5rem;
    font-family: 'GmarketSansLight', sans-serif;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    animation: slideInLeft 0.8s ease-out 0.4s both;
}

/* ===========================================
   2. 섹션 스타일
   =========================================== */

/* 섹션 타이틀 */
.section-title {
    text-align: center;
    padding: 1.2rem 2rem;
    position: relative;
    max-width: 1800px;
    margin: 50px auto 30px;
}

.section-title::before,
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #c7c1c1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.section-title::before {
    top: 0;
}

.section-title::after {
    bottom: 0;
}

.section-title h1 {
    font-size: 1.8rem;
    color: #2a2a2a;
    margin: 0;
    padding: 0.8rem 0;
    font-family: 'GmarketSansMedium', sans-serif;
}

/* 섹션 1 스타일 */
.section-1 {
    padding: 40px 0;
    background-color: #f5f7fa;
}

/* 섹션 2 스타일 */
.section-2 {
    padding: 40px 0;
    background-color: #f5f7fa;
}

/* 섹션 3 스타일 */
.section-3 {
    padding: 40px 0;
    background-color: #f5f7fa;
}

.section-1 .container,
.section-2 .container,
.section-3 .container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===========================================
   3. 카드 그리드 및 카드 스타일
   =========================================== */

/* 카드 그리드 기본 설정 */
.card-grid {
    display: grid;
    gap: 30px;
    margin-top: 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* 섹션별 카드 그리드 설정 */
.section-1 .card-grid {
    grid-template-columns: repeat(4, 320px);
    justify-content: center;
    gap: 30px;
}

.section-2 .card-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
}

.section-3 .card-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

/* 카드 기본 스타일 */
.card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    width: 320px;
    height: 400px;
    margin: 0 auto;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(26, 86, 255, 0.2);
}

/* 모바일에서는 호버 효과 비활성화 */
@media (max-width: 767.98px) {
    .card:hover {
        transform: none;
    }
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

/* 카드 이미지 */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 카드 텍스트 오버레이 */
.card-text-overlay {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    padding: 20px;
    background: transparent;
}

.card-text-overlay .card-title {
    font-family: 'GmarketSansMedium', sans-serif;
    font-weight: 500;
    color: #000;
    margin-bottom: 10px;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
}

.card:hover .card-text-overlay .card-title {
    color: #1F2937;
}

/* 카드 타이틀 밑줄 효과 */
.card-text-overlay .card-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 2px;
    width: 0;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.card:hover .card-text-overlay .card-title::after {
    width: 100%;
}

.card-text-overlay .card-text {
    font-family: 'GmarketSansLight', sans-serif;
    font-weight: 300;
    color: #000;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    transition: color 0.3s ease;
}

.card:hover .card-text-overlay .card-text {
    color: #000;
}


/* ===========================================
   4. 반응형 스타일
   =========================================== */

/* sm, md 화면에서의 캐러셀 화살표 크기 조정 */
@media (max-width: 991.98px) {
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 2rem;
        height: 2rem;
        background-size: 1rem;
        padding: 0.5rem;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 10%;
    }

    .carousel-progress {
        left: 20px;
        right: 20px;
        bottom: 25px;
    }

    .carousel-number-indicator {
        bottom: 40px;
        right: 15px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .carousel-item img {
        height: 250px;
        object-fit: contain;
        object-position: center;
        transition: transform 1s ease-in-out;
        background-color: #f8f9fa;
    }

}

/* 모바일 네비게이션 메뉴 스타일 */
@media (max-width: 1199.98px) {
    .carousel-container {
        margin-top: 65px;
        padding: 0 15px;
    }

    .carousel {
        max-width: 100%;
    }

    .carousel-caption {
        display: none;
    }
}

/* 카드 그리드 반응형 스타일 */
@media (max-width: 1199.98px) {
    .section-1 .card-grid {
        grid-template-columns: repeat(2, 280px);
        gap: 20px;
        justify-content: center;
    }
    
    .section-2 .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 800px;
    }

    .section-3 .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        max-width: 800px;
    }
    
    .card {
        width: 280px;
        height: 350px;
    }
}

@media (max-width: 767.98px) {
    .section-1,
    .section-2,
    .section-3 {
        padding: 20px 0;
        margin: 10px 0;
    }
    
    .section-1 .card-grid,
    .section-2 .card-grid,
    .section-3 .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 320px;
    }
    
    .card {
        width: 100%;
        max-width: 320px;
        height: 400px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }

    .carousel-progress {
        bottom: 20px;
    }

    .carousel-number-indicator {
        bottom: 35px;
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .carousel-item img {
        height: 300px;
        object-fit: cover;
        object-position: center;
        transition: transform 1s ease-in-out;
        background-color: #f8f9fa;
    }

    .carousel-caption {
        animation: fadeInUp 0.6s ease-out;
    }

    .carousel-caption h3 {
        font-size: 1.8rem;
        animation: slideInLeft 0.6s ease-out 0.2s both;
    }

    .carousel-caption p {
        font-size: 1.2rem;
        animation: slideInLeft 0.6s ease-out 0.4s both;
    }

    /* 섹션 타이틀 모바일 스타일 */
    .section-title {
        padding: 0.8rem 2rem;
        margin: 20px auto 30px;
    }
    
    .section-title h1 {
        font-size: 1.2rem;
        padding: 0.6rem 0;
    }

    /* 모바일 카드 스크롤 애니메이션 */
    .section-1 .card,
    .section-2 .card,
    .section-3 .card {
        opacity: 0;
        transform: translateX(-100%);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
    }

    .section-1 .card:nth-child(even),
    .section-2 .card:nth-child(even),
    .section-3 .card:nth-child(even) {
        transform: translateX(100%);
    }

    .section-1 .card.animate,
    .section-2 .card.animate,
    .section-3 .card.animate {
        opacity: 1;
        transform: translateX(0);
    }

    /* 모바일에서 스크롤 투 탑 버튼 위치 조정 - 카드와 겹치지 않도록 화면 오른쪽 끝에 배치 */
    .scroll-to-top-btn {
        right: 20px !important;
        left: auto !important;
    }
}

/* ===========================================
   5. 스크롤 투 탑 버튼 (모바일 전용)
   =========================================== */

.scroll-to-top-btn {
    position: fixed !important;
    bottom: 30px;
    right: 20px;
    left: auto;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    margin: 0;
    padding: 0;
}

.scroll-to-top-btn.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background-color: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.05);
}

.scroll-to-top-btn i {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 태블릿(768~991.98px)에서는 숨김, 모바일/데스크톱에서만 표시 가능 */
@media (min-width: 768px) and (max-width: 991.98px) {
    .scroll-to-top-btn {
        display: none !important;
    }
}