@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    /* WCAG AA Compliant Colors */
    --brand-blue: #2563eb;
    --brand-indigo: #4338ca;
    --brand-green: #059669;
    --brand-pink: #db2777;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-light: #f8fafc;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 0;
    scroll-snap-type: y mandatory;
    height: 100%;
}

body { 
    font-family: 'Pretendard', sans-serif; 
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
    overscroll-behavior-y: none; /* Prevent bounce effects on mobile */
}

/* Layout */
.container-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 300px;
    background: #0f172a;
    color: var(--text-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    border-right: 1px solid #1e293b;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header { margin-bottom: 2rem; padding-left: 0.5rem; }
.sidebar-header a { text-decoration: none; display: block; }

.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.nav-header { 
    font-size: 0.75rem; 
    font-weight: 800; 
    color: #94a3b8; 
    margin-top: 2rem; 
    margin-bottom: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    padding-left: 0.75rem;
}

.nav-link { 
    display: flex; 
    align-items: center; 
    padding: 0.75rem 1rem; 
    color: #cbd5e1; 
    text-decoration: none; 
    font-size: 0.95rem; 
    border-radius: 8px; 
    transition: all 0.2s ease-out; 
    margin-bottom: 0.25rem;
}

.nav-link:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
    color: white; 
    transform: translateX(4px);
}

.nav-link.active {
    color: white;
    font-weight: 600;
    background-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.main-content {
    margin-left: 300px;
    width: calc(100% - 300px);
    height: 100vh;
    overflow-y: scroll; /* Changed from auto to scroll for snap consistency */
    scroll-snap-type: y mandatory;
    background-color: var(--bg-dark);
}

.content-section {
    min-height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 6rem;
    position: relative;
    background-color: var(--bg-light);
    box-sizing: border-box;
}

.content-section:nth-child(even) { background-color: #ffffff; }

.content-wrapper {
    max-width: 1000px;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.content-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typography */
h1.section-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #111827;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

span.section-subtitle {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 1rem;
}

.content-prose {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #334155;
    text-align: justify;
}

.content-prose h2 { font-size: 1.8rem; font-weight: 800; color: #1e293b; margin-top: 3rem; margin-bottom: 1rem; }
.content-prose h3 { font-size: 1.4rem; font-weight: 700; color: #475569; margin-top: 2rem; margin-bottom: 0.75rem; }
.content-prose p { margin-bottom: 1.25rem; }
.content-prose ul, .content-prose ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.content-prose li { margin-bottom: 0.5rem; }

/* Tables */
.table-container { 
    margin: 2.5rem 0; 
    overflow-x: auto; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
    -webkit-overflow-scrolling: touch;
}
.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: white;
    white-space: nowrap;
}
.excel-table th { background-color: #f1f5f9; padding: 1rem; text-align: left; font-weight: 700; color: #334155; border-bottom: 2px solid #e2e8f0; }
.excel-table td { padding: 1rem; border-bottom: 1px solid #f1f5f9; color: #475569; font-variant-numeric: tabular-nums; }
.excel-table tbody tr:hover { background-color: #f8fafc; }

/* Components */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.kpi-card { background: white; padding: 1.5rem; border-radius: 16px; border: 1px solid #e2e8f0; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }

.three-viewer-container {
    width: 100%;
    height: 450px;
    background: radial-gradient(circle at center, #333, #000);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin: 2.5rem 0;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    touch-action: none;
}

/* Utilities */
.modal-active { opacity: 1 !important; pointer-events: auto !important; }

/* Mobile */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,0.5); }
    .main-content { margin-left: 0; width: 100%; scroll-snap-type: y proximity; }
    .content-section { padding: 5rem 1.5rem; height: auto; min-height: 100vh; display: block; }
    h1.section-title { font-size: 2.25rem; }
    #chatbot-window { width: calc(100vw - 32px); right: 0; bottom: 80px; height: 60vh; }
    .excel-table { font-size: 0.8rem; }
}

@media print {
    .sidebar, #mobile-menu-button, #chatbot-container, .utility-toolbar { display: none !important; }
    .main-content { margin: 0; width: 100%; height: auto; overflow: visible; display: block; }
    .content-section { page-break-after: always; padding: 0; min-height: auto; display: block; }
    .content-wrapper { opacity: 1; transform: none; }
    body { background: white; color: black; }
}
