/* ===== Базовые стили (были) ===== */
#head {
    text-align: center;
    background-color: aquamarine;
    font-size: 26px;
    border-bottom: 2px solid black;
    padding-bottom: 2px;
}

fieldset {
    margin-bottom: 1%;
    margin-top: 1%;
    padding: auto;
    width: 250px;
}

textarea {
    resize: none;
}

a {
    font-size: 20px;
    text-decoration: none;
    color: black;
    background-color: rgba(87, 247, 114, 0.158);
    border: 2px solid black;
    border-radius: 5px;
}

.main-menu .link-cont a {
    display: block;
    width: 8%;
    margin: 0 auto 10px auto;
    box-sizing: border-box;
    text-align: center;
    padding: 5px 10px;
}

label {
    font-size: 18px;
}

.main-menu {
    text-align: center;
}

.main-menu .link-cont {
    padding-bottom: 6px;
}

.main-menu a {
    background-color: rgb(39, 236, 115);
    margin-bottom: 10px;
}

table {
    text-align: center;
    margin: 0px auto;
    border: 1px solid black;
    border-collapse: collapse;
    border-spacing: 10px 40px;
    empty-cells: hide;
}

th, td, tbody {
    border: 2px solid rgb(0, 0, 0);
    padding: 4px 8px;
    empty-cells: hide;
}

p {
    margin-bottom: 5px;
    margin-top: 2px;
}

a.working {
    background-color: gold;
}

.btn-danger {
    background-color: red;
}
.btn-edit {
    background-color: aqua;
}
.btn-dis {
    background-color: rgb(199, 197, 197);
}
.login {
    display: flex;
    justify-content: flex-end;
}
.error {
    color: red;
}

.outter-editor {
    max-width: 30%;
}

/* ===== Дополнительные стили для всех новых страниц ===== */

/* Формы (общие) */
form {
    margin: 20px auto;
    max-width: 600px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Поля ввода и текстовые области */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    margin: 6px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    background: white;
}

textarea {
    min-height: 80px;
}

/* Радио-кнопки и чекбоксы в fieldset */
fieldset label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
}
fieldset input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.2);
}

/* Кнопки */
input[type="submit"],
input[type="reset"],
button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 24px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}
input[type="reset"] {
    background-color: #f44336;
}
input[type="submit"]:hover {
    background-color: #45a049;
}
input[type="reset"]:hover {
    background-color: #da190b;
}

/* Специфичные формы */
.cookie-form {
    max-width: 350px;
    background: #fff;
    border: 2px solid #ddd;
    padding: 20px;
}
.cookie-form fieldset {
    width: auto;
    border: none;
    margin: 0;
    padding: 0;
}
.cookie-form input[type="radio"] {
    transform: scale(1.5);
    margin-right: 8px;
}

#find-form {
    background: #eef;
    border: 1px solid #aac;
}
#find-form select,
#find-form input[type="text"] {
    width: auto;
    display: inline-block;
    margin-right: 10px;
}
#find-form input[type="submit"] {
    background: #337ab7;
}

#insert-form {
    background: #fefefe;
    border: 2px dashed #4CAF50;
    padding: 20px;
}
#insert-form input[type="text"],
#insert-form input[type="number"],
#insert-form input[type="date"],
#insert-form select {
    width: 100%;
}
#insert-form label {
    display: block;
    margin-top: 8px;
}

/* Кнопка "Добавить запись" */
#btn-start-insert {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
#btn-start-insert:hover {
    background: #218838;
}

/* Таблица с действиями — компактные ссылки */
table .btn-edit,
table .btn-danger,
table .btn-dis {
    font-size: 14px;
    padding: 2px 8px;
    border-width: 1px;
    border-radius: 3px;
    margin: 0 2px;
    white-space: nowrap;
    display: inline-block;
}

/* Гистограмма и прочие изображения */
#gistogram {
    display: block;
    margin: 20px auto;
    max-width: 90%;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

/* Каптча */
#captcha {
    width: 150px;
}
img[src*="image.php"] {
    border: 1px solid #aaa;
    padding: 5px;
    background: white;
    margin: 5px 0;
}

/* Стили для окон ошибок (используются в mainJS.js и mainJQ.js) */
.wrong {
    color: #d9534f;
    font-weight: bold;
}
.red {
    color: red;
}

/* Логин-форма */
.login-form {
    max-width: 300px;
    background: #f4f4f4;
    border: 1px solid #ccc;
    padding: 30px;
    margin: 50px auto;
    border-radius: 10px;
}
.login-form label {
    display: block;
    margin-top: 10px;
}
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
}

/* Селекты для предметов и прочих выпадающих списков */
select {
    appearance: auto;
    background: white;
}

/* Для контейнера CKEditor */
.outter-editor {
    max-width: 100%;
    margin: 10px 0;
}
.ck-editor__editable_inline {
    min-height: 120px;
}

/* Стили для ссылок в главном меню */
a.complete {
    background-color: #5cb85c;
    color: white;
}
a.complete:hover {
    background-color: #449d44;
}

/* Дополнительная адаптивность для мобильных */
@media (max-width: 600px) {
    table, th, td {
        font-size: 14px;
        padding: 4px;
    }
    .main-menu .link-cont a {
        width: 40%;
    }
    form {
        max-width: 95%;
        padding: 10px;
    }
    fieldset {
        width: 100%;
    }
    #gistogram {
        max-width: 100%;
    }
}