/* ==========================================================================
   1. 글로벌 초기화 및 공통 레이아웃 (Global Layout & Color System)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    background-color: #0f172a; /* 메인 배경 다크 네이비 톤 */
    color: #94a3b8; /* 기본 본문 회색 텍스트 톤 */
}

/* 프로젝트 상세 페이지의 메인 컨테이너 박스 */
.container {
    max-width: 980px;
    margin: 0 auto;
    background: #111A2E;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* 상단 메인 페이지로 돌아가는 'BACK TO HOME' 링크 */
.back-link {
    display: inline-block;
    text-decoration: none;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    margin-bottom: 40px;
    transition: color 0.2s ease, transform 0.2s ease;
}

    .back-link:hover {
        color: #38bdf8;
        transform: translateX(-4px);
    }

/* 프로젝트 제목 및 서브타이틀 영역 */
.project-header {
    margin-bottom: 50px;
}

    .project-header h1 {
        font-size: 2.5rem;
        color: #f8fafc;
        margin-bottom: 12px;
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.1;
    }

    .project-header .subtitle {
        font-size: 1.15rem;
        color: #64748b;
        margin-bottom: 25px;
    }

/* 기술 스택 배지 컨테이너 & 칩 스타일 */
.tech-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.skillstack {
    display: inline-block;
    background: rgba(56, 189, 248, 0.08); /* 네온 블루 반투명 배경 */
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.15);
    white-space: nowrap;
}

/* 섹션 대제목 언더라인 스타일 */
.section-title {
    font-size: 1.5rem;
    color: #FFFFFF;
    margin: 50px 0 20px 0;
    font-weight: 700;
    padding-bottom: 12px;
    letter-spacing: -0.01em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-content {
    padding-left: 0px;
    margin-bottom: 70px;
}

p {
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 1.8em;
    color: #94a3b8;
}

/* 유튜브 데모 영상 링크 스타일 */
.text-demo-link {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    margin-top: 12px;
    opacity: 0.85;
    transition: color 0.2s ease, transform 0.2s ease;
}

    .text-demo-link::before {
        content: '▶';
        font-size: 0.8rem;
        margin-right: 8px;
        color: #38BDF8;
        transition: transform 0.2s ease;
    }

    .text-demo-link:hover {
        opacity: 1;
        color: #38BDF8;
        transform: translateX(4px);
    }


/* ==========================================================================
   2. 인터랙티브 뷰어 대시보드 시스템 (좌측 탭 + 우측 GIF 미디어 영역)
   ========================================================================== */
.interactive-viewer-dashboard {
    display: flex;
    flex-direction: row;
    margin: 10px 0 30px 0;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    height: 484px; /* 16:9 비율 최적화 세로 높이 고정 */
}

/* 좌측 기능 선택 탭 사이드바 */
.viewer-sidebar {
    width: 220px;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    height: 100%;
}

/* 개별 탭 버튼 스타일 */
.tab-btn {
    width: 100%;
    flex: 1; /* 5개 버튼이 세로 공간을 균등하게 1/5씩 분할 */
    text-align: left;
    padding: 0 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

    .tab-btn:last-child {
        border-bottom: none;
    }

    .tab-btn .tab-title {
        display: block;
        font-weight: 600;
        font-size: 1rem;
        color: #64748B; /* 비활성화 탭 글씨 톤 */
    }

    /* 활성화(Active)된 탭 스타일 */
    .tab-btn.active {
        background: rgba(30, 41, 59, 0.5);
        position: relative;
    }

        .tab-btn.active .tab-title {
            color: #38BDF8; /* 활성화 시 스카이 블루로 변경 */
        }

        /* 활성화된 탭 왼쪽에 생기는 포인트 인디케이터 바 */
        .tab-btn.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: #38BDF8;
        }

/* 우측 미디어 디스플레이 패널 */
.viewer-display {
    flex: 1;
    width: 100%;
    height: 100%;
}

.gif-container {
    width: 100%;
    height: 100%;
    background: #020617;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 렌더링된 GIF 프리뷰 이미지 영역 */
#current-gif {
    width: 100%;
    flex: 1;
    object-fit: cover; /* 여백 없이 꽉 차게 비율 유지 */
    display: block;
    min-height: 0;
}

/* 하단 캡션 자막 바 및 모달 트리거 버튼 영역 */
.gif-caption {
    background: rgba(15, 23, 42, 0.95);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.caption-text-wrap {
    flex: 1;
    min-width: 0;
}

#gif-caption-text {
    color: #E2E8F0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 'View Details ↗' 모달 오픈 버튼 */
.spec-modal-trigger {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

    .spec-modal-trigger span {
        font-weight: 600;
        font-size: 0.85rem;
        color: #38BDF8;
    }

    .spec-modal-trigger:hover {
        background: rgba(56, 189, 248, 0.15);
        border-color: #38BDF8;
    }


/* ==========================================================================
   3. 부가 기능 리스트 레이아웃 (Extra Features Section)
   ========================================================================== */
.features-wrapper {
    margin: 5px 0 30px 0;
}

.feature-separated-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.extra-list-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    font-size: 1.1rem;
    line-height: 1.65;
}

    .extra-list-item:first-child {
        padding-top: 0;
    }

    .extra-list-item .feature-bullet {
        color: #38BDF8;
        margin-right: 14px;
        font-size: 1.2rem;
        user-select: none;
        padding-bottom: 4px;
        flex-shrink: 0;
    }

    .extra-list-item .feature-text-block {
        flex: 1;
    }

    .extra-list-item .feature-point-title {
        display: block;
        color: #FFFFFF;
        font-weight: 700;
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .extra-list-item .feature-point-desc {
        display: block;
        color: #94A3B8;
        font-size: 1.02rem;
    }


/* ==========================================================================
   4. 문서화 링크 배너 그리드 (Doxygen & Github Cards)
   ========================================================================== */
.docs-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 1:1 좌우 대칭 배치 */
    gap: 16px;
    margin-top: 10px;
}

.docs-banner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(3, 7, 18, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 160px;
}

    .docs-banner:hover {
        transform: translateY(-4px);
        border-color: rgba(56, 189, 248, 0.4);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    }

.docs-info {
    margin-bottom: 20px;
}

    .docs-info h3 {
        font-size: 1.1rem;
        color: #FFFFFF;
        margin-bottom: 6px;
    }

    .docs-info p {
        font-size: 0.88rem;
        color: #64748B;
        margin: 0;
        line-height: 1.5;
    }

.docs-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    transition: all 0.2s ease;
}

.docs-banner:hover .docs-btn {
    background: #38BDF8;
    color: #0F172A;
    border-color: #38BDF8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}


/* ==========================================================================
   5. 모달 팝업 스타일 및 세부 컴포넌트 설정 (Modal Overlay & Content GUI)
   ========================================================================== */
.modal-overlay {
    display: none; /* 기본 숨김 상태 (JS에서 flex로 전환) */
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 24, 0.8); /* 딥한 다크 백그라운드 */
    backdrop-filter: blur(6px); /* 뒷배경 블러 효과 */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #0F172A;
    border-radius: 20px;
    max-width: 740px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px 0 rgba(56, 189, 248, 0.03);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .modal-header h3 {
        margin: 0;
        font-size: 1.35rem;
        color: #FFFFFF;
        font-weight: 700;
        letter-spacing: -0.025em;
    }

.close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #64748B;
    line-height: 1;
    transition: color 0.2s ease;
}

    .close-btn:hover {
        color: #F1F5F9;
    }

.modal-body {
    padding: 28px;
    overflow-y: auto; /* 내용이 길면 내부 스크롤 생성 */
}

    .modal-body h4 {
        font-size: 1.05rem;
        color: #38BDF8;
        margin: 0 0 20px 0;
        font-weight: 700;
        letter-spacing: -0.01em;
        display: flex;
        align-items: center;
    }

        /* 제목 앞의 작은 스카이 블루 데코 바 */
        .modal-body h4::before {
            content: '';
            display: inline-block;
            width: 4px;
            height: 14px;
            background: #38BDF8;
            margin-right: 8px;
            border-radius: 2px;
        }

/* 모달 내부 불릿 리스트 스타일 */
.spec-bullets {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

    .spec-bullets li {
        font-size: 0.95rem;
        color: #94A3B8;
        margin-bottom: 18px;
        line-height: 1.7;
        position: relative;
        padding-left: 16px;
    }

        .spec-bullets li::before {
            content: "•";
            color: #38BDF8;
            font-weight: bold;
            position: absolute;
            left: 0;
            top: -1px;
        }

        .spec-bullets li:last-child {
            margin-bottom: 0;
        }

        /* 핵심 키워드 인라인 배지 디자인 (강조용 strong 태그) */
        .spec-bullets li strong {
            color: #E2E8F0 !important;
            background: rgba(56, 189, 248, 0.08);
            padding: 2px 8px;
            border-radius: 6px;
            font-weight: 600;
            margin-right: 4px;
            border: 1px solid rgba(56, 189, 248, 0.15);
            display: inline-block;
            line-height: 1.4;
        }

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    background-color: #0B1329;
}

.modal-done-btn {
    padding: 10px 24px;
    background: #1E293B;
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .modal-done-btn:hover {
        background: #38BDF8;
        color: #0F172A;
        border-color: #38BDF8;
        box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    }

/* 데이터 흐름(Data Flow) 시각화 박스 스타일 (.obj, .md5 로더 전용) */
.data-flow-box {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.flow-step {
    font-size: 0.85rem;
    font-weight: 600;
    color: #F1F5F9;
    background: rgba(30, 41, 59, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.flow-arrow {
    color: #38BDF8;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 인라인 코드 블록 강조용 스타일 (파일 확장자명 등) */
code {
    background: rgba(56, 189, 248, 0.1);
    color: #38BDF8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}


/* ==========================================================================
   6. 모바일 반응형 예외 처리 (Responsive Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
    /* 화면이 좁아지면 대시보드 구조를 가로에서 세로(Column) 형태로 전환 */
    .interactive-viewer-dashboard {
        flex-direction: column;
        height: auto;
    }

    .viewer-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .gif-caption {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .spec-modal-trigger {
        width: 100%;
        text-align: center;
    }

    /* 문서 배너 카드도 모바일에서는 1단 세로 정렬로 복원 */
    .docs-grid-wrapper {
        grid-template-columns: 1fr;
    }
}
