/* 폰트 및 기본 스타일 적용 */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a; /* bg-slate-900 */
    color: #cbd5e1; /* text-slate-300 */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* [수정] v9: 부드러운 스크롤 (GPT 제안) */
html {
    scroll-behavior: smooth;
}


/* v12: 풀 페이지 스크롤 (데스크톱 전용) */
@media (min-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
    }
    .fullpage-section {
        scroll-snap-align: start;
        height: 100vh;
        width: 100%;
        overflow-y: auto; /* 컨텐츠가 100vh를 넘을 경우를 대비 */
        padding-top: 5rem; /* [수정] v11: 6rem -> 5rem */
        padding-bottom: 4rem;
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box; /* [추가] 패딩 계산 포함 */
    }
}

/* v12: 모바일 반응형 (스크롤 스냅 해제) */
@media (max-width: 767px) {
    html {
        scroll-snap-type: none;
    }
    .fullpage-section {
        height: auto; /* 모바일에선 자동 높이 */
        padding-top: 6rem;
        padding-bottom: 4rem;
        scroll-snap-align: none;
        box-sizing: border-box; /* [추가] 패딩 계산 포함 */
    }
}


/* 스크롤바 (오렌지 테마) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #7c2d12; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #f97316; }

/* 텍스트 그라데이션 (오렌지 단일 테마) */
.text-gradient {
    background-image: linear-gradient(to right, #fb923c, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 입력 필드 (오렌지 테마) */
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; border-radius: 5px;
    background: #334155; outline: none;
    opacity: 0.7; transition: opacity .2s;
}
input[type="range"]:hover { opacity: 1; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: #f97316; cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: #f97316; cursor: pointer;
}
.form-input {
    background-color: #334155; border: 1px solid #475569;
    color: white; border-radius: 8px;
    padding: 0.75rem 1rem; width: 100%; font-weight: bold;
}
.form-input:focus {
    outline: none; border-color: #f97316;
    box-shadow: 0 0 0 2px #ea580c;
}

/* [신규] v9: ::placeholder 색상 (GPT 제안) */
.form-input::placeholder {
    color: #94a3b8; /* text-slate-400 */
    opacity: 0.7;
}


/* [신규] v6 - 모바일 입력 필드 UX 개선 (Copilot) */
@media (max-width: 767px) {
    .form-input {
        padding: 1rem;
        font-size: 1.1rem;
    }
    /* [수정] v11: 모바일에서 입력창 패딩 축소 */
    .form-input, .form-input.sim-count {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        font-size: 1rem;
    }
    .form-input.amount-input {
        font-size: 1rem;
    }
}


/* 테이블 스타일 */
table th {
    padding: 1rem 1.5rem; background-color: #334155;
    color: #f1f5f9; text-align: left; font-size: 1rem;
}
table td {
    padding: 1rem 1.5rem; border-bottom: 1px solid #334155;
    font-size: 1rem;
}
table th:first-child { border-top-left-radius: 12px; }
table th:last-child { border-top-right-radius: 12px; }
table tr:last-child td { border-bottom: none; }

/* 호버 애니메이션 */
.hover-lift {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}
.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 활성 네비게이션 링크 */
.nav-link.nav-active {
    color: #f97316; /* text-orange-500 */
    font-weight: 700;
    background-color: #1e293b; /* bg-slate-800 */
}

/* 3-Track 모델 탭 스타일 */
.tab-button {
    transition: all 0.3s ease;
    color: #94a3b8; /* text-slate-400 */
    background-color: #1e293b; /* bg-slate-800 */
    border-bottom: 3px solid transparent;
}
.tab-button.tab-active {
    color: #f97316; /* text-orange-500 */
    background-color: #334155; /* bg-slate-700 */
    border-bottom-color: #f97316; /* border-orange-500 */
}
.tab-content {
    display: none; /* 탭 컨텐츠는 기본적으로 숨김 */
}

/* 시뮬레이터 에러 shake 애니메이션 */
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
.shake {
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

/* [수정] 논거 각주 스타일 (위쪽 여백 추가) */
.footnote {
    font-size: 0.8rem; /* [수정] v11: 폰트 축소 */
    color: #64748b; /* text-slate-500 */
    margin-top: 1rem; /* [수정] v11: 여백 축소 */
    border-left-width: 2px; /* border-l-2 */
    border-color: #f97316; /* border-orange-500 */
    padding-left: 0.75rem; /* pl-3 */
    font-style: italic;
    line-height: 1.4; /* [추가] v11 */
}

/* [신규] v11: 100vh 강제를 위해 폰트 축소 */
.section-message {
    font-size: 1.5rem; /* 2xl -> xl */
    font-weight: 700;
    color: #f1f5f9;
    text-align: center;
    margin-bottom: 2rem; /* mb-10 -> mb-8 */
    line-height: 1.4;
}
@media (max-width: 767px) {
    .section-message { font-size: 1.25rem; }
}


/* [수정] v13 - PDF 인쇄용 스타일 (Pure CSS, A4 Landscape) */
@media print {
    /* 페이지 기본 설정: A4 가로, 1cm 마진 */
    @page {
        size: A4 landscape;
        margin: 1cm;
    }

    /* 기본 인쇄 스타일 초기화 */
    body {
        background: #fff !important;
        color: #000 !important;
        font-family: 'Inter', sans-serif;
        font-size: 10pt; /* 가로 모드에 맞게 폰트 크기 조정 */
        line-height: 1.4;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 모든 스크롤 및 스냅 해제, 표준 흐름 */
    html, body {
        scroll-snap-type: none;
        overflow: visible;
        width: 100%;
        height: auto;
    }

    /* .fullpage-section 스타일을 인쇄용으로 리셋 */
    .fullpage-section {
        height: auto !important; /* 높이 자동 */
        width: 100% !important;
        padding: 1.5rem 0 !important; /* 패딩 조정 */
        display: block !important; /* flex 해제 */
        page-break-after: always; /* 각 섹션 후 페이지 넘김 */
        transform: none !important; /* scale 제거 */
    }

    /* [핵심] v13: 콘텐츠 블록이 페이지 중간에서 잘리는 것 방지 */
    .fullpage-section > div, 
    .bg-slate-800, 
    .grid, .grid > div,
    .hover-lift, .fade-in-up,
    .space-y-3, .space-y-4, .space-y-6, .space-y-8, .mb-8, .mb-6,
    .tab-content, .tab-content > div {
        page-break-inside: avoid !important;
    }


    /* 마지막 섹션 뒤에는 페이지 넘기지 않음 */
    #footer, #final-summary {
        page-break-after: avoid !important;
    }

    /* 인쇄 시 숨길 요소들 */
    header, #pdf-download-button, .print\:hidden, .footnote,
    .animate-pulse, .typing-cursor {
        display: none !important;
    }

    /* 애니메이션 클래스 초기화 (v11 -> v13) */
    .fade-in-up {
        opacity: 1 !important;
        transform: none !important;
    }
    .typing-text {
        min-height: 0 !important; /* 타이핑 높이 초기화 */
    }
    /* 타이핑 커서 숨기기 (v11에서 누락) */
    .typing-cursor {
        display: none !important;
    }


    /* 그라데이션 -> 단색 */
    .text-gradient {
        background-image: none !important;
        color: #f97316 !important;
    }

    /* 모든 색상 텍스트 -> 검정색 */
    h1, h2, h3, h4, p, span, div,
    .text-orange-500, .text-red-500, .text-green-500, .text-orange-400, .text-blue-400, .text-cyan-400, .text-purple-400,
    .text-white, .text-slate-300, .text-slate-400, .text-orange-300, .text-red-400, .text-yellow-400, .text-green-500, .text-cyan-400, .text-green-400,
    .text-slate-200 { /* v12 추가 */
        color: #000 !important;
    }

    /* 모든 배경색 -> 연한 회색 또는 흰색 (가독성) */
    .bg-slate-800, .bg-slate-700, .bg-orange-900\/30, .bg-orange-900\/50, .bg-slate-700\/50, 
    .bg-orange-500, .bg-cyan-500, .bg-green-500, .bg-orange-700 {
        background-color: #f1f5f9 !important; /* 연한 회색 */
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
    }
    .bg-slate-900 {
        background-color: #ffffff !important; /* 시뮬레이션 우측 배경은 흰색 */
    }
    
    /* [신규] v13 - 인쇄 시 모든 3-Track 탭 내용 보이도록 강제 (v12 실수 수정) */
    .tab-content {
        display: block !important; /* 모든 탭 컨텐츠를 강제로 표시 */
        min-height: 0 !important;
    }
    .tab-button {
        display: none !important; /* 탭 버튼 자체는 숨김 */
    }

    /* 차트 및 시뮬레이션 입력창 숨기기 */
    #incentiveChart, #simulation-inputs {
        display: none !important;
    }
    
    /* 시뮬레이션 결과(Outputs)는 보이도록 설정 */
    #simulation-outputs {
        display: block !important;
    }

    /* 인쇄 시 푸터는 마지막 페이지에 보이도록 설정 */
    footer {
        display: block !important; /* block으로 변경 */
        border: none !important;
        height: auto !important;
        width: 100% !important;
    }

    /* [신규] v9: 인쇄 전용 푸터 (내용 표시) */
    .hidden.print\:block {
        display: block !important;
    }
}
