/* style.css - Стили в академическом стиле LaTeX (14pt) */

/* ========== ОСНОВНЫЕ НАСТРОЙКИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: white;
    font-family: "Computer Modern", "Latin Modern", "Times New Roman", serif;
    font-size: 14pt;
    line-height: 1.4;
    color: #000;
    margin: 0;
    padding: 0;
}

/* ========== СТРАНИЦА (поля как в LaTeX) ========== */
.page {
    max-width: 210mm;
    margin: 0 auto;
    padding: 15mm 20mm 20mm 20mm;
    background: white;
    box-sizing: border-box;
}

/* ========== ШАПКА ========== */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header .title {
    font-size: 20pt;
    font-weight: bold;
    margin-bottom: 8px;
}

.header .author {
    font-size: 12pt;
    color: #555;
    font-weight: normal;
}

hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #ccc;
}

/* ========== ЗАГОЛОВКИ ========== */
h1, .section {
    font-size: 18pt;
    font-weight: bold;
    margin: 1.2em 0 0.5em 0;
    padding: 0;
    clear: both;
}

h2, .subsection {
    font-size: 16pt;
    font-weight: bold;
    margin: 1em 0 0.4em 0;
}

h3, .subsubsection {
    font-size: 14pt;
    font-weight: bold;
    margin: 0.8em 0 0.3em 0;
}

h4 {
    font-size: 13pt;
    font-weight: bold;
    margin: 0.6em 0 0.2em 0;
}

/* ========== АБЗАЦЫ ========== */
.paragraph, p {
    text-indent: 1.5em;
    margin-bottom: 0.8em;
}

/* ========== СПИСКИ ========== */
ul, .itemize {
    margin: 0.6em 0 0.6em 2em;
    padding-left: 0;
    list-style: none;
}

ul li, .itemize li {
    margin-bottom: 0.3em;
    position: relative;
    padding-left: 1.2em;
}

ul li::before, .itemize li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 12pt;
    color: #000;
}

ol, .enumerate {
    margin: 0.6em 0 0.6em 2em;
    padding-left: 0;
    list-style: none;
    counter-reset: item;
}

ol li, .enumerate li {
    margin-bottom: 0.3em;
    position: relative;
    padding-left: 1.8em;
    counter-increment: item;
}

ol li::before, .enumerate li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: normal;
}

/* ========== ТАБЛИЦЫ ========== */
table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
    font-size: 12pt;
}

th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #000;
    font-weight: bold;
    background: none;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #000;
    vertical-align: top;
}

.table-bordered {
    border-collapse: collapse;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #000;
    padding: 8px 10px;
    text-align: center;
}

.table-bordered th {
    background: #f5f5f5;
}

/* ========== ГРАФИКИ И IFrame ========== */
.figure-container {
    text-align: center;
    margin: 1.5em 0;
    background: white;
    counter-increment: figure;
}

.chart-iframe {
    width: 100%;
    max-width: 820px;
    height: 500px;
    border: 0px solid #ccc;
    background: white;
    margin: 0 auto;
    display: block;
}

.caption {
    font-style: italic;
    text-align: center;
    margin-top: 10px;
    font-size: 11pt;
    color: #555;
}

.caption::before {
    content: "Рис. " counter(figure) " – ";
    font-style: normal;
    font-weight: normal;
}

/* ========== ВЫДЕЛЕННЫЕ БЛОКИ ========== */
.note, .specs {
    background-color: #f9f9f9;
    padding: 12px 18px;
    border-left: 3px solid #000;
    margin: 1em 0;
    font-size: 13pt;
}

/* ========== НОМЕРА СТРАНИЦ ========== */
@page {
    margin: 20mm 15mm 20mm 25mm;
}

.page-number {
    text-align: center;
    font-size: 10pt;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #ccc;
}

/* ========== КОНТЕНТ ========== */
.content {
    max-width: 100%;
}

/* ========== КОМПОНЕНТЫ (для 2.html) ========== */
.component-group {
    margin: 1.2em 0 0.6em 0;
    font-size: 16pt;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
    color: #000;
}

.spec {
    color: #555;
    font-size: 12pt;
    margin-top: 2px;
}

/* ========== СТИЛИ ДЛЯ СТЕНДА ========== */
.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
}

.svg-container {
    position: relative;
    height: 90vh;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas {
    position: relative;
    height: 100%;
    width: auto;
    display: inline-block;
}

.background-svg {
    height: 100%;
    width: auto;
    display: block;
    pointer-events: none;
}

.images-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-object {
    position: absolute;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-object:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.image-object img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ========== ВСПЛЫВАЮЩАЯ ПОДСКАЗКА ========== */
.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12pt;
    font-family: 'Segoe UI', sans-serif;
    pointer-events: none;
    z-index: 10000;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 3px solid #ffd700;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.tooltip.show {
    opacity: 1;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 1200px;
    max-width: 95vw;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #f5f5f5;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    font-family: "Computer Modern", "Latin Modern", serif;
    flex-shrink: 0;
}

.modal-header span {
    font-size: 14pt;
    font-weight: 500;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.close-modal:hover {
    color: #e74c3c;
    background: #f0f0f0;
}

.iframe-wrapper {
    flex: 1;
    min-height: 0;
    background: white;
    overflow: auto;
    padding: 0;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ========== ИНФОРМАЦИОННАЯ ПАНЕЛЬ ========== */
.info-panel {
    position: fixed;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10pt;
    font-family: monospace;
    z-index: 100;
    pointer-events: none;
}

/* ========== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */
@media (max-width: 768px) {
    .page {
        padding: 10mm 12mm;
    }
    
    body {
        font-size: 12pt;
    }
    
    h1, .section {
        font-size: 16pt;
    }
    
    h2, .subsection {
        font-size: 14pt;
    }
    
    .tooltip {
        font-size: 10pt;
        white-space: normal;
        max-width: 160px;
    }
    
    .modal-content {
        width: 95vw;
        height: 90vh;
    }
    
    th, td {
        padding: 6px 8px;
    }
}

/* ========== ДЛЯ ПЕЧАТИ ========== */
@media print {
    body {
        background: white;
        margin: 0;
        padding: 0;
    }
    
    .page {
        margin: 0;
        padding: 0;
    }
    
    .modal, .tooltip, .info-panel, .image-object {
        display: none;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
    
    .pagebreak {
        page-break-before: always;
    }
}