/* static/css/stylesheet.css */
:root {
    --primary-bg: #FFFFFF;
    --secondary-bg: #1FE37B;
    --text-color: #000000;
    --button-bg: #9DC8E6;
    --button-text: #FFFFFF;
    --header-color: #000000;
    --list-text-color: #0000FF;
    --status-color: #32CD32;
    --blur-bg: rgba(255, 255, 255, 0.1);
    --main-bg: #FFFFFF;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --active-menu-color: #e9ecef;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --message-top-bg: #e9ecef;
    --message-block-bg: #f8f9fa;
    --calendar-bg: #e9f7fe;
    --calendar-day-bg: #f8f9fa;
    --calendar-selected-bg: #d4edda;
    --weekend-bg: #fff5f5; /* Цвет фона для выходных */
    --weekend-text: #e74c3c; /* Цвет текста для выходных */
    --calendar-header-bg: #e9ecef; /* Более мягкий цвет для шапки календаря */
    --calendar-header-text: #495057; /* Цвет текста шапки календаря */
    --order-link-bg: #d1ecf1; /* Цвет фона блока заявки */
    --order-link-border: #bee5eb; /* Цвет границы блока заявки */
    --order-link-hover: #c3e6cb; /* Цвет фона при наведении */
}

/* Основные стили */
body {
    display: flex;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-bottom: 120px; /* Добавлен отступ снизу для меню */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background-color: var(--main-bg);
    border-radius: 8px;
    width: 100%;
    max-width: 1200px;
}

/* Блоки и карточки */
.block {
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
    margin: 2.5px;
    cursor: pointer;
    padding: 10px;
    background: var(--blur-bg);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.block-full {
    flex: 1 1 100%;
}

.block h3, .block h4, .block h5, .block h6 {
    margin-top: 0;
    color: var(--header-color);
    font-weight: bold;
}

/* Навигация и меню */
.secondary-menu, .menu {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #f8f9fa;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
}

.secondary-menu {
    bottom: 60px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.secondary-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

.menu {
    justify-content: space-around;
}

.menu-button, .menu-second-button {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    border-radius: 5px;
    padding: 15px;
    background-color: #719cf1;
    color: white;
}

.menu-button {
    flex: 1;
}

.menu-second-button {
    padding: 10px 15px;
    margin: 0 5px;
    min-width: fit-content;
}

.menu-button.active, .menu-second-button.active {
    background-color: var(--active-menu-color) !important;
    color: #000000 !important;
    font-weight: bold;
}

.menu-button:hover, .menu-second-button:hover {
    background-color: #c6e2ff;
}
/* навигация по альбому */
.album-menu {
    position: fixed;
    width: 100%;
    background-color: #719cf1;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    bottom: 60px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.album-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

.album-menu {
    justify-content: space-around;
}

.album-menu-button {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    border-radius: 5px;
    background-color: #719cf1;
    color: white;
    flex: 1;
    padding: 10px 15px;
    margin: 0 5px;
    min-width: fit-content;
}

.album-menu-button.active {
    background-color: var(--active-menu-color) !important;
    color: #000000 !important;
    font-weight: bold;
}

.album-menu-button:hover {
    background-color: #c6e2ff;
}

/* Адаптивность */
@media screen and (max-width: 768px) {
    .menu-button {
        font-size: 12px;
        padding: 10px;
    }

    .menu-second-button {
        min-width: 100px;
        font-size: 12px;
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .block {
        margin: 5px;
        padding: 8px;
    }
}

/* Формы и элементы управления */
.form-control, .form-select {
    border-radius: 6px;
    padding: 8px 12px;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

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

.btn-warning {
    background-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-info {
    background-color: var(--info-color);
}

/* Сообщения и уведомления */
.messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 350px;
}

/* Статичные сообщения (встроенные в контент) */
.container .alert {
    margin-bottom: 1rem;
    border-radius: 0.375rem;
}

/* Плавающие сообщения (исчезают через 3 секунды) */
.floating-messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 350px;
}

.floating-message {
    position: relative;
    margin-bottom: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
    background-color: var(--message-top-bg);
}

.message-fade-out {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

/* Постоянные сообщения (исчезают только по закрытию) */
.persistent-messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 350px;
}

.persistent-message {
    position: relative;
    margin-bottom: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: var(--message-top-bg);
    animation: slideIn 0.3s ease-out;
}

.message-content {
    flex: 1;
    font-weight: 500;
}

.message-close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    padding-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.message-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Альбомы и файлы */
.album-container {
    font-family: Arial, sans-serif;
    margin-bottom: 50px;
    width: 100%;
}

.album-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-item {
    transition: all 0.2s ease;
    background-color: #fff;
    animation: fadeIn 0.3s ease-out;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.file-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.file-item h6 a {
    color: #007bff;
    font-weight: 500;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
}

.file-item h6 a:hover {
    color: #0056b3;
    background-color: #f8f9fa;
    text-decoration: none !important;
}

.album-info p {
    margin-bottom: 0.5rem;
    color: #495057;
}

.badge {
    font-size: 0.75em;
    font-weight: normal;
}

.border.rounded {
    border-radius: 8px !important;
}

/* Форма загрузки */
.upload-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 30px;
    padding: 20px;
}

.upload-section h4 {
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* Превью изображений */
.file-preview {
    flex-shrink: 0;
}

.file-preview img {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    max-width: 100%;
    height: auto;
}

.file-preview img:hover {
    transform: scale(1.05);
}

/* Текстовые стили */
.text-muted {
    color: #6c757d !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Сообщения обсуждения */
.message-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff;
    position: relative;
    transition: all 0.2s ease;
}

.message-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-author {
    font-weight: 500;
    color: #000;
}

.message-author-role {
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 5px;
    padding: 2px 5px;
}

.message-time {
    font-size: 0.85rem;
    color: #6c757d;
}

.message-content {
    line-height: 1.5;
}

.message-files {
    margin-top: 10px;
}

.message-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.message-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-reply {
    margin-left: 30px;
    border-left: 2px solid #dee2e6;
    padding-left: 15px;
}

/* Блок ответа */
.reply-form {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.reply-form h5 {
    margin-top: 0;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .message-actions {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .message-actions .btn {
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .message-replies {
        margin-left: 15px;
    }

    .reply-form {
        margin-top: 10px;
        padding: 10px;
    }
}

/* Стили календаря */
.calendar {
    overflow-x: auto;
}

.calendar-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    width: 100%;
}

.calendar {
    width: 100%;
    min-width: 650px;
    overflow-x: auto;
}

.calendar table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    margin-top: 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

.calendar table tr th {
    text-align: center;
    font-size: 16px;
    background-color: var(--calendar-header-bg); /* Более мягкий цвет */
    color: var(--calendar-header-text); /* Более темный цвет текста */
    padding: 10px;
    font-weight: bold;
    white-space: nowrap;
}

.calendar table tr th.weekend {
    background-color: #d6d8db; /* Более мягкий цвет для выходных в шапке */
    color: var(--calendar-header-text);
}

.calendar table tr th.month {
    background-color: #d1d1d1; /* Еще более мягкий цвет для месяца */
    color: #2d2d2d;
    font-size: 18px;
    padding: 12px;
}

.calendar table tr td {
    width: 14.28%;
    border: 1px solid #dee2e6;
    vertical-align: top;
    height: 120px;
    padding: 10px;
    text-align: left;
}

.calendar td.noday {
    background-color: var(--calendar-day-bg);
    color: #6c757d;
}

.calendar td.filled {
    background-color: var(--calendar-bg);
}

.calendar td.today {
    background-color: var(--calendar-selected-bg);
    border: 2px solid #28a745;
}

.calendar .day-number {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
    color: #333;
}

.calendar .order-links {
    margin-top: 5px;
    font-size: 0.85em;
}

/* Улучшенные стили для блока с заявкой */
.calendar .order-link {
    margin: 3px 0;
    padding: 5px 8px;
    border-radius: 5px;
    background-color: var(--order-link-bg); /* Более насыщенный цвет фона */
    border: 2px solid var(--order-link-border); /* Более выраженная граница */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.calendar .order-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.calendar .order-link a {
    display: block;
    padding: 4px 6px;
    border-radius: 3px;
    text-decoration: none;
    color: #0c5460; /* Более темный цвет текста для лучшей читаемости */
    font-weight: 500; /* Жирный шрифт для лучшей видимости */
    transition: all 0.2s;
}

.calendar .order-link a:hover {
    background-color: var(--order-link-hover);
    color: #004085;
    text-decoration: none;
}

.calendar .order-link a:visited {
    color: #0c5460;
}

.calendar .order-link a:visited:hover {
    color: #004085;
}

/* Стили для выходных дней */
.calendar table tr td.sat, .calendar table tr td.sun {
    background-color: var(--weekend-bg);
}

.calendar table tr td.sat .day-number, .calendar table tr td.sun .day-number {
    color: var(--weekend-text);
}

/* Навигация календаря - более заметные и крупные кнопки */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.calendar-nav-button {
    font-size: 1.15rem;
    padding: 12px 20px;
    min-height: 50px;
    font-weight: 600;
    border-radius: 6px;
    background-color: #e9f7fe;
    border: 1px solid #d4edda;
    transition: all 0.2s ease;
}

.calendar-nav-button:hover {
    background-color: #d4edda;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.calendar-nav-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* Стили для направления текста */
.rtl {
    direction: rtl;
    text-align: right;
}

.ltr {
    direction: ltr;
    text-align: left;
}

.lang-he, .lang-ar {
    direction: rtl;
    text-align: right;
}

.lang-he .calendar table tr th,
.lang-he .calendar table tr td,
.lang-ar .calendar table tr th,
.lang-ar .calendar table tr td {
    text-align: right;
}

/* Адаптивные стили для календаря */
@media (max-width: 768px) {
    .calendar {
        margin-top: 10px;
        width: 100%;
        min-width: 100%;
    }

    .calendar table {
        font-size: 0.85em;
        min-width: 100%;
        width: 100%;
    }

    .calendar table tr th {
        padding: 5px 3px;
        font-size: 12px;
    }

    .calendar table tr td {
        height: 80px;
        padding: 5px;
        font-size: 0.8em;
        width: 14.28%;
    }

    .calendar .day-number {
        font-size: 1.0em;
    }

    .calendar .order-links {
        font-size: 0.75em;
    }

    .calendar .order-link {
        padding: 3px 5px;
        margin: 2px 0;
    }

    .calendar .order-link a {
        padding: 2px 4px;
        font-size: 0.8em;
    }

    .calendar-nav-button {
        font-size: 1.05rem;
        padding: 10px 15px;
        min-height: 45px;
    }

    .calendar-table-container {
        padding: 5px;
        width: 100%;
        min-width: 100%;
    }

    /* Альтернативное отображение для очень маленьких экранов */
    @media (max-width: 480px) {
        .calendar table {
            min-width: 100%;
            font-size: 0.8em;
        }

        .calendar table tr th {
            font-size: 10px;
        }

        .calendar table tr td {
            height: 70px;
            padding: 3px;
        }

        .calendar .day-number {
            font-size: 0.9em;
        }

        .calendar .order-link a {
            font-size: 0.75em;
            padding: 1px 3px;
        }
    }
}

/* Адаптивные улучшения */
@media (max-width: 768px) {
    .album-container {
        padding: 0 15px;
    }

    .album-header {
        padding: 15px;
    }

    .file-item {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .album-info p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .messages-container {
        width: 90%;
        right: 5%;
        top: 10px;
    }

    .floating-messages-container,
    .persistent-messages-container {
        width: 90%;
        right: 5%;
        top: 10px;
    }
}

.navigator-link-btn {
    display: inline-block;
    padding: 6px 12px;
    background-color: #007bff;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 0.9em;
}

.navigator-link-btn:hover {
    background-color: #0056b3;
    color: white !important;
    text-decoration: none;
}

.navigator-link-btn i {
    margin-right: 5px;
}

/* Улучшенные стили для мобильного календаря */
@media (max-width: 768px) {
    body {
        padding-bottom: 120px; /* Увеличен отступ для меню */
    }

    .calendar-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100vw;
    }

    .calendar {
        min-width: 100%;
        width: 100%;
    }

    .calendar table {
        min-width: 100%;
        width: 100%;
    }

    /* Убедимся, что таблица не выходит за границы экрана */
    .calendar table {
        table-layout: fixed;
    }

    .calendar table tr td {
        width: 14.28%; /* 100% / 7 дней */
        word-wrap: break-word;
    }
}

/* Стили для marketplace */

/* Бейджи статусов */
.badge-status-pending {
    background-color: #6c757d;
    color: white;
}

.badge-status-searching {
    background-color: #007bff;
    color: white;
}

.badge-status-found {
    background-color: #28a745;
    color: white;
}

.badge-status-ordering {
    background-color: #ffc107;
    color: #212529;
}

.badge-status-ordered {
    background-color: #fd7e14;
    color: white;
}

.badge-status-paid {
    background-color: #28a745;
    color: white;
}

.badge-status-processing {
    background-color: #17a2b8;
    color: white;
}

.badge-status-shipped {
    background-color: #007bff;
    color: white;
}

.badge-status-delivered {
    background-color: #28a745;
    color: white;
}

.badge-status-received {
    background-color: #28a745;
    color: white;
}

.badge-status-installed {
    background-color: #218838;
    color: white;
}

.badge-status-cancelled {
    background-color: #dc3545;
    color: white;
}

/* Стили для карточек оборудования */
.equipment-card {
    transition: transform 0.2s;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.equipment-card:hover {
    transform: translateY(-5px);
}

/* Стили для поиска */
.search-controls {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

/* Стили для таблицы каталога */
.catalog-table {
    width: 100%;
    border-collapse: collapse;
}

.catalog-table th {
    background-color: #e9ecef;
    padding: 10px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.catalog-table td {
    padding: 10px;
    border: 1px solid #dee2e6;
}

.catalog-table tr:hover {
    background-color: #f8f9fa;
}

/* Стили для формы поиска */
.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form .form-control {
    flex: 1;
    min-width: 200px;
}

/* Стили для пагинации */
.pagination-container {
    margin-top: 30px;
    text-align: center;
}

/* Стили для уведомлений */
.notification-item {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.notification-item-read {
    background-color: #f8f9fa;
}

.notification-item-unread {
    background-color: #e9ecef;
    font-weight: bold;
}

/* Стили для формы обновления статуса */
.status-update-form {
    margin-top: 20px;
}

/* Стили для деталей оборудования */
.equipment-details {
    margin-top: 20px;
}

.equipment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.equipment-actions {
    display: flex;
    gap: 10px;
}

/* Стили для карточек поиска */
.search-card {
    transition: all 0.3s ease;
}

.search-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Стили для импорта каталога */
.import-section {
    margin-top: 30px;
}

.import-status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.import-status-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.import-status-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Стили для кнопок действий */
.action-buttons {
    display: flex;
    gap: 10px;
}

/* Стили для блока информации */
.info-block {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 20px 0;
}

#import-spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
}
