/* 기술 및 특허 페이지 전용 스타일 */

/* contentWrap 기본 스타일 */
.technology-contentWrap {
    position: relative;
    height: calc(100vh - 125px);
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100vw;
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* 푸터가 보일 때 */
.footer-visible .technology-contentWrap {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
}

/* 메인 컨텐츠 래퍼 */
.tech-content-wrapper {
    position: fixed;
    top: 125px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0e27;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 푸터가 보일 때의 스타일 (자바스크립트로 클래스 추가) */
.footer-visible .tech-content-wrapper {
    position: relative;
    height: 100vh;
    top: auto;
}

/* 푸터가 보일 때 wrapper의 부모를 relative로 */
.footer-visible #wrapper,
.footer-visible #container_wr,
.footer-visible #container {
    position: relative !important;
}

/* 푸터가 보일 때도 전체 너비 유지 */
.footer-visible .technology-contentWrap {
    width: 100vw !important;
    max-width: none !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
}

.footer-visible .tech-content-wrapper {
    width: 100vw !important;
    max-width: none !important;
}

/* 고급스러운 배경 효과 - wrapper 내부에만 적용 */
.tech-content-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle 600px at 20% 30%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
        radial-gradient(circle 800px at 80% 70%, rgba(139, 92, 246, 0.35) 0%, transparent 45%),
        radial-gradient(circle 500px at 40% 80%, rgba(34, 211, 238, 0.3) 0%, transparent 50%),
        radial-gradient(circle 700px at 60% 20%, rgba(168, 85, 247, 0.3) 0%, transparent 45%);
    pointer-events: none;
    z-index: 1;
    animation: complexGradient 30s ease-in-out infinite;
    filter: blur(40px);
}

@keyframes complexGradient {
    0%, 100% {
        transform: rotate(0deg) scale(1) translate(0, 0);
    }
    25% {
        transform: rotate(90deg) scale(1.2) translate(-10%, 5%);
    }
    50% {
        transform: rotate(180deg) scale(1.1) translate(5%, -10%);
    }
    75% {
        transform: rotate(270deg) scale(1.3) translate(-5%, 10%);
    }
}

/* 추가 애니메이션 레이어 */
.tech-content-wrapper::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse 900px 600px at 70% 40%, rgba(251, 191, 36, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 700px 500px at 30% 60%, rgba(34, 197, 94, 0.15) 0%, transparent 60%),
        radial-gradient(circle 600px at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: overlayAnimation 35s ease-in-out infinite reverse;
    opacity: 0.6;
    filter: blur(30px);
    mix-blend-mode: screen;
}

@keyframes overlayAnimation {
    0%, 100% {
        transform: rotate(0deg) scale(1.2) translate(0, 0);
    }
    20% {
        transform: rotate(-45deg) scale(1.5) translate(10%, -5%);
    }
    40% {
        transform: rotate(-90deg) scale(1.3) translate(-5%, 10%);
    }
    60% {
        transform: rotate(-180deg) scale(1.4) translate(5%, 5%);
    }
    80% {
        transform: rotate(-270deg) scale(1.6) translate(-10%, -10%);
    }
}

/* 탭 메뉴 스타일 수정 - 어두운 배경에 맞게 */
.company-tab-menu {
    background-color: rgba(248, 248, 248, 0.95) !important;
    z-index: 101;
}

/* 좌측 상단 플로팅 텍스트 */
.floating-text {
    position: absolute;
    top: 35%;
    left: max(calc(50% - 715px), 10%);
    transform: translateY(-50%);
    z-index: 10;
    max-width: 600px;
}

.main-title {
    font-size: 72px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 30px;
    letter-spacing: -2px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    text-shadow: 
        0 0 80px rgba(59, 130, 246, 0.5),
        0 0 40px rgba(59, 130, 246, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.main-description {
    font-size: 24px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    padding: 25px 35px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

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

/* 흘러가는 텍스트 컨테이너 */
.scrolling-text-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    overflow: hidden;
    z-index: 6;
    opacity: 0;
    animation: fadeIn 1s ease 0.8s forwards;
    background: linear-gradient(to top, 
        rgba(10, 14, 39, 1) 0%, 
        rgba(10, 14, 39, 0.9) 30%,
        rgba(10, 14, 39, 0.7) 60%,
        rgba(10, 14, 39, 0) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.scrolling-text-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.scrolling-text {
    display: flex;
    white-space: nowrap;
    animation: scrollText 60s linear infinite;
}

.text-item {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
    padding-right: 60px;
    line-height: 1.6;
    transition: color 0.6s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.scrolling-text.active .text-item {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 하단 인증서 컨테이너 */
.certificate-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    height: 400px;
    overflow: visible;
    z-index: 5;
    padding-bottom: 20px;
}

.certificate-container::before {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 500px;
    background: radial-gradient(ellipse at bottom, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.certificate-list {
    display: flex;
    height: 100%;
    align-items: flex-end;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(calc(50vw - 420px));
    will-change: transform;
}

/* 인증서 아이템 */
.certificate-item {
    flex-shrink: 0;
    margin: 0 20px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    will-change: transform, opacity;
}

.certificate-item:not(.active) {
    opacity: 0.5;
    filter: brightness(0.7);
}

.certificate-paper {
    width: 200px;
    height: 283px;
    background: #ffffff;
    border: 1px solid rgba(243, 244, 246, 0.8);
    border-radius: 6px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-origin: center bottom;
}

.certificate-item:not(.active) .certificate-paper {
    background: rgba(255, 255, 255, 0.8);
}

/* 활성화된 인증서 */
.certificate-item.active {
    transform: scale(1.5) translateY(-80px);
    z-index: 100;
    opacity: 1 !important;
    filter: none !important;
    animation: floatingAnimation 3s ease-in-out infinite;
}

@keyframes floatingAnimation {
    0%, 100% {
        transform: scale(1.5) translateY(-80px);
    }
    50% {
        transform: scale(1.5) translateY(-90px);
    }
}

.certificate-item.active .certificate-paper {
    background: #ffffff !important;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 80px rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* 인증서 헤더 */
.certificate-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    position: relative;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.certificate-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
}

.certificate-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0;
    letter-spacing: -0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 인증서 본문 */
.certificate-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.certificate-subtitle {
    font-size: 13px;
    color: #334155;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.certificate-details {
    font-size: 11px;
    color: #1e293b;
    text-align: center;
    line-height: 1.6;
    margin-bottom: auto;
    font-weight: 400;
    padding: 0 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.certificate-footer {
    text-align: center;
    font-size: 10px;
    color: #475569;
    padding-top: 15px;
    position: relative;
    border-top: 1px solid rgba(59, 130, 246, 0.08);
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.certificate-footer p {
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    flex: 1;
}

.certificate-footer p:first-child {
    text-align: left;
}

.certificate-footer p:last-child {
    text-align: right;
}

/* 특허 통계 */
.patent-stats {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 12px 8px;
    background: rgba(59, 130, 246, 0.03);
    border-radius: 6px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: #334155;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 호버 효과 */
.certificate-item:not(.active):hover {
    transform: translateY(-10px);
}

.certificate-item:not(.active):hover .certificate-paper {
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(59, 130, 246, 0.1);
}

/* 애니메이션 */
.certificate-item {
    opacity: 0.5;
    animation: fadeIn 0.8s ease forwards;
}

.certificate-item.active {
    opacity: 1;
    animation: fadeInActive 0.8s ease forwards, floatingAnimation 3s ease-in-out 0.8s infinite;
}

.certificate-item:nth-child(1) { animation-delay: 0.1s; }
.certificate-item:nth-child(2) { animation-delay: 0.2s; }
.certificate-item:nth-child(3) { animation-delay: 0.3s; }
.certificate-item:nth-child(4) { animation-delay: 0.4s; }
.certificate-item:nth-child(5) { animation-delay: 0.5s; }
.certificate-item:nth-child(6) { animation-delay: 0.6s; }
.certificate-item:nth-child(7) { animation-delay: 0.7s; }
.certificate-item:nth-child(8) { animation-delay: 0.8s; }
.certificate-item:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

@keyframes fadeInActive {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 반응형 */
@media (max-width: 1430px) {
    .floating-text {
        left: 60px;
    }
}

@media (max-width: 1366px) {
    .floating-text {
        left: 40px;
    }
    
    .main-title {
        font-size: 56px;
    }
    
    .main-description {
        font-size: 20px;
        padding: 20px 30px;
    }
    
    .scrolling-text-container {
        bottom: 0;
        height: 60px;
    }
    
    .text-item {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    body {
        /* 모바일에서 터치 스크롤 최적화 */
        -webkit-overflow-scrolling: touch;
    }
    
    /* 헤더 고정 필요시 사용 */
    #hd.scrolled + .company-tab-menu {
        top: 60px !important;
    }
    /* 모바일에서는 고정 레이아웃 해제 */
    .technology-contentWrap {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .tech-content-wrapper {
        position: relative !important;
        top: auto !important;
        height: auto !important;
        min-height: 100vh;
        padding: 0 !important; /* 모바일에서 패딩 제거 */
        display: block !important;
        margin-top: -60px; /* 모바일 헤더 높이만큼 위로 올림 */
        padding-top: 150px !important; /* 콘텐츠 시작 위치 조정 */
    }
    
    /* 모바일에서 배경 효과 제거 */
    .tech-content-wrapper::before,
    .tech-content-wrapper::after {
        display: none;
    }
    
    .floating-text {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 20px 40px;
        text-align: center;
        max-width: 100%;
        padding-top: 20px; /* 여백 조정 */
    }
    
    .main-title {
        font-size: 36px;
        margin-bottom: 20px;
    }
    
    .main-description {
        font-size: 16px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.05);
    }
    
    /* 모바일에서 인증서 캐러셀 개선 */
    .certificate-container {
        position: relative;
        bottom: auto;
        height: 350px; /* 높이 증가 */
        overflow: hidden;
        padding: 0;
        margin: 20px 0;
        width: 100%;
    }
    
    .certificate-container::before {
        display: none;
    }
    
    /* 모바일 캐러셀 래퍼 */
    .certificate-carousel-wrapper {
        overflow: hidden;
        position: relative;
        width: 100%;
        height: 280px;
        touch-action: pan-y pinch-zoom;
    }
    
    .certificate-list {
        display: flex;
        transform: translateX(0);
        gap: 0;
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
        align-items: center;
        height: 100%;
        padding: 20px 0;
    }
    
    /* 드래그 중일 때 트랜지션 제거 */
    .certificate-list.dragging {
        transition: none !important;
    }
    
    .certificate-item {
        margin: 0 10px;
        flex-shrink: 0;
        opacity: 0.4;
        filter: brightness(0.6) blur(1px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: grab;
        transform: scale(0.85);
    }
    
    .certificate-item.active {
        transform: scale(1.1) translateY(-10px) !important;
        opacity: 1 !important;
        filter: none !important;
        z-index: 10;
    }
    
    /* 인접 아이템 스타일 */
    .certificate-item.prev,
    .certificate-item.next {
        opacity: 0.6;
        filter: brightness(0.8) blur(0px);
        transform: scale(0.95);
    }
    
    .certificate-paper {
        width: 160px;
        height: 226px;
        padding: 20px 15px;
        background: #ffffff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .certificate-item.active .certificate-paper {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    }
    
    /* 캐러셀 인디케이터 개선 */
    .carousel-indicators {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 15px;
        padding: 0 20px;
        height: 20px;
        align-items: center;
    }
    
    .carousel-indicator {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        position: relative;
    }
    
    .carousel-indicator.active {
        width: 24px;
        height: 8px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.9);
    }
    
    .carousel-indicator:hover {
        background: rgba(255, 255, 255, 0.5);
    }
    
    .certificate-header h2 {
        font-size: 14px;
    }
    
    .certificate-subtitle {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .certificate-details {
        font-size: 10px;
        gap: 5px;
    }
    
    .certificate-footer {
        font-size: 9px;
        padding-top: 10px;
        margin-top: 10px;
    }
    
    /* 특허 통계 조정 */
    .patent-stats {
        padding: 8px 5px;
        gap: 5px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    /* 흐르는 텍스트 모바일 조정 */
    .scrolling-text-container {
        position: relative;
        bottom: auto;
        height: 60px;
        margin-top: 40px;
        background: rgba(0, 0, 0, 0.1);
    }
    
    .text-item {
        font-size: 14px;
        padding-right: 40px;
        color: rgba(255, 255, 255, 0.9);
    }
    
    /* 작은 모바일 화면 추가 최적화 */
    @media (max-width: 480px) {
        .certificate-item {
            margin: 0 5px;
        }
        
        .certificate-paper {
            width: 140px;
            height: 198px;
            padding: 15px 12px;
        }
        
        .certificate-header h2 {
            font-size: 12px;
        }
        
        .certificate-subtitle {
            font-size: 10px;
            margin-bottom: 8px;
        }
        
        .certificate-details {
            font-size: 9px;
            gap: 4px;
        }
        
        .stat-number {
            font-size: 16px;
        }
        
        .stat-label {
            font-size: 8px;
        }
        
        .carousel-indicators {
            gap: 4px;
        }
        
        .carousel-indicator {
            width: 5px;
            height: 5px;
        }
        
        .carousel-indicator.active {
            width: 16px;
        }
    }
    
    /* 터치 스와이프 표시기 */
    .touch-indicator {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        color: rgba(255, 255, 255, 0.7);
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 24px;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        opacity: 1;
        transition: opacity 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        animation: pulseGlow 3s ease-in-out infinite;
    }
    
    @keyframes pulseGlow {
        0%, 100% { 
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.2);
        }
        50% { 
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 30px rgba(59, 130, 246, 0.4);
        }
    }
    
    .touch-indicator.hide {
        opacity: 0;
        pointer-events: none;
    }
    
    .touch-indicator::before,
    .touch-indicator::after {
        content: '←';
        font-size: 16px;
        font-weight: bold;
        animation: swipeHint 2s ease-in-out infinite;
    }
    
    .touch-indicator::after {
        content: '→';
        animation-direction: reverse;
    }
    
    @keyframes swipeHint {
        0%, 100% { 
            transform: translateX(0); 
            opacity: 0.5; 
        }
        50% { 
            transform: translateX(-5px); 
            opacity: 1; 
        }
    }
}

/* 큰 화면 최적화 */
@media (min-width: 1920px) {
    .certificate-list {
        /*justify-content: center;*/
        gap: 30px;
    }
}