/* NextE&M Solution Page Styles */
/* Extracted from our-solution.php */

/* Scroll Snap 설정 - solutions 페이지에만 적용 */
body.solutions-page {
    overflow-x: hidden;
}

html:has(body.solutions-page) {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}


.solutions-page .section {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: white;
    overflow: hidden;
    padding-top: 80px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* 세 번째 섹션은 정상 스냅 */

.solutions-page .section-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    opacity: 0.8;
    mask-image: linear-gradient(to right, transparent, black 20%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%);
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0,0,0,0.4) 0%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0) 100%
    );
    z-index: 3;
}

.section-content {
    position: relative;
    z-index: 4;
    max-width: 800px;
    padding: 4rem;
    text-align: left;
    margin-left: 10%;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-align: left;
    color: #ececee;
    /* 미묘한 다중 그림자 효과로 가독성 향상 */
    text-shadow: 
        0 0 1px rgba(0, 0, 0, 0.3),
        0 0 2px rgba(0, 0, 0, 0.2);
}

.section-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    /* 미묘한 다중 그림자 효과로 가독성 향상 */
    text-shadow: 
        0 0 1px rgba(0, 0, 0, 0.25),
        0 0 2px rgba(0, 0, 0, 0.15);
}

/* 데스크톱/모바일 서브타이틀 제어 */
.subtitle-mobile {
    display: none;
}

.highlight {
    color: #009944;
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #009944;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content.visible .highlight::after {
    transform: scaleX(1);
}

/* 섹션별 highlight 색상 */
/* 섹션1 - 녹색 유지 (기본값) */
#section1 .highlight {
    color: #009944;
}
#section1 .highlight::after {
    background: #009944;
}

/* 섹션2 - 블루 계열 */
#section2 .highlight {
    color: #003399;  /* 더 진한 파란색 */
}
#section2 .highlight::after {
    background: #003399;
}

/* 섹션3 - 회색 계열 */
#section3 .highlight {
    color: #333333;  /* 더 진한 회색 */
}
#section3 .highlight::after {
    background: #333333;
}

/* Section specific backgrounds - Note: PHP asset() function needs to be replaced with actual paths */
.solutions-page #section1 .section-bg {
    /* background-image will be set via inline style in PHP */
    opacity: 0.9;
    filter: brightness(1.2);
    mask-image: linear-gradient(to right, transparent, black 30%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 30%);
}

.solutions-page #section2 .section-bg {
    /* background-image will be set via inline style in PHP */
    mask-image: linear-gradient(to right, transparent, black 25%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 25%);
}

.solutions-page #section3 .section-bg {
    /* background-image will be set via inline style in PHP */
    mask-image: linear-gradient(to right, transparent, black 20%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%);
}

/* Section specific overlays */
#section1 .section-overlay {
    background: linear-gradient(90deg, 
        rgba(0,51,153,0.6) 0%,
        rgba(0,153,68,0.3) 45%,
        rgba(0,0,0,0) 75%
    );
}

#section2 .section-overlay {
    background: linear-gradient(90deg, 
        rgba(0,153,68,0.4) 0%,
        rgba(0,51,153,0.2) 45%,
        rgba(0,0,0,0) 75%
    );
    mix-blend-mode: multiply;
}

#section3 .section-overlay {
    background: linear-gradient(90deg, 
        rgba(0,51,153,0.4) 0%,
        rgba(0,0,0,0.2) 45%,
        rgba(0,0,0,0) 75%
    );
}

/* Data visualization elements */
.data-circle {
    width: 150px;
    height: 150px;
    border: 4px solid #009944;
    border-radius: 50%;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.8);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content.visible .data-circle {
    opacity: 1;
    transform: scale(1);
}

/* 태블릿 (1024px) */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.25rem;
    }
    
    /* 태블릿부터 모바일 버전 표시 */
    .subtitle-desktop {
        display: none;
    }
    
    .subtitle-mobile {
        display: block;
    }
    
    /* 글래스모피즘 효과 시작 */
    .section-content {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
    
}

@media (max-width: 768px) {
    /* 모바일 스크롤 스냅 비활성화 */
    html:has(body.solutions-page) {
        scroll-snap-type: none;
    }
    
    .section {
        height: auto;
        min-height: 100vh;
        scroll-snap-align: none;
        padding: 80px 0 40px;
    }
    
    .solutions-page .section-bg {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        opacity: 0.5;
        mask-image: none;
        -webkit-mask-image: none;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    .section-content {
        margin-left: 5%;
        margin-right: 5%;
        padding: 2.5rem;
        text-align: left; /* 왼쪽 정렬 유지 */
        /* 글래스모피즘 효과 강화 */
        background: rgba(255, 255, 255, 0.07);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 24px;
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.15),
            inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    
    
    /* 768px에서 1.25rem, 320px에서 0.7rem으로 선형 감소 */
    .section-title {
        /* 768px에서 2.5rem, 320px에서 1.3rem으로 선형 감소 */
        font-size: clamp(1.3rem, calc(0.44rem + 4.5vw), 2.5rem);
        /* 텍스트 그림자 추가 */
        text-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.3),
            0 4px 16px rgba(0, 0, 0, 0.2);
    }
    
    .section-subtitle {
        /* 768px에서 1.25rem, 320px에서 0.7rem으로 선형 감소 */
        font-size: clamp(0.7rem, calc(-0.14rem + 2.625vw), 1.25rem);
        /* 텍스트 그림자 추가 */
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    
    .data-circle {
        margin: 2rem 0; /* 왼쪽 정렬 */
    }
    
    .section-overlay {
        background: linear-gradient(0deg, 
            rgba(0,0,0,0.6) 0%,
            rgba(0,0,0,0.3) 100%
        );
    }
}

/* 작은 화면에서의 추가 조정 */
@media (max-width: 480px) {
    .section-content {
        margin-left: 3%;
        margin-right: 3%;
        padding: 1.5rem;
        border-radius: 16px;
        /* 모바일에서 글래스모피즘 효과 조정 */
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

@media (max-width: 320px) {
    .section-content {
        padding: 1.2rem;
        margin-left: 2%;
        margin-right: 2%;
    }
}

/* Animation keyframes */
@keyframes gridWipe {
    0% { 
        transform: translateX(0);
        opacity: 1;
        filter: blur(1px);
    }
    100% { 
        transform: translateX(100%);
        opacity: 0;
        filter: blur(3px);
    }
}

@keyframes puddleFade {
    0% { 
        opacity: 0.8;
        transform: translateY(0);
        filter: blur(2px);
    }
    100% { 
        opacity: 0;
        transform: translateY(100%);
        filter: blur(4px);
    }
}

@keyframes pathFlow {
    0% { stroke-dashoffset: 1000; }
    100% { stroke-dashoffset: 0; }
}

/* Section 1: Dust Grid Animation */
.solutions-page .dust-grid {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    mix-blend-mode: multiply;
    filter: blur(1px);
}

.grid-rect {
    fill: rgba(0, 0, 0, 0.5);
    opacity: 1;
    transform-origin: center;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.section.visible .grid-rect {
    animation: gridWipe 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

/* Section 2: Drainage Animation */
.solutions-page .puddle-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    mix-blend-mode: soft-light;
    filter: blur(2px);
}

.puddle-shape {
    fill: url(#puddle-vertical-gradient);
    opacity: 0.8;
    transform-origin: top;
}

.section.visible .puddle-shape {
    animation: puddleFade 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

/* Section 3: Smart City Animation */
.city-grid {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    z-index: 2;  /* 텍스트보다 뒤로 */
    pointer-events: none;
    mix-blend-mode: screen;
}

.route-path {
    fill: none;
    stroke: url(#route-gradient);
    stroke-width: 3;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    filter: drop-shadow(0 0 6px rgba(0, 153, 68, 0.6))
            drop-shadow(0 0 12px rgba(0, 153, 68, 0.3));
    stroke-linecap: round;
    stroke-linejoin: round;
}

.section.visible .route-path {
    animation: pathFlow 5s ease-in-out forwards;
}

/* 그라데이션 수정 */
#puddle-gradient stop {
    stop-color: #003399;
    stop-opacity: 0.4;
}

#puddle-gradient stop:last-child {
    stop-opacity: 0.1;
}

/* 도시 그리드 패턴 수정 */
#city-pattern path {
    stroke: rgba(0, 51, 153, 0.3);
    stroke-width: 1;
}

/* 초기 상태에서 애니메이션 요소들 보이게 설정 */
.grid-rect, .puddle-shape, .route-path {
    opacity: 1;
}

/* SVG 요소들의 z-index 조정 */
.dust-grid, .puddle-overlay, .city-grid {
    z-index: 5;
}

@media (max-width: 768px) {
    .solutions-page .dust-grid,
    .solutions-page .puddle-overlay,
    .solutions-page .city-grid {
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.5;
    }
}

/* Grid 패턴 수정 */
#grid-pattern rect {
    fill: black;
    opacity: 0.6;
    rx: 2;
    ry: 2;
}

/* 먼지 입자 스타일 수정 */
.dust-particles {
    opacity: 0.8;
    mix-blend-mode: screen;
    filter: blur(2px);
}

.section.visible .dust-particles {
    animation: gridWipe 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.8s;
}

/* 두 번째, 세 번째 경로의 애니메이션 딜레이 조정 */
.route-path:nth-child(3) {
    animation-delay: 0s;
}

.route-path:nth-child(4) {
    animation-delay: 0.8s;
}

.route-path:nth-child(5) {
    animation-delay: 1.6s;
}

.product-detail-cta {
    padding: 6rem 5%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    scroll-snap-align: center; /* CTA 섹션 중앙에 스냅 */
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.button-icon {
    font-size: 1.5rem;
}

.button-text {
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .cta-content h2 {
        /* 768px에서 2rem, 320px에서 1.1rem으로 선형 감소 */
        font-size: clamp(1.1rem, calc(-0.3rem + 4.375vw), 2rem);
    }
    
    .cta-content p {
        /* 768px에서 1.1rem, 320px에서 0.65rem으로 선형 감소 */
        font-size: clamp(0.65rem, calc(-0.58rem + 3.84vw), 1.1rem);
    }
    
    .cta-buttons {
        flex-direction: column;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 320px) {
    .product-detail-cta {
        padding: 3rem 5%;
    }
}
