/* 
 * KSUI Common Stylesheet (style.css)
 * 여러 페이지에서 돌려 쓸 수 있게 클래스 구조를 고려한 공통 스타일시트입니다.
 */

/* 기본 렌더링 최적화 및 스무스 렌더링 */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 스크롤바 숨김 유틸리티 */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 인트로 및 페이지 트랜지션 애니메이션 */
.curtain-exit {
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.8s ease;
}

.curtain-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* 스크롤 감지 애니메이션 클래스 (reveal) */
@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 스크롤 감지 애니메이션 클래스 (reveal) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
}

.reveal.active {
    animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 스크롤 감지 애니메이션 클래스 (reveal-up) - Menu_1.html 특화 */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
}

.reveal-up.active {
    animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: box-shadow 0.3s ease;
}

.card-reveal.active {
    animation: cardRevealUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 애니메이션 딜레이 연동 유틸리티 */
.delay-75 { animation-delay: 75ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }
.delay-700 { animation-delay: 700ms; }
.delay-1000 { animation-delay: 1000ms; }

/* transition-delay 유틸리티 (Tailwind 기본값 보정) */
.delay-100 {
    transition-delay: 100ms !important;
}

.delay-200 {
    transition-delay: 200ms !important;
}

.delay-300 {
    transition-delay: 300ms !important;
}

.delay-400 {
    transition-delay: 400ms !important;
}

.delay-500 {
    transition-delay: 500ms !important;
}

@media (min-width: 768px) {
    .md\:delay-100 {
        transition-delay: 100ms !important;
    }

    .md\:delay-200 {
        transition-delay: 200ms !important;
    }

    .md\:delay-300 {
        transition-delay: 300ms !important;
    }
}

/* 라인 제한 및 고정 비율 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-4-6 {
    aspect-ratio: 4 / 6;
}

/* 인트로 커튼 애니메이션 제어 */
#intro-curtain {
    transition: transform 1.2s cubic-bezier(0.85, 0, 0.15, 1);
}

#intro-curtain.slide-up {
    transform: translateY(-100%);
}

/* 구조 프레임 그리드 패턴 배경 */
.structural-grid {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ==========================================================================
   KSUI 자랑스러운 이야기 섹션 컴포넌트 (Swiper 특화)
   ========================================================================== */
.main-proud-box {
    padding: 48px 24px 32px;
    background-color: #ffffff;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid #F1F5F9;
    width: 100%;
}

.proud-txt {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1E3A8A;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
    word-break: keep-all;
}

.main-proud-swiper {
    max-width: 1280px;
    margin: 0 auto;
    overflow: visible !important;
    padding-bottom: 0px !important;
    height: 180px !important;
}

.main-proud-swiper .swiper-slide {
    background: #F8FAFC;
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.02), 0 2px 4px -2px rgb(0 0 0 / 0.02);
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 280px;
    margin: 0 8px !important;
    height: auto !important;
    min-height: 0px !important;
    max-height: 180px !important;
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.4;
    transform: scale(0.92);
}

.main-proud-swiper .swiper-slide-active,
.main-proud-swiper .swiper-slide-next,
.main-proud-swiper .swiper-slide-prev {
    opacity: 0.85;
}

.main-proud-swiper .swiper-slide-active {
    opacity: 1 !important;
    transform: scale(1);
    background: #ffffff;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    border-color: #CBD5E1;
    height: auto !important;
}

.proud-logo-box {
    height: 32px;
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
}

.proud-logo-box img {
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.main-proud-swiper .swiper-slide-active .proud-logo-box img {
    filter: grayscale(0);
    opacity: 1;
}

.proud-con-box {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.625rem;
    flex-grow: 0;
    width: 100%;
}

.proud-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 0px;
    word-break: keep-all;
}

.proud-title span {
    color: #0F766E; /* teal */
    font-size: 1.05rem;
    display: block;
    margin-top: 0.25rem;
    font-weight: 800;
}

.proud-more {
    align-self: flex-start;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0F766E; /* teal */
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.proud-more:hover {
    color: #1E3A8A; /* navy */
    border-bottom-color: #1E3A8A;
}

/* 태블릿 및 데스크톱 기기를 위한 가로폭 제어 */
@media (min-width: 768px) {
    .main-proud-swiper .swiper-slide {
        width: 320px !important;
        margin: 0 12px !important;
    }
}

@media (min-width: 1024px) {
    .main-proud-swiper .swiper-slide {
        width: 320px !important;
        margin: 0 15px !important;
    }
}

/* 슬라이드 컨트롤러 */
.proud-control-wrap {
    max-width: 1280px;
    margin: 0.25rem auto 0.75rem;
    display: flex;
    justify-content: flex-end;
    padding: 0 1rem;
}

.main-proud-prev,
.main-proud-next {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.main-proud-prev:hover,
.main-proud-next:hover {
    background-color: #1E3A8A;
    border-color: #1E3A8A;
    color: #ffffff;
}

.main-proud-prev::before,
.main-proud-next::before {
    font-size: 1.25rem;
    color: #475569;
    transition: color 0.3s ease;
}

.main-proud-prev:hover::before,
.main-proud-next:hover::before {
    color: #ffffff;
}

.main-proud-prev::before {
    content: '←';
}

.main-proud-next::before {
    content: '→';
}

.main-proud-prev span,
.main-proud-next span {
    display: none;
}

/* 페이징 및 자동재생 프로그레스바 */
.pagination-wrap {
    max-width: 480px;
    margin: 0.25rem auto 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1rem;
}

.proud-pagination.bar {
    position: relative;
    flex-grow: 1;
    height: 3px;
    background-color: #E2E8F0;
    border-radius: 2px;
    overflow: hidden;
}

.proud-pagination.bar .swiper-pagination-progressbar-fill {
    background-color: #0F766E !important; /* teal */
}

.proud-autoplay {
    display: flex;
    gap: 0.5rem;
}

.proud-autoplay button {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #CBD5E1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.05);
}

.proud-autoplay button:hover {
    background-color: #F1F5F9;
    border-color: #94A3B8;
}

.proud-autoplay button::before {
    font-size: 0.75rem;
    color: #475569;
}

.proud-autoplay button.start::before {
    content: '▶';
}

.proud-autoplay button.pause::before {
    content: '❚❚';
    font-weight: bold;
}

.proud-autoplay button span {
    display: none;
}

/* ==========================================================================
   공통 문의 모달 팝업 스타일
   ========================================================================== */
.modal-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==========================================================================
   Menu_1.html (기관소개) 특화 스타일
   ========================================================================== */
.break-keep {
    word-break: keep-all;
}

/* reveal-up은 상단에 정의된 키프레임 애니메이션으로 전역 처리됨 */

/* ==========================================================================
   Menu_2.html (비즈니스) 특화 스타일
   ========================================================================== */
.perspective-runway {
    perspective: 80vh;
    perspective-origin: 50% 15%;
}

@keyframes slideDown {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

/* ==========================================================================
   Menu_2_1, 2_2, 2_3.html (비즈니스 서브페이지) 특화 스타일
   ========================================================================== */

/* 텍스트 채우기 애니메이션 */
.text-fill-anim {
    background-image: linear-gradient(to right, #0F172A 50%, #94A3B8 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.text-fill-anim.filled {
    background-position: 0 0;
}

/* 좌우 슬라이딩 애니메이션 */
.tw-slide-left {
    transform: translateX(-60px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tw-slide-right {
    transform: translateX(60px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tw-row.tw-active .tw-slide-left,
.tw-row.tw-active .tw-slide-right {
    transform: translateX(0);
    opacity: 1;
}

/* 워크플로우 카드 애니메이션 */
.wf-card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.6s ease;
    background-color: #F8FAFC; 
}
.wf-card.wf-enter {
    opacity: 1;
    transform: translateY(0);
}
.wf-card.painted {
    background-color: #E0F2FE !important; 
    border-color: #BAE6FD !important;
}

/* FAQ 아코디언 라인 아이콘 */
.acc-icon-wrap { 
    position: relative; 
    width: 20px; 
    height: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.acc-line-h, .acc-line-v {
    position: absolute;
    background-color: #94A3B8; 
    transition: all 0.4s ease;
}
.acc-line-h { width: 16px; height: 2px; }
.acc-line-v { width: 2px; height: 16px; }

.faq-item.active .acc-line-v { transform: rotate(90deg); background-color: #0F766E; }
.faq-item.active .acc-line-h { background-color: #0F766E; }

/* 강사 양성 과정 카드 펼침 효과 */
.unroll-card {
    transform-origin: top center;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}
.unroll-card.active {
    transform: scaleY(1);
    opacity: 1;
}

/* 드롭다운 메뉴 */
.dropdown-menu {
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 블러 해제 효과 */
.clear-blur {
    opacity: 1 !important;
    filter: blur(0px) !important;
}

/* 단계별 활성화 효과 */
.row-phase {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.row-phase.active {
    opacity: 1;
    transform: translateY(0);
}

/* 팝업 모달 트랜지션 */
#success-modal, #privacy-modal, #card-detail-modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#success-modal.show, #privacy-modal.show, #card-detail-modal.show {
    opacity: 1;
    visibility: visible;
}
#modal-card, #privacy-modal-card, #card-detail-card {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#success-modal.show #modal-card, 
#privacy-modal.show #privacy-modal-card, 
#card-detail-modal.show #card-detail-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 연구진 페이지 히어로 텍스트 모션 */
.hero-text {
    opacity: 0;
    transform: translateY(2rem);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-text.show {
    opacity: 1;
    transform: translateY(0);
}

/* 공통 모달 오버레이 및 카드 모션 제어 */
.modal-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-card {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.modal-overlay.show .modal-card {
    transform: scale(1);
    opacity: 1;
}

/* ==========================================================================
   전문가 예약 상세 페이지 (personal.html) 전용 스플래시 & 애니메이션 스타일
   ========================================================================== */
.gradient-reveal-text {
    background: linear-gradient(to right, #0F172A 50%, #94A3B8 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.gradient-reveal-text.animate-reveal {
    animation: fillText 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fillText {
    to {
        background-position: 0 0;
    }
}

.splash-text-item {
    position: absolute;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-text-item.active {
    opacity: 1;
    transform: translateY(0);
}

.splash-text-item.exit {
    opacity: 0;
    transform: translateY(-20px);
}

.custom-checkbox:checked+div {
    background-color: #1E3A8A;
    border-color: #1E3A8A;
    color: white;
}
