/*
	RzhevskyRobotics 2025
	CyberneticCore Team
	style.css
	Author: Burdin E.A.
*/

* {
    margin: 0;
}

html,
body {
    width: 100%;
    height: -webkit-fill-available;
    color: black;
    background: white;
    font-family: 'UbuntuThin';
}

/* ==== Подгружаем шрифты ==== */
@font-face {
    font-family: "UbuntuThin";
    src: url('/assets/fonts/Ubuntu-Th.ttf');
}

@font-face {
    font-family: "UbuntuBold";
    src: url('/assets/fonts/Ubuntu-B.ttf');
}

@font-face {
    font-family: "UbuntuRbold";
    src: url('/assets/fonts/Ubuntu-R.ttf');
}
/* ==== Подгружаем шрифты ==== */

/* Мобильный скрываем текст в box-result */
@media only screen and (max-device-width: 480px) {
    .main-content .box-result .box-result-content p {
        display: none;
    }
}

hr {
    width: 80%;
    color: black;
}

/* =========================
   Базовые блоки / формы
   ========================= */

.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f4f6fb;
}

.main-container header {
    margin-top: 10px;
    height: auto;
    padding: 10px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

.main-container header h1 {
    font-family: 'UbuntuBold';
    font-size: 1.6em;
}

.main-content {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    font-family: 'UbuntuThin';
}

/* Общий контейнер-карточка */
.box__main {
    margin-top: 24px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 1100px;
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 24px 28px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.box__main button {
    margin-top: 5px;
    margin-left: 20px;
}

.input__block {
    display: flex;
    align-items: center;
    flex-direction: column;
    margin-top: 20px;
}

.input__block input {
    margin-top: 10px;
}

.input__block p {
    font-size: 1.1em;
}

input {
    background-color: #ffffff36;
    border: none;
    outline: none;
    padding: 5px 12px;
    transition: 0.3s;
    color: black;
    text-align: center;
    font-size: 0.9em;
}

input::placeholder {
    color: black;
}

button {
    background-color: #003cff;
    border: none;
    color: #ffffff;
    padding: 8px 18px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em;
}

button:active {
    background-color: #0031d3;
    transform: translateY(4px);
}

.login {
    font-weight: normal;
    font-size: 1.1em;
}

.text__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
}

.text__box h1 {
    font-size: 1.4em;
}

.text__box h2 {
    margin-top: 20px;
    font-size: 1.1em;
}

.text__box p {
    width: 360px;
    margin-top: 20px;
    font-size: 0.9em;
    text-align: center;
}

.admin__block {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.content__box,
.spec_admin_content__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 40px;
}

.content__box h2 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.green {
    background-color: green;
    padding: 10px 16px;
    width: 60px;
    border: none;
    font-size: 0.9em;
    text-align: center;
}

.red {
    background-color: red;
    padding: 10px 16px;
    width: 60px;
    text-align: center;
    border: none;
    font-size: 0.9em;
}

.status-active {
    color: green;
    font-weight: bold;
    font-size: 1.2em;
}

.status-inactive {
    color: red;
    font-weight: bold;
    font-size: 1.2em;
}

.status-button {
    background-color: #ff6767;
    margin-bottom: 15px;
    width: 170px;
    height: 35px;
    color: white;
}

.status-button:active {
    background-color: #fd3a3a;
}

textarea {
    background-color: transparent;
    border: 1px white solid;
    width: 300px;
    height: 150px;
}

/* =========================
   Ошибки / уведомления
   ========================= */

.error__admin {
    cursor: pointer;
    position: fixed;
    top: 0;
    z-index: 4;
    left: 50%;
    width: 280px;
    padding: 30px;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    background-color: #FF0606;
    box-shadow: 0 5px 15px #ff06066b;
    overflow-y: auto;
    overflow-x: hidden;
    color: white;
    text-align: center;
    transform: translateX(-50%);
}

.error__admin p {
    font-size: 1.1em;
    font-family: 'UbuntuThin';
    font-weight: bold;
}

.error__admin button {
    width: 150px;
    margin-top: 15px;
    background-color: white;
    color: black;
    font-family: 'UbuntuThin';
    font-weight: bold;
    border-radius: 5px;
    border: none;
    font-size: 0.8em;
    cursor: pointer;
}

.error__admin.warning {
    width: 480px;
    color: black;
    background-color: #ffff06;
    box-shadow: 0 5px 15px #ffee066b;
}

.error__admin.success {
    background-color: #06ff1b;
    box-shadow: 0 5px 15px #06ff066b;
    color: black;
}

/* =========================
   Логи / спец. админка
   ========================= */

.logs-list {
    margin-top: 20px;
    width: 70vw;
    height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    border: black solid 1px;
    overflow-y: auto;
}

.spec_admin_content__box h1 {
    font-size: 1.9em;
    margin-bottom: 20px;
    font-family: 'UbuntuRbold';
}

.spec_admin_content__box h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-family: 'UbuntuBold';
}

.spec_admin_content__box h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-family: 'UbuntuBold';
}

.spec_admin_content__box button.green {
    background-color: #22ff00;
    font-size: 1.2em;
}

.spec_admin_content__box button.green:hover {
    background-color: #1edf00;
}

.spec_admin_content__box button.green:active {
    background-color: #19bb00;
}

.spec_admin_content__box button.red {
    background-color: #ff2b2b;
    font-size: 1.2em;
    color: white;
}

.spec_admin_content__box button.red:hover {
    background-color: #ed2828;
}

.spec_admin_content__box button.red:active {
    background-color: #df2626;
}

.spec_admin_content__box button.delete {
    width: 400px;
    color: white;
    background-color: #ff3333;
}

.spec_admin_content__box button.delete:hover {
    background-color: #ef2828;
}

.spec_admin_content__box button.delete:active {
    background-color: #dc1818;
}

.spec_admin_content__box input {
    width: 300px;
    height: 30px;
    margin-top: 20px;
    background-color: #94b0ff95;
    font-size: 1.2em;
}

.spec_admin_content__box select {
    width: 430px;
    height: 35px;
    margin-top: 20px;
    background-color: #479ffd95;
    font-size: 1.2em;
    color: black;
    text-align: center;
    border: none;
}

.spec_admin_content__box textarea {
    border: black solid 1px;
    width: 500px;
    height: 200px;
    font-size: 1.3em;
}

.background {
    background-color: #d2ffcb;
}

/* =========================
   Таблицы / заявки
   ========================= */

.request-table {
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: #fafbff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.request-table thead th {
    background: #eef1ff;
    font-family: 'UbuntuBold';
    font-weight: 600;
    font-size: 0.9em;
}

.request-table th,
.request-table td {
    padding: 8px 10px;
    text-align: left;
    border: 1px solid #e0e3f2;
    vertical-align: top;
}

.request-table tbody tr:nth-child(even) {
    background: #f7f8ff;
}

.request-table tbody tr:hover {
    background: #e9f0ff;
}

/* Кликабельная ссылка в таблице */
.request-table td.tg_url {
    cursor: pointer;
    color: blue;
    font-weight: bold;
}

/* Колонка действий */
.col-actions {
    width: 60px;
    text-align: center;
}

/* Мобильная таблица */
@media (max-width: 600px) {
    .request-table th,
    .request-table td {
        padding: 6px;
        font-size: 0.9em;
        word-break: break-word;
    }
}

/* =========================
   Dropdown / формы
   ========================= */

.dropdown {
    position: relative;
    margin-bottom: 15px;
}

.dropdown-select {
    background-color: #fffd9495;
    color: white;
    border: none;
    padding: 8px;
    font-size: 16px;
    width: 200px;
    cursor: pointer;
    position: relative;
    text-align-last: center;
}

.dropdown-select option {
    background-color: #0000004d;
    color: white;
}

.div-applications-form {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: 30px;
}

.div-applications-form h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-family: 'UbuntuBold';
}

.div-applications-form p {
    font-size: 1.2em;
    font-family: 'UbuntuRBold';
}

.div-applications-form input {
    margin-top: 5px !important;
    margin-bottom: 15px;
}

.div-applications-form .dropdown {
    margin-top: 10px;
}

.div-applications-form .textarea-user-message {
    margin-top: 15px;
    color: white;
    font-size: 1.3em;
    width: 530px !important;
}

.block__row {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 300px;
}

#block-loading-array textarea {
    margin-top: 30px;
    width: 500px;
    height: 300px;
    color: #ffffff;
}

#block-loading-array textarea::placeholder {
    color: white;
    opacity: 1;
    text-align: center;
}

/* =========================
   Модальное окно
   ========================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    text-align: center;
    position: relative;
}

.modal-content h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-family: 'UbuntuRBold';
}

.modal-content-data-style {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.modal-content .row_data {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 15px;
}

.modal-content .row_data .title-name {
    margin-right: 10px;
    font-weight: 700;
}

.modal-content .row_data .title-tg-id {
    margin-left: 20px;
    margin-right: 10px;
    font-weight: 700;
}

.modal-content .row_data .title-participants {
    margin-left: 20px;
    font-weight: 900;
    color: blue;
    cursor: pointer;
}

.modal-content .col_data {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border: black solid 1px;
    width: 300px;
    margin-bottom: 20px;
}

.modal-content .col_data .title {
    margin-top: 20px;
    margin-bottom: 5px;
    font-weight: 700;
}

.modal-content .col_data .title-participants {
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: 900;
    color: blue;
    cursor: pointer;
}

.modal-content .col_data a {
    margin-bottom: 20px;
    font-weight: 900;
    color: blue;
    cursor: pointer;
    text-decoration: none;
}

.close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

/* Стили для кнопки закрытия модального окна */
#closeModalBtn:hover {
    color: red;
}

/* =========================
   Превью изображений
   ========================= */

.image-preview {
    max-width: 100px;
    max-height: 100px;
    margin: 5px;
}

/* =========================
   Logout
   ========================= */

.logout {
    background-color: #73d0ffe3;
    color: #000;
    padding: 6px 14px;
    font-size: 0.95em;
    border-radius: 999px;
}

.logout:hover {
    background-color: #afe4ff;
}

.logout:active {
    background-color: #4ac3ffe3;
}

/* =========================
   Tabs for SIM
   ========================= */

.tabs {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin: 0 0 16px;
    flex-wrap: wrap;
    width: 700px;
}

.tab-sim {
    padding: 6px 14px;
    background: #e4e8ff;
    color: #1b1b1b;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: 'UbuntuRBold';
    font-size: 0.95em;
    transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
    width: auto;
    min-width: 70px;
}

.tab-sim.tab-active {
    background: #5ef4ff;
    color: black;
    box-shadow: 0 0 0 2px #94b0ff95;
    transform: translateY(-1px);
}

/* Subtabs (SMS / Calls) */

.subtabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 10px 0 16px;
}

.subtab {
    background: #e7ecff;
    color: #333;
    border-radius: 999px;
    border: none;
    padding: 6px 18px;
    cursor: pointer;
    font-family: 'UbuntuRBold';
    font-size: 0.9em;
    transition: background 0.2s, color 0.2s;
    width: auto !important;
}

.subtab.subtab-active {
    background: #5ef4ff;
    color: black;
}

/* =========================
   Кнопка удаления СМС
   ========================= */

.btn-sms-delete {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background-color: #ff4b4b;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-sms-delete:hover {
    background-color: #e63a3a;
}

.btn-sms-delete:active {
    background-color: #cc3232;
}

.btn-call-delete {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background-color: #ff4b4b;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-call-delete:hover {
    background-color: #e63a3a;
}

.btn-call-delete:active {
    background-color: #cc3232;
}


/* =========================
   Мобильная адаптация панели
   ========================= */

@media (max-width: 700px) {
    .main-container header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .box__main {
        margin: 12px 8px 24px;
        padding: 16px 14px 22px;
    }

    .request-table th,
    .request-table td {
        font-size: 0.85em;
        padding: 6px;
        word-break: break-word;
    }
}

/* Подсветка новых СМС / звонков */
.row-new-sms {
    animation: rowHighlightSms 1.5s ease-out;
}

.row-new-call {
    animation: rowHighlightCall 1.5s ease-out;
}

@keyframes rowHighlightSms {
    from {
        background-color: #fff7d6;
    }
    to {
        background-color: inherit;
    }
}

@keyframes rowHighlightCall {
    from {
        background-color: #e0ffe0;
    }
    to {
        background-color: inherit;
    }
}

.unread-row {
    background-color: #fff6e5 !important;
    font-weight: 500;
}

/* Панелька над таблицей */
.panel-toolbar {
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

/* Кнопка "Прочитать все" */
.btn-mark-all {
    background-color: #4caf50;
    border-radius: 999px;
    font-size: 0.85em;
    padding: 4px 12px;
}

.btn-mark-all:hover {
    background-color: #43a047;
}

.btn-mark-all:active {
    background-color: #388e3c;
}

/* Кнопка "прочитано" для строки */
.btn-sms-read,
.btn-call-read {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background-color: #4caf50;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-right: 4px;
}

.btn-sms-read:hover,
.btn-call-read:hover {
    background-color: #43a047;
}

/* Бейдж непрочитанных в вкладках */
.badge-unread {
    color: #d93025;
    font-weight: 700;
}

.sim-status-badge {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7em;
    font-family: 'UbuntuRBold';
    vertical-align: middle;
}

.sim-status-ok {
    background: #d3f9d8;
    color: #157f2b;
}

.sim-status-warn {
    background: #fff3bf;
    color: #8d6b00;
}

.sim-status-error {
    background: #ffe3e3;
    color: #c92a2a;
}

/* =========================
   Инфо по SIM над таблицей
   ========================= */

.sim-extra-info {
    width: 23%;
    max-width: 1000px;
    margin: 6px 0 4px;
    font-size: 0.95em;
    color: #333;
}

.sim-info-row {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sim-info-phone {
    font-weight: bold;
    font-family: 'UbuntuRBold';
}

.sim-info-status {
    font-family: 'UbuntuRBold';
}

/* Цвета статуса */
.sim-info-status.sim-status-ok {
    color: #0a8f08;
}

.sim-info-status.sim-status-error {
    color: #d62f2f;
}

.sim-info-status.sim-status-warn {
    color: #f39c12;
}

.sim-info-links {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.sim-info-link {
    font-size: 1.1em;
    font-weight: 800;
    color: #00e70c;
    text-decoration: none;
    opacity: 0.85;
}

.sim-info-link:hover {
    text-decoration: underline;
    opacity: 1;
}

@media (max-width: 700px) {
    .sim-info-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
