* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: #525659; /* Standard document viewer background */
    min-height: 100vh;
    display: block;
    padding: 80px 350px 40px 250px;
    transition: padding 0.3s ease;
}

body.sidebar-hidden { padding-left: 0; }
body.ai-hidden { padding-right: 0; }

/* File Explorer Sidebar */
.file-explorer {
    position: fixed;
    top: 60px; left: 0; bottom: 0;
    width: 250px;
    background: #252526;
    color: #cccccc;
    font-family: sans-serif;
    font-size: 12px;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid #333;
    transition: transform 0.3s ease;
}

.file-explorer.hidden { transform: translateX(-100%); }

.explorer-header {
    padding: 12px 15px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #858585;
    border-bottom: 1px solid #333;
}

.explorer-group { padding-top: 5px; }
.explorer-group-title {
    padding: 6px 15px;
    font-weight: 600;
    color: #eee;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2d2d2d;
    font-size: 11px;
}

.explorer-list { list-style: none; }
.explorer-item a {
    padding: 5px 30px;
    display: block;
    color: #cccccc;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorer-item a:hover {
    background: #37373d;
    color: white;
}

.explorer-item.active a {
    background: #094771;
    color: white;
}

/* Toolbar */
.workstation-toolbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2000;
    color: white;
}

.toolbar-brand { display: flex; align-items: center; gap: 10px; }
.toolbar-brand span { font-family: sans-serif; font-size: 14px; }

.search-input {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 12px;
    color: white;
    font-size: 14px;
    width: 250px;
}

.toolbar-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.toolbar-btn.primary { background: #1a5f99; }
.toolbar-btn:hover { background: #444; }

/* Sidebar */
.ai-sidebar {
    position: fixed;
    top: 60px; right: 0; bottom: 0;
    width: 350px;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    z-index: 1500;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.ai-sidebar.hidden { transform: translateX(100%); }

.sidebar-header {
    padding: 15px;
    background: #1a5f99;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-history {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-family: sans-serif;
    font-size: 13px;
    color: #333;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background: white;
}

.sidebar-footer textarea {
    width: 100%;
    height: 80px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px;
    resize: none;
    font-family: sans-serif;
    margin-bottom: 10px;
}

.sidebar-footer button {
    width: 100%;
    padding: 10px;
    background: #1a5f99;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.page { 
    background: #ffffff;
    width: 210mm; /* A4 width */
    height: 297mm; /* A4 height */
    margin: 0 auto 20px auto;
    box-shadow: 
        0 0 10px rgba(0,0,0,0.5);
    position: relative;
    padding: 18mm 16mm;
    color: #000;
    background-image: 
        linear-gradient(45deg, rgba(0,102,51,0.02) 25%, transparent 25%, transparent 75%, rgba(0,102,51,0.02) 75%),
        linear-gradient(45deg, rgba(255,215,0,0.02) 25%, transparent 25%, transparent 75%, rgba(255,215,0,0.02) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    overflow: hidden;
    isolation: isolate;
    page-break-after: always;
}

.page > * {
    position: relative;
    z-index: 1;
}

.page:last-child {
    page-break-after: auto;
}

.page::before {
    content: "";
    position: absolute;
    top: 25%;
    left: 15%;
    width: 70%;
    height: 50%;
    background: url("../img/arybit-logo.svg") no-repeat center;
    background-size: contain;
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

.page::after {
    content: "ARYBIT TECHNOLOGIES // CONFIDENTIAL";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180%;
    text-align: center;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 48px;
    letter-spacing: 2px;
    color: #888;
    opacity: 0.05;
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}

/* Header Section */
.header {
    border-bottom: 2px solid #000;
    padding-bottom: 15px;
    margin-bottom: 10px;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.9; /* Slightly reduce for formal tone */
}

.header-info {
    text-align: center;
    flex: 1;
    padding: 0;
}

.header-title {
    font-size: 22px;
    font-weight: bold;
    color: #1a5f99; /* From Arybit logo */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.header-subtitle {
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-top: 2px;
    margin-bottom: 8px;
}

.header-meta {
    font-size: 12px;
    margin-bottom: 4px;
}

.header-divider {
    border: none;
    border-top: 1px solid #000;
    margin: 6px 0 4px 0;
}

.doc-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #eee;
    padding: 5px;
    border: 1px solid #000;
    display: block;
    text-align: center;
    margin-top: 5px;
}

/* Main Content Body */
.content-body {
    padding-top: 10px;
    line-height: 1.4;
    font-size: 11pt;
}

.content-body h2 {
    font-size: 15pt;
    font-weight: bold;
    color: #000;
    border-bottom: 1.5px solid #000;
    padding-bottom: 6px;
    margin-top: 24px;
    margin-bottom: 16px;
    page-break-after: avoid;
    page-break-inside: avoid;
}

.content-body h3 {
    font-size: 12pt;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    page-break-inside: avoid;
    page-break-after: avoid;
}

.content-body p {
    margin-bottom: 12px;
    text-align: justify;
}

.content-body ul {
    list-style-position: outside;
    padding-left: 25px;
    margin-bottom: 12px;
}

.content-body li {
    margin-bottom: 6px;
    text-align: justify;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 10pt;
    page-break-inside: avoid;
    
}

.content-body th, .content-body td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.content-body th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.certification {
    font-size: 10px;
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid #000;
    padding-top: 10px;
    /* page-break-before: always; Removed, relying on page structure */
    line-height: 1.4;
}

.cert-note {
    margin-top: 6px;
    font-style: italic;
}

.cert-lines {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 12px;
}

.cert-lines span {
    display: inline-block;
    width: 220px;
    border-top: 1px solid #000;
    padding-top: 2px;
}

/* Footer / Official Seal */
.footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.sign-title {
    font-size: 9px;
    text-align: center;
    margin-top: 2px;
}

.seal {
    width: 100px;
    height: 100px;
    display: block;
}
#submitConcept {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background-color: #1a5f99;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: sans-serif;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}
#submitConcept:hover {
    background-color: #144a7a;
}
#submitConcept:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

@page {
    size: A4;
    margin: 18mm 16mm;

    @bottom-left {
        content: "Arybit Technologies // Confidential Concept Overview";
        font-family: 'Times New Roman', Times, serif;
        font-size: 8pt;
        color: #555;
    }

    @bottom-right {
        content: "Page " counter(page);
        font-family: 'Times New Roman', Times, serif;
        font-size: 8pt;
        color: #555;
    }
}

@media print {
    body { background: none; padding: 0; display: block; }
    .page { box-shadow: none; width: 100%; min-height: initial; margin: 0; border: none; page-break-after: always; }
    .page::before { opacity: 0.02; }
    .page::after { opacity: 0.015; }
}
