/* Global */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #0000AF; /* solid blue */
    color: #fff;
    text-align: center;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("/public/assets/web_graphic.png") no-repeat center/cover;
    filter: brightness(0) invert(1) opacity(0.2); /* turns blue lines into light grey */
    z-index: 0;
}

/* put page content above background */
header, main, footer {
    position: relative;
    z-index: 1;
}

header, footer {
    padding: 1rem;
}

.logo {
    max-width: 200px;
}

/* Screens */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 230px);
    padding: 1rem;
}

.screen {
    display: none;
    max-width: 400px;
    width: 100%;
}

.screen.active {
    display: block;
}

h2 {
    margin-bottom: 1.5rem;
}

/* Buttons */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

button {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}

.highlight {
    background: orange;
    color: #000;
    font-weight: bold;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    padding: 0.8rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
}

.styled-button {
    display: inline-block;
    padding: 6px 24px;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
}
.styled-button:hover {
    background: linear-gradient(135deg, #5a7dfa, #9b66e0);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.styled-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #4CAF50;
}
.notification.error {
    background-color: #f44336;
}
.notification.info {
    background-color: #006eff;
}

/*---------------*/
/* Стили для кастомных скроллбаров */
.left-menu,
.content-area,
.sidebar-content {
    scrollbar-width: thin; /* Для Firefox */
    scrollbar-color: transparent transparent; /* По умолчанию прозрачный */
    overflow-y: auto;
    overflow-x: hidden;
}

.left-menu:hover,
.content-area:hover,
.sidebar-content:hover {
    scrollbar-color: #888 transparent; /* Цвет при наведении для Firefox */
}

/* Webkit браузеры (Chrome, Safari, Edge) */
.left-menu::-webkit-scrollbar,
.content-area::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

.left-menu::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
    margin: 4px 0; /* Отступ сверху и снизу */
}

.left-menu::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.3s ease;
    border: 1px solid transparent; /* Добавляем границу для одинакового вида */
    background-clip: content-box; /* Важно для правильного отображения */
}

.left-menu:hover::-webkit-scrollbar-thumb,
.content-area:hover::-webkit-scrollbar-thumb,
.sidebar-content:hover::-webkit-scrollbar-thumb {
    background: #888;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.left-menu:hover::-webkit-scrollbar-thumb:hover,
.content-area:hover::-webkit-scrollbar-thumb:hover,
.sidebar-content:hover::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Гарантируем одинаковые отступы для всех скроллируемых областей */
.left-menu {
    padding-right: 4px !important; /* Небольшой отступ для скроллбара */
}

.content-area {
    padding-right: 4px !important;
}

.sidebar-content {
    max-height: calc(72vh - 60px); /* Учитываем заголовок боковой панели */
    padding-right: 4px !important;
}

.left-menu::after,
.content-area::after,
.sidebar-content::after {
    content: "";
    display: block;
    height: 1.5em; /* Высота одной строки текста */
    width: 100%;
    pointer-events: none; /* Чтобы не мешало кликам */
}

/* Убираем стандартное поведение смещения контента */
.left-menu,
.content-area,
.sidebar-content {
    scrollbar-gutter: stable; /* Резервирует место под скроллбар */
}

/* Для Firefox добавляем дополнительное резервирование места */
@supports (scrollbar-width: thin) {
    .left-menu,
    .content-area,
    .sidebar-content {
        padding-right: 12px !important;
    }
}
/*---------------*/

/*---------------*/
/* Дополнительные стили для основной структуры кабинета */
.left-menu {
    background-color: #3c3c417d;
    backdrop-filter: blur(3px);
    min-height: 72vh;
    max-height: 72vh;
    border-radius: 5px;
    /*border-right: 1px solid #dee2e6;*/
}
.content-area {
    background-color: #ffffff45;
    backdrop-filter: blur(3px);
    min-height: 72vh;
    max-height: 72vh;
    border-radius: 5px;
}
.right-sidebar {
    background-color: #3c3c417d;
    backdrop-filter: blur(3px);
    min-height: 72vh;
    max-height: 72vh;
    border-radius: 5px;
    /*border-left: 1px solid #dee2e6;*/
}
.menu-item {
    padding: 5px 15px;
    border-bottom: 1px solid #e9ecef85;
    text-decoration: none;
    color: #FFFFFF;
    display: block;
}
.menu-item:hover {
    background-color: #e9ecef80;
}
/* Гарантируем, что колонки всегда занимают место */
.sticky-column {
    position: sticky;
    top: 0;
    align-self: flex-start;
}
/*---------------*/

/*---------------*/
/* Стили для бегущей строки */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    position: relative;
    flex: 1;
    margin-left: 30px;
    background: rgb(245 105 250 / 44%);
    backdrop-filter: blur(3px);
    border-radius: 4px;
    padding: 5px 10px;
}
.marquee {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    color: #00dcd2;
    font-weight: 500;
    padding-left: 100%;
    padding-top: 12px;
    font-size: 24px;
}
.marquee:hover {
    animation-play-state: paused;
}
@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}
/*---------------*/

/*---------------*/
/*мигающий елемент*/
@keyframes blink {
    50% {
        opacity: 0; /* Делаем элемент невидимым на полпути анимации */
    }
}
.blinking-element {
    animation: blink 1s step-end infinite; /* Применяем анимацию: 1 секунда, без сглаживания, бесконечно */
}
/*---------------*/

/* === Стили для прелоадера === */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white; /* можно поменять на #f5f5f5 или другой цвет */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
/* Скрытие прелоадера */
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
/* Анимация вращающегося кольца */
.loader {
    width: 60px;
    height: 60px;
    border: 6px solid #ddd;
    border-top-color: #3498db; /* цвет кольца */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Пример содержимого */
body {
    font-family: sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
}
/*---------------*/

.multiline-ellipsis {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* Ограничить 3 строками */
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #e9ecef85;
    text-decoration: none;
    display: block;
}

.sse-status{
    position: static;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-bottom: -18px;
    background-color: red;
    border: 1px solid #000;
    z-index: 1000;
}
.avatar {
    max-width: 66%;
    height: auto;
    border-radius: 100%;
}

/*-------Загрузка файлов аватаров--------*/
.avatar-wrapper {
    display: flex;
    justify-content: flex-start;
    padding: 15px 0;
}
.avatar-block {
    display: flex;
    align-items: flex-start; /* выравнивание по верхнему краю */
    gap: 15px; /* расстояние между аватаром и текстом */
}
.avatar-image {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}
.avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 100%;
}
.edit-avatar-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: #FFAF00;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.edit-avatar-btn:hover {
    background-color: #e59400;
}
.avatar-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.avatar-info p {
    margin: 3px 0;
    font-size: 14px;
}
/* Плавный hover для кнопки «✎» */
.edit-avatar-btn {
    transition: background-color 0.2s, transform 0.2s;
}
.edit-avatar-btn:hover {
    background-color: #e59400; /* ярче при наведении */
    transform: scale(1.1);       /* чуть увеличиваем кнопку */
}
/*---------------*/

/*-------style for main-content--------*/
/* Общая сетка */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    gap: 20px;
}
.form-label {
    flex: 1;
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
}
.textarea-row {
    align-items: flex-start;
}

/* Контрол с плюс/минус */
.number-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.number-control input {
    width: 70px;
    padding: 6px;
    text-align: center;
    font-size: 16px;

    /* убираем браузерные стрелки */
    -moz-appearance: textfield;
}
.number-control input::-webkit-outer-spin-button,
.number-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Кнопки +/- */
.num-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #00DCD2;
    color: #000;
    border-radius: 4px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.num-btn:hover {
    background: #00c2bb;
}
.total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 25px;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.total-label {
    margin-right: 10px;
    color: #fff;
}

.total-value {
    background: #00DCD2;
    color: #000;
    padding: 6px 14px;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
}

/* textarea */
textarea {
    width: 100%;
    padding: 8px;
    font-size: 15px;
    resize: vertical;
}

/* кнопка отправки */
.submit-btn {
    margin-top: 15px;
    padding: 10px 16px;
    font-size: 16px;
    cursor: pointer;
    background: #FFAF00;
    border: none;
    color: #000;
    border-radius: 4px;
}
.submit-btn:hover {
    background: #e99c00;
}
/*----------------------*/


/* Responsive */
@media (min-width: 768px) {
    .screen {
        max-width: 600px;
    }
    button {
        font-size: 1.2rem;
    }
}
