/* css/index.css - Tema Leitor de Artigo/Monografia TCC (FazBem V2) */

:root {
    /* Color Palette - Fresh Academic Organic */
    --primary: #1b4d3e;          /* Deep Emerald Green */
    --primary-light: #2c6e49;    /* Forest Green */
    --primary-hover: #4c956c;    /* Minty Green Accent */
    --primary-bg: #f4f9f4;       /* Soft Light Green background */
    --accent: #d8a436;           /* Muted Academic Gold */
    --accent-light: #fef9e7;     /* Warm Gold Highlight */
    --dark: #1a2521;             /* Charcoal Green for text */
    --light: #fafdfb;            /* Off-white background */
    --card-bg: #ffffff;
    --text: #2f3e46;             /* Readable body text color */
    --text-muted: #62726b;       /* Muted text for captions/details */
    --border: #e2ede4;           /* Subtle borders */
    
    /* Layout & Typography */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(27, 77, 62, 0.05);
    --shadow-md: 0 8px 24px rgba(27, 77, 62, 0.08);
    --shadow-lg: 0 16px 36px rgba(27, 77, 62, 0.12);
    
    --transition: all 0.25s ease;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--light);
    color: var(--text);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--light);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
}

h2 {
    font-size: 1.6rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin-top: 2rem;
    margin-bottom: 1rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--primary-light);
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1.25rem;
    text-align: justify;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Header / Navbar */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(250, 253, 251, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    height: 70px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    font-size: 24px;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.brand-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background-color: var(--accent-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(216, 164, 54, 0.2);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-light);
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--primary);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--primary-bg);
    color: var(--primary-light) !important;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
    text-decoration: none;
}

.btn-login {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--primary-light);
    padding: 8px 12px;
}

.btn-login:hover {
    color: var(--primary);
    background-color: var(--primary-bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
}

/* Layout Grid */
.app-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 70px);
}

/* Sidebar Navigation */
.sidebar {
    background-color: var(--primary-bg);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 24px;
}

.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 700;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-item a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
}

.toc-item a:hover {
    background-color: rgba(44, 110, 73, 0.08);
    color: var(--primary-light);
    text-decoration: none;
}

.toc-item.active a {
    background-color: rgba(44, 110, 73, 0.12);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary-light);
}

/* Main Content Area */
.content-wrapper {
    padding: 40px 60px 80px 60px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.document-body {
    max-width: 800px;
    width: 100%;
}

/* Academic Presentation Element / Capa */
.cover-page {
    text-align: center;
    border: 1px solid var(--border);
    padding: 48px;
    border-radius: var(--radius-lg);
    background-color: var(--light);
    margin-bottom: 48px;
    box-shadow: var(--shadow-sm);
}

.cover-institution {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.cover-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.cover-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 36px;
}


.cover-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    font-size: 14.5px;
    margin-bottom: 24px;
}

.academic-journal-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-family: var(--font-secondary);
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.academic-authors-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
    text-align: left;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    padding: 20px 16px;
}

.academic-author {
    font-size: 13.5px;
    line-height: 1.5;
}

.author-inst {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.author-email {
    font-family: monospace;
    font-size: 12px;
    color: var(--primary);
}

.cover-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Callout Box / Alert Box */
.academic-callout {
    background-color: var(--primary-bg);
    border-left: 4px solid var(--primary-light);
    padding: 20px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 20px 0;
}

.academic-callout h4 {
    margin: 0 0 8px 0;
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
}

.academic-callout p {
    margin: 0;
    font-size: 14.5px;
    text-align: justify;
}

/* Lists formatting */
ol, ul {
    margin-bottom: 1.25rem;
    padding-left: 20px;
}

li {
    margin-bottom: 0.5rem;
}

/* Tables styling */
.table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

th, td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--primary-bg);
    color: var(--primary);
    font-weight: 700;
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background-color: rgba(27, 77, 62, 0.02);
}

/* Quadro styling (closed borders for qualitative data) */
.quadro-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.quadro {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
    border: 1px solid var(--primary-light);
}

.quadro th, .quadro td {
    padding: 12px 16px;
    border: 1px solid var(--border);
}

.quadro th {
    background-color: var(--primary-bg);
    color: var(--primary);
    font-weight: 700;
    border-bottom: 2px solid var(--primary-light);
}

.quadro tr:nth-child(even) {
    background-color: rgba(27, 77, 62, 0.02);
}

/* Code block styles */
pre {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
    font-family: 'Courier New', Courier, monospace;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #e11d48;
}

pre code {
    background-color: transparent;
    padding: 0;
    font-size: inherit;
    color: inherit;
    font-weight: normal;
}

/* Figures and diagrams */
.diagram-container {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.diagram-caption {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}


/* Flowchart Styles */
.flowchart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 16px 0;
}

.flowchart-layer {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    background-color: var(--light);
    width: 90%;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.flowchart-layer.interface {
    border-left: 5px solid #3b82f6; /* Blue for Interface */
}

.flowchart-layer.security {
    border-left: 5px solid #ef4444; /* Red for Security/Buffer */
}

.flowchart-layer.processing {
    border-left: 5px solid #f59e0b; /* Orange for processing/controllers */
}

.flowchart-layer.models {
    border-left: 5px solid #10b981; /* Green for Models */
}

.flowchart-layer-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    color: #fff;
}

.layer-badge.interface-bg { background-color: #3b82f6; }
.layer-badge.security-bg { background-color: #ef4444; }
.layer-badge.processing-bg { background-color: #f59e0b; }
.layer-badge.models-bg { background-color: #10b981; }

.flowchart-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.flowchart-node {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    color: var(--text);
}

.flowchart-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 16px;
    margin: 4px 0;
}

.flowchart-arrow-text {
    font-size: 11px;
    color: var(--primary);
    font-family: monospace;
    font-style: italic;
    background-color: var(--primary-bg);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    border: 1px solid var(--primary-light);
}

/* Footer style */
.academic-footer {
    border-top: 1px solid var(--border);
    background-color: var(--light);
    padding: 30px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
    }
    
    .toc-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .toc-item {
        white-space: nowrap;
    }
    
    .content-wrapper {
        padding: 24px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .navbar-container {
        padding: 0 16px;
    }
    
    .brand-name {
        display: none;
    }
    
    .cover-page {
        padding: 24px;
    }
    
    .cover-title {
        font-size: 1.4rem;
    }
}
