/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

/* CSS variables for Design System */
:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #293548;
    --border-color: #334155;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --secondary: #0ea5e9;
    --secondary-glow: rgba(14, 165, 233, 0.15);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-sans: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* Reset Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Grid & Flex Utilities */
.grid {
    display: grid;
    gap: 24px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 100px 0 80px 0;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(50px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(50px);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-glow);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

/* Sections General */
section {
    padding: 80px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Step Roadmap (Timeline) */
.roadmap-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border-color);
    transform: translateX(-50%);
}

.roadmap-step {
    display: flex;
    margin-bottom: 60px;
    position: relative;
}

.roadmap-step:last-child {
    margin-bottom: 0;
}

.roadmap-content {
    width: 45%;
    padding: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.roadmap-content:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.1);
}

.roadmap-step:nth-child(even) {
    justify-content: flex-end;
}

.roadmap-step:nth-child(even) .roadmap-content {
    order: 2;
}

.roadmap-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-glow);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.roadmap-step:nth-child(even) .roadmap-badge {
    background: var(--secondary-glow);
    border-color: rgba(14, 165, 233, 0.3);
    color: var(--secondary);
}

.roadmap-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.roadmap-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.roadmap-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.file-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.roadmap-icon {
    position: absolute;
    left: 50%;
    top: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    font-weight: 700;
    color: var(--text-secondary);
    z-index: 2;
    transition: var(--transition);
}

.roadmap-step:hover .roadmap-icon {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Interactive Tabs */
.tabs-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.4);
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-card);
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.tab-content {
    display: none;
    padding: 32px;
}

.tab-content.active {
    display: block;
}

/* Calculator Style */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: var(--font-sans);
    font-size: 15px;
    transition: var(--transition);
}

.input-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.input-suffix {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.calc-results {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.calc-results h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-row:last-child {
    border-bottom: none;
    margin-top: 12px;
    padding-top: 18px;
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.result-val {
    font-weight: 700;
}

.result-val.highlight {
    color: var(--secondary);
}

/* MOQ Table */
.moq-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.moq-table th, .moq-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.moq-table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.moq-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.moq-table tr.selected td {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 700;
}

/* Builder Interface */
.builder-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
}

.builder-panel {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
}

.builder-panel h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.builder-preview {
    background: white;
    color: #1e293b;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
    min-height: 800px;
    overflow-x: auto;
    font-family: Arial, sans-serif;
    position: relative;
}

/* Print Formats for CI/PL */
.preview-document {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
}

.preview-document table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    margin-bottom: 15px;
}

.preview-document th, .preview-document td {
    border: 1px solid #1e293b;
    padding: 6px 8px;
    text-align: left;
}

.preview-document th {
    background-color: #f1f5f9;
    font-weight: bold;
}

.doc-title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
}

.doc-header-table {
    width: 100%;
    margin-bottom: 15px;
}

.doc-header-table td {
    border: none;
    padding: 4px 0;
    vertical-align: top;
}

/* Shipping Mark Layout */
.shipping-mark-box {
    border: 4px solid #000;
    padding: 24px;
    width: 320px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    font-weight: 900;
    color: #000;
    background: #fff;
    text-align: left;
}

.shipping-mark-box div {
    margin-bottom: 8px;
    font-size: 14px;
}

.shipping-mark-box .mark-title {
    font-size: 18px;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-bottom: 12px;
    text-align: center;
}

/* Case Study Cards */
.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: var(--transition);
}

.case-card:hover {
    transform: translateY(-3px);
    border-color: var(--secondary);
}

.case-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--secondary);
}

.case-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.case-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

/* Consulting Form */
.consulting-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background: #0b0f19;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: center;
    font-size: 14px;
}

footer p {
    margin-bottom: 8px;
}

/* Print style override */
@media print {
    body * {
        visibility: hidden;
    }
    .builder-preview, .builder-preview * {
        visibility: visible;
    }
    .builder-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        box-shadow: none;
    }
    .no-print {
        display: none !important;
    }
}

/* Responsive adjust */
@media (max-width: 768px) {
    .roadmap-timeline::before {
        left: 20px;
    }
    .roadmap-step {
        flex-direction: column;
        padding-left: 45px;
    }
    .roadmap-content {
        width: 100%;
    }
    .roadmap-step:nth-child(even) .roadmap-content {
        order: 0;
    }
    .roadmap-icon {
        left: 20px;
        transform: translateX(-50%);
    }
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 16px;
    }
}


/* ── Export Consulting Mobile Overhaul ── */
@media (max-width: 768px) {
    header { padding: 0.8rem 1rem !important; }
    .nav-container { flex-direction: column !important; gap: 0.8rem !important; }
    nav ul { gap: 0.6rem !important; overflow-x: auto !important; width: 100% !important; padding-bottom: 0.4rem !important; white-space: nowrap !important; }
    nav ul li a { font-size: 0.82rem !important; padding: 0.4rem 0.8rem !important; }
    .hero { padding: 3rem 1rem 2rem !important; }
    .hero h1 { font-size: 1.6rem !important; line-height: 1.3 !important; }
    .hero p { font-size: 0.9rem !important; margin-bottom: 1.5rem !important; }
    .btn-group { flex-direction: column !important; gap: 0.8rem !important; width: 100% !important; }
    .btn-group .btn { width: 100% !important; text-align: center !important; }
    .calc-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .calc-results { padding: 1.2rem !important; border-radius: 16px !important; }
    .consulting-form { padding: 1.5rem 1.2rem !important; border-radius: 20px !important; }
    .roadmap-timeline { padding-left: 0 !important; }
    .roadmap-step { flex-direction: column !important; gap: 0.8rem !important; }
    .roadmap-icon { width: 36px !important; height: 36px !important; font-size: 0.9rem !important; }
    .roadmap-content { padding: 1.2rem !important; }
    table.moq-table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; width: 100% !important; }
}


/* ── STRICT MOBILE WIDTH FITTING (Fix Overflow Width) ── */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

*, *:before, *:after {
    box-sizing: border-box !important;
}

.container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    body { padding-bottom: 3rem !important; }
    .hero { padding: 2rem 0.8rem 1.5rem !important; width: 100% !important; max-width: 100% !important; }
    .hero h1 { font-size: 1.5rem !important; line-height: 1.25 !important; word-break: keep-all !important; }
    .hero p { font-size: 0.88rem !important; line-height: 1.5 !important; }
    .hero-files, .roadmap-files { word-break: break-all !important; }
    .calc-grid { display: flex !important; flex-direction: column !important; width: 100% !important; gap: 1rem !important; }
    .calc-results { padding: 1rem !important; width: 100% !important; }
    .input-wrapper input { font-size: 0.95rem !important; width: 100% !important; }
    .consulting-form { padding: 1.2rem 0.8rem !important; width: 100% !important; border-radius: 16px !important; }
    .input-control { width: 100% !important; max-width: 100% !important; font-size: 0.9rem !important; }
    
    /* Table Horizontal Scroll Wrapper for Mobile */
    .moq-table-wrap, table.moq-table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .roadmap-timeline { width: 100% !important; padding: 0 !important; }
    .roadmap-step { width: 100% !important; margin-bottom: 1rem !important; }
    .roadmap-content { width: 100% !important; padding: 1rem !important; }
}

/* Form Grid Responsive */
@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
    }
}
