/* PhD Dissertation-Quality Academic CSS - Strict IEEE/ACM Standards */

@import url('https://fonts.googleapis.com/css2?family=Computer+Modern+Serif&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base typography following strict academic standards */
body {
    font-family: 'Computer Modern', 'Times New Roman', 'Cambria', 'Georgia', serif;
    font-size: 11pt;
    line-height: 1.618034; /* Golden ratio for optimal readability */
    color: #000;
    background: #fff;
    max-width: 6.5in; /* Standard academic paper width */
    margin: 0 auto;
    padding: 1in;
    text-align: justify;
    hyphens: auto;
    counter-reset: section subsection subsubsection theorem lemma definition proposition corollary figure table equation algorithm footnote;
}

/* Section numbering system */
h1 {
    font-size: 14pt;
    font-weight: bold;
    margin: 36pt 0 24pt 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    page-break-before: always;
}

h1:first-of-type {
    page-break-before: avoid;
}

h2 {
    font-size: 12pt;
    font-weight: bold;
    margin: 24pt 0 12pt 0;
    counter-increment: section;
}

h2:before {
    content: counter(section) ". ";
}

h3 {
    font-size: 11pt;
    font-weight: bold;
    font-style: italic;
    margin: 18pt 0 6pt 0;
    counter-increment: subsection;
}

h3:before {
    content: counter(section) "." counter(subsection) " ";
}

h2 {
    counter-reset: subsection;
}

h4 {
    font-size: 11pt;
    font-weight: normal;
    font-style: italic;
    margin: 12pt 0 6pt 0;
    counter-increment: subsubsection;
}

h4:before {
    content: counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}

h3 {
    counter-reset: subsubsection;
}

/* Abstract formatting */
.abstract {
    margin: 24pt 48pt;
    font-size: 10pt;
    line-height: 1.4;
    text-align: justify;
}

.abstract:before {
    content: "Abstract—";
    font-weight: bold;
    font-style: italic;
}

/* Mathematical theorems, lemmas, definitions */
.theorem, .lemma, .definition, .proposition, .corollary {
    margin: 18pt 0;
    padding: 12pt;
    border-left: 2pt solid #000;
    background: #f9f9f9;
}

.theorem:before {
    content: "Theorem " counter(theorem) ". ";
    font-weight: bold;
    font-style: italic;
    counter-increment: theorem;
    display: block;
}

.lemma:before {
    content: "Lemma " counter(lemma) ". ";
    font-weight: bold;
    font-style: italic;
    counter-increment: lemma;
    display: block;
}

.definition:before {
    content: "Definition " counter(definition) ". ";
    font-weight: bold;
    font-style: italic;
    counter-increment: definition;
    display: block;
}

.proposition:before {
    content: "Proposition " counter(proposition) ". ";
    font-weight: bold;
    font-style: italic;
    counter-increment: proposition;
    display: block;
}

.corollary:before {
    content: "Corollary " counter(corollary) ". ";
    font-weight: bold;
    font-style: italic;
    counter-increment: corollary;
    display: block;
}

/* Mathematical proofs */
.proof {
    margin: 12pt 0;
    padding-left: 18pt;
    position: relative;
}

.proof:before {
    content: "Proof. ";
    font-style: italic;
    font-weight: bold;
}

.proof:after {
    content: " □";
    float: right;
    font-size: 14pt;
}

/* Equations */
.equation {
    display: block;
    text-align: center;
    margin: 18pt 0;
    font-style: italic;
    position: relative;
    counter-increment: equation;
}

.equation:after {
    content: "(" counter(equation) ")";
    position: absolute;
    right: 0;
    font-style: normal;
}

/* Mathematical notation */
.math {
    font-family: 'Computer Modern', 'Cambria Math', 'Times New Roman', serif;
    font-style: italic;
}

.math-display {
    display: block;
    text-align: center;
    margin: 12pt 0;
}

/* Tables with proper academic formatting */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 18pt auto;
    font-size: 9pt;
    caption-side: top;
    counter-increment: table;
}

table caption {
    font-weight: bold;
    margin-bottom: 6pt;
    text-align: center;
}

table caption:before {
    content: "Table " counter(table) ". ";
}

table th {
    border-top: 1.5pt solid #000;
    border-bottom: 1pt solid #000;
    padding: 6pt;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 4pt 6pt;
    border-bottom: 0.5pt solid #ccc;
}

table tr:last-child td {
    border-bottom: 1.5pt solid #000;
}

/* Figures with proper captioning */
figure {
    margin: 18pt 0;
    text-align: center;
    counter-increment: figure;
}

figure img {
    max-width: 100%;
    height: auto;
}

figcaption {
    font-size: 10pt;
    margin-top: 6pt;
    text-align: center;
}

figcaption:before {
    content: "Figure " counter(figure) ". ";
    font-weight: bold;
}

/* Algorithm blocks */
.algorithm {
    margin: 18pt 0;
    padding: 12pt;
    border: 1pt solid #000;
    counter-increment: algorithm;
    font-family: 'Courier New', monospace;
    font-size: 9pt;
}

.algorithm:before {
    content: "Algorithm " counter(algorithm) ": ";
    font-weight: bold;
    display: block;
    margin-bottom: 6pt;
    font-family: 'Times New Roman', serif;
    font-size: 10pt;
}

/* Citations and references */
.citation {
    vertical-align: super;
    font-size: 8pt;
    text-decoration: none;
    color: #000;
}

.citation:before {
    content: "[";
}

.citation:after {
    content: "]";
}

/* Bibliography/References section */
.references {
    font-size: 10pt;
    margin-top: 36pt;
    border-top: 1pt solid #000;
    padding-top: 12pt;
}

.references h2:before {
    content: "";
}

.reference-item {
    margin-bottom: 6pt;
    text-indent: -18pt;
    padding-left: 18pt;
    text-align: justify;
}

.reference-item:before {
    content: "[" counter(reference) "] ";
    counter-increment: reference;
    font-weight: bold;
}

/* Footnotes */
.footnote {
    vertical-align: super;
    font-size: 8pt;
    counter-increment: footnote;
}

.footnote:before {
    content: counter(footnote);
}

.footnotes {
    margin-top: 24pt;
    padding-top: 12pt;
    border-top: 0.5pt solid #000;
    font-size: 9pt;
}

.footnote-item {
    margin-bottom: 3pt;
    text-indent: -12pt;
    padding-left: 12pt;
}

/* Lists with proper formatting */
ul, ol {
    margin: 12pt 0 12pt 18pt;
}

li {
    margin-bottom: 3pt;
    text-align: justify;
}

ol {
    list-style-type: decimal;
}

ol ol {
    list-style-type: lower-alpha;
}

ol ol ol {
    list-style-type: lower-roman;
}

ul {
    list-style-type: disc;
}

ul ul {
    list-style-type: circle;
}

ul ul ul {
    list-style-type: square;
}

/* Code blocks */
pre {
    background: #f5f5f5;
    border: 0.5pt solid #000;
    padding: 6pt;
    overflow-x: auto;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 9pt;
    margin: 12pt 0;
}

code {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 9pt;
    background: #f0f0f0;
    padding: 1pt 2pt;
}

/* Author information */
.authors {
    text-align: center;
    margin: 18pt 0;
    font-size: 11pt;
}

.author {
    margin: 6pt 0;
}

.affiliation {
    font-style: italic;
    font-size: 10pt;
    margin: 3pt 0;
}

.email {
    font-family: 'Courier New', monospace;
    font-size: 9pt;
}

/* Keywords */
.keywords {
    margin: 18pt 0;
    font-size: 10pt;
    font-style: italic;
}

.keywords:before {
    content: "Keywords—";
    font-weight: bold;
    font-style: normal;
}

/* Academic navigation (simplified) */
.academic-nav {
    border-bottom: 2pt solid #000;
    margin-bottom: 24pt;
    padding-bottom: 6pt;
    print: none;
}

/* Back button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #000;
    color: #fff;
    text-decoration: none;
    padding: 8pt 12pt;
    font-size: 10pt;
    border: 1pt solid #000;
    z-index: 1000;
}

.back-button:hover {
    background: #333;
    color: #fff;
}

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

.logo {
    font-size: 12pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1pt;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 18pt;
}

.nav-links a {
    color: #000;
    text-decoration: none;
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
}

.nav-links a:hover {
    text-decoration: underline;
}

.nav-links a.active {
    font-weight: bold;
}

/* Section formatting */
.section {
    margin: 24pt 0;
}

p {
    margin: 12pt 0;
    text-align: justify;
    text-indent: 18pt;
}

p:first-of-type,
h1 + p,
h2 + p,
h3 + p,
h4 + p,
.abstract + p {
    text-indent: 0;
}

/* Comparison tables */
.comparison-table {
    font-size: 9pt;
}

.comparison-table th {
    background: #eeeeee;
    font-weight: bold;
    text-align: center;
}

.comparison-table td {
    text-align: center;
}

.comparison-table tr:nth-child(even) {
    background: #f5f5f5;
}

/* Matrix visualization */
.matrix-table td.excellent {
    background: #f9f9f9;
    font-weight: bold;
}

.matrix-table td.good {
    background: #f5f5f5;
}

.matrix-table td.moderate {
    background: #f0f0f0;
}

.matrix-table td.poor {
    background: #eeeeee;
}

/* Stats display */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12pt;
    margin: 24pt 0;
    padding: 12pt 0;
    border-top: 1pt solid #000;
    border-bottom: 1pt solid #000;
}

.stat {
    text-align: center;
}

.stat .value {
    font-size: 14pt;
    font-weight: bold;
    display: block;
}

.stat .label {
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    display: block;
    margin-top: 3pt;
}

/* Features grid */
.features, .spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12pt;
    margin: 18pt 0;
}

.feature, .spec-card {
    border: 0.5pt solid #000;
    padding: 9pt;
}

.feature h3, .spec-card h3 {
    font-size: 10pt;
    margin-bottom: 6pt;
    counter-increment: none;
}

.feature h3:before, .spec-card h3:before {
    content: "";
}

/* Timeline */
.timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12pt;
    margin: 18pt 0;
}

.timeline-item {
    border: 0.5pt solid #000;
    padding: 9pt;
    text-align: center;
}

.timeline-item .date {
    font-weight: bold;
    display: block;
    margin-bottom: 6pt;
}

/* Footer (academic style) */
footer {
    margin-top: 36pt;
    padding-top: 12pt;
    border-top: 1pt solid #000;
    font-size: 9pt;
    text-align: center;
}

.copyright {
    margin-top: 12pt;
}

/* Buttons (simplified for academic use) */
.btn-primary {
    background: #000;
    color: #fff;
    padding: 6pt 12pt;
    text-decoration: none;
    border: 1pt solid #000;
    font-size: 10pt;
    display: inline-block;
}

.btn-primary:hover {
    background: #333;
}

/* Remove ALL animations, gradients, and effects */
* {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    background-image: none !important;
}

/* Page setup for printing */
@page {
    size: letter;
    margin: 1in;
}

@page :first {
    margin-top: 0.5in;
}

/* Print optimizations */
@media print {
    body {
        font-size: 10pt;
        line-height: 1.5;
    }

    .academic-nav,
    footer,
    .btn-primary {
        display: none;
    }

    h1 {
        font-size: 12pt;
        page-break-before: always;
    }

    h1:first-of-type {
        page-break-before: avoid;
    }

    h2 { font-size: 11pt; }
    h3 { font-size: 10pt; }

    table, figure, .algorithm, .theorem, .proof {
        page-break-inside: avoid;
    }

    .abstract {
        margin: 12pt 36pt;
    }
}

/* Responsive adjustments (minimal) */
@media (max-width: 768px) {
    body {
        padding: 0.5in;
        font-size: 10pt;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .features,
    .spec-grid,
    .timeline {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 8pt;
    }

    .abstract {
        margin: 12pt 0;
    }
}