/* ====================================================
   layout-desktop.css - PC 데스크톱 레이아웃
   사이드바 네비게이션, 풀스크린 섹션, 반응형 디자인
   ==================================================== */

/* ============ 메인 컨텐츠 영역 ============ */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    position: relative;
    transition: margin-left 0.3s ease;
}

/* PC에서 사이드바 공간 확보 */
@media (min-width: 1025px) {
    .main-content {
        margin-left: 280px;
    }
}

/* ============ 스크롤 투 탑 버튼 ============ */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;

    width: 56px;
    height: 56px;

    background: linear-gradient(135deg, #00d4ff, #22d3ee);
    border: none;
    border-radius: 50%;

    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;

    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);

    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

/* ============ PC 전용 풀스크린 섹션 스타일 ============ */
@media (min-width: 1025px) {

    /* 섹션을 풀스크린으로 */
    section {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;

        padding: 4rem 3rem;
        margin: 0 auto;
        max-width: 100%;
    }

    /* 섹션 내부 컨텐츠 컨테이너 */
    section>* {
        max-width: 1200px;
        /* 1400px -> 1200px 가독성 최적화 */
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    /* 섹션 제목 스타일 */
    section h2 {
        font-size: 3.5rem;
        margin-bottom: 2.5rem;
        /* 2rem -> 2.5rem */
        text-align: left;
    }

    section>p {
        font-size: 1.25rem;
        margin-bottom: 4rem;
        /* 3rem -> 4rem */
    }

    /* 특정 섹션 레이아웃 조정 */

    /* About 섹션 - 2단 레이아웃 */
    #about {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
        /* 3rem -> 5rem 여유 공간 확보 */
        align-items: center;
    }

    #about h2,
    #about>p {
        grid-column: 1 / -1;
    }

    /* Skills - 그리드 중앙 정렬 */
    #skills .skills-container {
        max-width: 1000px;
        /* 1200px -> 1000px 집중도 향상 */
        margin: 0 auto;
    }

    /* Projects - 스크롤 컨테이너 중앙 */
    #projects .project-scroll-container {
        max-width: 100%;
    }

    /* Join 섹션 - 중앙 정렬 */
    #join {
        align-items: center;
        text-align: center;
        max-width: 900px;
        /* 너무 넓지 않게 제한 */
    }

    /* Contact 섹션 - 중앙 정렬 */
    #contact {
        align-items: center;
        text-align: center;
        max-width: 900px;
    }
}

/* ============ 스크롤 애니메이션 ============ */
@media (min-width: 1025px) {

    /* 섹션 페이드 인 효과 */
    section {
        opacity: 0;
        transform: translateY(40px);
        /* 50px -> 40px 조금 더 자연스럽게 */
        transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        /* easing 변경 */
    }

    section.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ 모바일 최적화 ============ */
@media (max-width: 1024px) {

    /* 모바일에서는 기존 스타일 유지 */
    .main-content {
        margin-left: 0;
    }

    section {
        min-height: auto;
        padding: 4rem 1.5rem;
        /* 2rem -> 4rem 섹션 간 구분 명확화 */
        margin-bottom: 2rem;
    }

    section h2 {
        font-size: 2rem;
    }

    /* 모바일 네비게이션 바 높이 고려 */
    .main-content {
        padding-top: 60px;
        /* 70px -> 60px */
    }

    .scroll-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* ============ 태블릿 ============ */
@media (min-width: 768px) and (max-width: 1024px) {
    section {
        padding: 3rem 2rem;
    }

    section h2 {
        font-size: 2.5rem;
    }
}

/* ============ 다크모드 조정 ============ */
body.dark-mode .scroll-to-top {
    background: linear-gradient(135deg, #22d3ee, #00d4ff);
    box-shadow: 0 4px 20px rgba(34, 211, 238, 0.5);
}

body.dark-mode .scroll-to-top:hover {
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.7);
}

/* ============ 인터랙션 개선 ============ */

/* 부드러운 스크롤 */
html {
    scroll-behavior: smooth;
}

/* 스크롤바 스타일 (Chrome, Safari) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 26, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #22d3ee);
    border-radius: 6px;
    border: 2px solid rgba(10, 14, 26, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22d3ee, #00d4ff);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #00d4ff rgba(10, 14, 26, 0.5);
}

/* ============ 접근성 개선 ============ */

/* 포커스 스타일 */
a:focus,
button:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* 키보드 네비게이션을 위한 skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #00d4ff;
    color: #0a0e1a;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ============ 성능 최적화 ============ */

/* GPU 가속 */
.sidebar,
.main-content,
.scroll-to-top {
    will-change: transform;
}

/* 이미지 로딩 최적화 */
img {
    content-visibility: auto;
}