/* =========================================================
   ЗМІННІ ТА БАЗОВІ НАЛАШТУВАННЯ
========================================================= */

:root {
    --bg-page: #f9f9f9;
    --bg-card: #ffffff;
    --text-main: #333;
    --text-title: #2c3e50;

    --primary: #3498db;
    --primary-hover: #2980b9;

    --success: #2ecc71;
    --success-hover: #27ae60;

    --border: #ccc;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

    --highlight: #f0f8ff;
    --highlight-strong: #d0eaff;
}

/* =========================================================
   ОСНОВНІ СТИЛІ СТОРІНКИ
========================================================= */

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: var(--bg-page);
    color: var(--text-main);
}

/* Заголовки */
h3, h4 {
    margin-bottom: 10px;
    color: var(--text-title);
}

/* Підписи */
label {
    display: block;
    margin: 10px 0 5px;
}

/* Поля введення (Загальні - окрім таблиці) */
input[type="number"]:not(td input),
input[type="range"],
select {
    margin-top: 5px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 150px;
    font-size: 14px;
}

input[type="range"] {
    width: 200px;
}

/* =========================================================
   КНОПКИ
========================================================= */

button,
.file-label {
    display: inline-block;
    padding: 8px 15px;
    margin-top: 10px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button {
    background-color: var(--primary);
}

button:hover {
    background-color: var(--primary-hover);
}

.file-label {
    background-color: var(--success);
}

.file-label:hover {
    background-color: var(--success-hover);
}

#loadFileInput {
    display: none;
}

/* =========================================================
   КОНТЕЙНЕРИ
========================================================= */

#tableContainer,
#initialVectorContainer,
#graphContainer,
#intensityMatrix,
#systemakolmogorova,
#solutionContainer,
#ctmcChart {
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

#precisionValue {
    font-weight: bold;
    margin-left: 5px;
}

fieldset {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-card);
}

legend {
    font-weight: bold;
}

/* =========================================================
   ТАБЛИЦЯ (Зменшені поля вводу)
========================================================= */

table {
    border-collapse: collapse;
    margin-top: 10px;
}

td, th {
    border: 1px solid black;
    padding: 4px 6px; /* Зменшені відступи */
    text-align: center;
    white-space: nowrap;
    min-width: 35px;
}

/* Input в таблиці — КОМПАКТНИЙ ВИГЛЯД */
td input {
    width: 100px;         /* Фіксована маленька ширина */
    text-align: center;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    padding: 2px 0;
}

/* Підсвітки */
.highlight-row,
.highlight-col {
    background-color: var(--highlight);
}

.highlight-cell {
    background-color: var(--highlight-strong) !important;
    font-weight: bold;
}

/* =========================================================
   MathJax
========================================================= */

#intensityMatrix,
#systemakolmogorova,
#solutionContainer {
    font-size: 1.5em;
    line-height: 1.4em;
}