/* Font Import */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* MDRM 커스텀 스타일 */
body,
input,
textarea,
select,
button {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif !important;
}

/* 레이아웃 시프트 방지 (스크롤바 항상 표시) */
html {
    overflow-y: scroll;
}



:root {
    /* 라이트 모드 색상 */
    --md-primary-fg-color: #2563eb;
    --md-primary-fg-color--dark: #1e40af;
    --md-accent-fg-color: #2563eb;

    /* 커스텀 변수 */
    --custom-primary: #2563eb;
    --custom-primary-dark: #1e40af;
    --custom-secondary: #64748b;
    --custom-success: #10b981;
    --custom-warning: #f59e0b;
    --custom-danger: #ef4444;
    --custom-bg-light: #f8fafc;
    --custom-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --custom-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --text-dark: #1e293b;
    --border: #e2e8f0;
}

/* 다크모드 색상 */
[data-md-color-scheme="slate"] {
    --md-primary-fg-color: #3b82f6;
    --md-primary-fg-color--dark: #2563eb;
    --md-accent-fg-color: #3b82f6;

    --custom-primary: #3b82f6;
    --custom-primary-dark: #2563eb;
    --custom-bg-light: #1e293b;
    --custom-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --custom-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* 헤더 그라디언트 */
.md-header {
    background: linear-gradient(135deg, var(--custom-primary) 0%, var(--custom-primary-dark) 100%) !important;
    box-shadow: var(--custom-shadow-lg);
}

.md-header__inner {
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
}

/* 로고 스타일 및 간격 */
.md-logo {
    padding-right: 0 !important;
    /* 버튼 자체의 오른쪽 여백 제거 */
}

.md-logo img {
    height: 1.2rem !important;
    width: auto !important;
    margin-right: 0.2rem;
    /* 이미지와 글자 사이 미세 여백 */
}

.md-header__title {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 100px;
    margin-right: 1rem;
    margin-left: 0.1rem !important;
    /* 로고와 밀착시키기 위해 왼쪽 마진 최소화 */
}

.md-header__ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 검색 필드 반응형 최적화 */
.md-search {
    flex-grow: 0;
    flex-shrink: 1;
    display: flex;
    justify-content: flex-end;
    padding-right: 0.5rem;
}

.md-search__inner {
    width: 20rem;
    /* 기본 너비 축소 */
    min-width: 15rem;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* 부드러운 애니메이션 */
}

/* 검색창 클릭/활성화 시 확장 */
.md-search__inner:focus-within {
    width: 40rem;
    max-width: 80vw;
}

/* 검색창 스크롤 체이닝 방지 (배경 스크롤 막기) */
.md-search__scrollwrap {
    overscroll-behavior: contain;
}

/* 검색 결과 텍스트 잘림 방지 (전체 표시) */
.md-search-result__teaser {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    display: block !important;
    max-height: none !important;

    /* 라인 제한 및 박스 속성 해제 */
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

/* 배경색 - HTML과 동일 */
.md-main {
    background: #f8fafc;
}

/* 본문 영역은 흰색 */
.md-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin: 1rem;
    padding: 1rem;
}

/* 탭 영역 - 아래 공백만 제거 및 높이 고정 */
.md-tabs {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* 탭 링크 높이 고정 */
.md-tabs__link {
    padding-bottom: 0.6rem !important;
}

/* 활성 탭 인디케이터 위치 조정 */
.md-tabs__link--active::after {
    bottom: 0 !important;
}

/* 진행바와 본문 사이 공백 제거 */
.md-header+.md-container .md-tabs {
    margin-top: 0 !important;
}

/* 사이드바 너비조정 (데스크탑 전용) */
@media screen and (min-width: 76.25em) {
    .md-sidebar {
        width: 10rem;
    }

    .md-sidebar--secondary {
        width: 10rem;
    }
}

/* 본문 너비 최적화 */
.md-content__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.md-grid {
    max-width: 1600px;
}


/* 카드 스타일 개선 */
.md-typeset .admonition,
.md-typeset details {
    border-radius: 12px;
    box-shadow: var(--custom-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    font-size: 0.7rem;
}

.md-typeset .admonition:hover,
.md-typeset details:hover {
    transform: translateY(-2px);
    box-shadow: var(--custom-shadow-lg);
}

/* 코드 블록 스타일 - 프리미엄 디자인 */
.md-typeset pre {
    background: #24283b !important;
    /* 약간 더 밝은 도쿄 나이트 테마 */
    border-radius: 12px;
    padding: 2.5rem 1.2rem 1.2rem !important;
    /* 상단 헤더 공간 확보 */
    font-family: 'JetBrains Mono', 'Roboto Mono', 'Fira Code', 'Source Code Pro', 'D2Coding', 'Consolas', monospace !important;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    margin: 1.5rem 0 !important;
    line-height: 1.6;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s !important;
}

.md-typeset pre:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
}

/* 코드 블록 상단 장식 - macOS 스타일 버튼 */
.md-typeset pre::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    left: 1rem;
    width: 2.4rem;
    height: 0.5rem;
    background: radial-gradient(circle at 0.25rem 0.25rem, #ff5f56 0.25rem, transparent 0.25rem),
        radial-gradient(circle at 0.95rem 0.25rem, #ffbd2e 0.25rem, transparent 0.25rem),
        radial-gradient(circle at 1.65rem 0.25rem, #27c93f 0.25rem, transparent 0.25rem);
    z-index: 1;
}

.md-typeset pre>code {
    background: transparent !important;
    border-radius: 0;
    color: #c0caf5 !important;
    /* 기본 텍스트 색상 - 더 밝게 */
    border: none !important;
}

/* JSON/코드 syntax highlighting - 프리미엄 팔레트 */

/* 1. 기본 텍스트 색상 (더 밝게 조정) */
.md-typeset pre code {
    color: #c0caf5;
}

/* 2. 각 문법 요소별 색상 재정의 */

/* 주석, Shebang - 더 밝고 부드러운 블루그레이 */
.highlight .c,
.highlight .c1,
.highlight .ch,
.highlight .cm,
.highlight .cp,
.highlight .cpf,
.highlight .cs,
.highlight .se {
    color: #7982a9 !important;
    font-style: italic;
}

/* 문자열 - 선명한 연두색 */
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .ss {
    color: #b9f27c !important;
}

/* 숫자/상수 - 선명한 주황색 */
.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo,
.highlight .il,
.highlight .kc {
    color: #ff9e64 !important;
}

/* 키워드/예약어 - 진한 핑크/마젠타 */
.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt {
    color: #bb9af7 !important;
    font-weight: 600;
}

/* 함수명/메서드 - 시원한 블루 */
.highlight .nf,
.highlight .fm {
    color: #7aa2f7 !important;
}

/* 변수명 - 화이트/블루그레이 */
.highlight .nv,
.highlight .vi,
.highlight .vm,
.highlight .vc {
    color: #e0af68 !important;
    /* 변수는 약간 노란빛으로 강조 */
}

/* 쉘 명령어, 속성명, 일반 이름 - 에메랄드/시안 (더 폭넓게 적용) */
.highlight .nb,
.highlight .na,
.highlight .nc,
.highlight .no,
.highlight .n,
.highlight .nn,
.highlight .nx,
.highlight .py,
.highlight .nt {
    color: #73daca !important;
}

/* 연산자/괄호/구두점 - 밝은 그레이 */
.highlight .o,
.highlight .p,
.highlight .punctuation {
    color: #89ddff !important;
}

/* 인라인 코드 스타일 - HTML과 동일 */
.md-typeset code {
    background: #f8fafc !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 4px !important;
    font-family: 'JetBrains Mono', 'Roboto Mono', 'Fira Code', 'Source Code Pro', 'D2Coding', 'Consolas', monospace !important;
    font-size: 0.9em !important;
    color: #2563eb !important;
    border: 1px solid #e2e8f0 !important;
}

/* 코드 블록 내부는 인라인 스타일 제외 (위에서 설정한 색상 따름) */
.md-typeset pre code {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 테이블 스타일 - 그라디언트 제거 및 너비 고정 */
.md-typeset table:not([class]) {
    display: table !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--custom-shadow);
    border-collapse: separate;
    border-spacing: 0;
    margin: 1em 0;
    font-size: 0.7rem;
    /* 테이블 내 글자 크기 조정 */
}

/* 중첩 리스트 스타일 (공백 점) & 들여쓰기 조정 */
.md-typeset ul li ul {
    margin-left: 0 !important;
    padding-left: 0.0em !important;
    margin-top: 0.25em !important;
    margin-bottom: 0.25em !important;
}

.md-typeset ul li ul li {
    list-style-type: circle !important;
}

/* 테이블 헤더는 기본 스타일 사용 */
.md-typeset table:not([class]) th {
    font-weight: 600;
}


/* 네비게이션 버튼 스타일 - HTML과 동일 */
nav.md-tabs {
    background: #ffffff !important;
    padding: 0.5rem 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.md-tabs__list {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0 0.5rem 0;
    /* 상단 패딩 추가하여 clipping 방지 */
    overflow-x: auto;
}

.md-tabs__item {
    margin: 0;
}

.md-tabs__link {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    margin: 0;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    color: #1e293b !important;
    white-space: nowrap;
    cursor: pointer;
}

.md-tabs__link:hover {
    background: #2563eb;
    color: white !important;
    border-color: #2563eb;
    transform: translateY(-2px);
}

.md-tabs__link--active,
.md-tabs__link.active-tab,
.md-tabs__item--active .md-tabs__link {
    background: #ffffff !important;
    color: var(--custom-primary) !important;
    border: 2px solid var(--custom-primary) !important;
    font-weight: 700 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
}

/* 진행 상태 점 (Progress Dots) */
.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
    padding: 0;
    transform: none !important;
    /* 호버 효과 무시 */
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s;
    cursor: pointer;
}

.progress-dot.active {
    background: var(--custom-primary);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

.progress-dot:hover {
    background: #cbd5e1;
    transform: scale(1.1);
}

/* 제목 박스 호버 시 진행 상태 점은 영향받지 않음 */
.page-title-box:hover+.progress-indicator {
    transform: none !important;
}


/* 페이지 제목 박스 스타일 */
.page-title-box {
    background: linear-gradient(135deg, var(--custom-primary) 0%, var(--custom-primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--custom-shadow-lg);
}

.page-title-box h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.page-title-box p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}


/* 사이드바 스타일 */
.md-sidebar {
    border-radius: 0 12px 12px 0;
}

/* 검색창 스타일 */
.md-search__input {
    border-radius: 8px;
}

/* 푸터 스타일 */
.md-footer {
    background: var(--md-footer-bg-color);
    border-top: 2px solid var(--custom-primary);
}

/* 푸터 저작권 중앙 정렬 */
.md-footer-meta__inner {
    justify-content: center !important;
    text-align: center;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.md-content {
    animation: fadeIn 0.5s ease-out;
}

/* 배지 스타일 */
.md-typeset .admonition.info {
    border-color: var(--custom-primary);
}

.md-typeset .admonition.info>.admonition-title {
    background-color: rgba(37, 99, 235, 0.1) !important;
}

.md-typeset .admonition.info>.admonition-title::before {
    background-color: var(--custom-primary) !important;
}

.md-typeset .admonition.warning {
    border-color: var(--custom-warning);
}

.md-typeset .admonition.danger {
    border-color: var(--custom-danger);
}

.md-typeset .admonition.success {
    border-color: var(--custom-success);
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--custom-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--custom-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--custom-primary-dark);
}



/* 반응형 개선 */
@media (max-width: 768px) {
    .md-header__title {
        font-size: 1.2rem;
    }
}

/* 다음 단계 버튼 (Next Step Card) - 더 차분하고 작은 디자인 */
.next-step-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    margin: 2rem 0 0.5rem 0;
    max-width: 320px;
    background: var(--custom-bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
}

.next-step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--custom-primary);
    background: #ffffff;
}

[data-md-color-scheme="slate"] .next-step-card:hover {
    background: #242b38;
}

.next-step-card .next-content {
    display: flex;
    flex-direction: column;
}

.next-step-card .next-step-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--custom-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.1rem;
}

.next-step-card .next-step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--custom-primary);
}

.next-step-card .next-step-icon {
    font-size: 1.2rem;
    color: var(--custom-primary);
    transition: transform 0.3s ease;
}

.next-step-card:hover .next-step-icon {
    transform: translateX(5px);
}

/* 반응형 */
@media screen and (max-width: 768px) {
    .next-step-card {
        max-width: 100%;
    }
}

/* 랜딩 페이지 활성화 시 표준 UI 즉시 숨김 (깜빡임 방지) */
/* .manual-home-mode 가 없을 때만 숨김 */
html:not(.manual-home-mode) body:has(.landing-page-container:not(.hidden)) [data-md-component="header"],
html:not(.manual-home-mode) body:has(.landing-page-container:not(.hidden)) [data-md-component="tabs"],
html:not(.manual-home-mode) body:has(.landing-page-container:not(.hidden)) .md-sidebar,
html:not(.manual-home-mode) body:has(.landing-page-container:not(.hidden)) .md-footer {
    display: none !important;
}

/* 배경색 및 레이아웃 최적화 (랜딩 모드일 때만 적용) */
html:not(.manual-home-mode) body:has(.landing-page-container:not(.hidden)) {
    background-color: #020617 !important;
    overflow: hidden !important;
}

/* 매뉴얼 홈 모드일 때 레이아웃 복원 */
html.manual-home-mode .landing-page-container {
    display: none !important;
}

html.manual-home-mode .manual-overview-container {
    display: block !important;
}

/* 프리미엄 랜딩 페이지 (Apple Wallet 스타일) - 전체 화면 최적화 */
.landing-page-container:not(.hidden) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    background: #020617;
    color: white;
    text-align: center;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
}

.landing-page-container>* {
    position: relative;
    z-index: 10;
}

.landing-title {
    font-size: 8rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 0px;
    background: linear-gradient(to bottom, #ffffff 40%, rgba(255, 255, 255, 0.4) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    text-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.typing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4rem;
    width: 800px;
    /* Fixed wide area to stabilize the center axis */
    max-width: 90vw;
    margin-bottom: 4rem;
    position: relative;
    text-align: center;
}

.landing-subtitle {
    font-size: 1.6rem;
    color: #94a3b8;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin: 0 !important;
    display: inline-block;
    white-space: nowrap;
    /* Prevent wrapping which causes height expansion */
}

.cursor {
    font-size: 1.8rem;
    color: #3b82f6;
    margin-left: 10px;
    animation: blink 0.8s infinite;
    font-weight: 300;
    line-height: normal;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.enter-button {
    padding: 0.8rem 2.5rem;
    /* Restored more compact padding */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white !important;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: fit-content;
    /* Ensure button only takes required width */
    align-self: center;
    /* Center horizontally within parent flex */
}

.enter-button:hover {
    background: white;
    color: black !important;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 4rem;
    }

    .landing-subtitle {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }

    .typing-container {
        width: 100%;
        margin-bottom: 3rem;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* ==========================================================================
   네비게이션 & 사이드바 스타일 재정의 (Clean Style) - 배경 제거 복원
   ========================================================================== */

/* 데스크탑 화면에서만 사이드바 배경 투명화 및 스타일 적용 */
@media screen and (min-width: 76.25em) {

    /* 1. 모든 사이드바 요소 배경 투명화 */
    .md-sidebar .md-nav,
    .md-sidebar .md-nav__list,
    .md-sidebar .md-nav__item,
    .md-sidebar .md-nav__link,
    .md-sidebar .md-nav__title,
    .md-sidebar__inner,
    .md-sidebar__scrollwrap {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* 2. 네비게이션 링크 텍스트 스타일 */
    .md-sidebar .md-nav__link {
        color: var(--text-dark) !important;
        transition: color 0.15s ease, transform 0.15s ease;
    }

    /* 호버 효과 */
    .md-sidebar .md-nav__link:hover {
        color: var(--custom-primary) !important;
        transform: translateX(3px);
    }

    /* 활성화된 항목 (현재 페이지) */
    .md-sidebar .md-nav__link--active {
        color: var(--custom-primary) !important;
        font-weight: 700;
        /* 배경은 투명하거나 아주 연하게 */
        background: transparent !important;
    }

    /* 3. 최상위 섹션 제목 (DAY 1 등) 스타일 */
    .md-nav--primary .md-nav__title {
        color: var(--custom-primary) !important;
        background-color: transparent !important;
        box-shadow: none !important;
        font-weight: 700;
        pointer-events: none;
        /* 클릭 방지 */
        margin-top: 1rem;
        /* 간격 조정 */
    }
}

/* 모바일 네비게이션 드로어 스타일 복원 (배경 흰색) */
@media screen and (max-width: 76.1em) {

    .md-nav--primary,
    .md-nav--primary .md-nav__list {
        background: #ffffff !important;
    }

    .md-nav__title {
        background-color: var(--custom-primary) !important;
        color: white !important;
    }
}

/* 모바일 드로어 제목 등 특수한 title 요소 - 배경 투명화 제거 (오버랩 방지) */
/* label.md-nav__title {
    background-color: transparent !important;
    box-shadow: none !important;
} */