/* Стили для модальных окон */
.modal:not(.fade) {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background-color: transparent; /* Убрали затемнение */
    justify-content: center;
    align-items: center;
}

.modal:not(.fade).show {
    display: flex;
}

/* Стили для Bootstrap modal-backdrop - убрали затемнение */
.modal-backdrop {
    display: none !important; /* Полностью скрываем backdrop */
    background-color: transparent !important;
}

.modal-backdrop.fade {
    display: none !important;
}

.modal-backdrop.show {
    display: none !important;
}

/* Убеждаемся, что Bootstrap модальные окна также покрывают весь экран */
.modal.fade {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1055;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    display: none;
}

.modal.fade.show {
    display: block;
}

/* Глобальное отключение backdrop для всех Bootstrap модальных окон */
.modal.fade {
    background-color: transparent !important;
}

/* Убеждаемся, что backdrop не создается */
.modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Стили для modal-box */
.modal-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Модальное окно авторизации */
#loginModal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 300px !important;
    z-index: 999999 !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

#loginModal h2 {
    text-align: center;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

#loginModal .form-group {
    margin-bottom: 0.75rem;
}

#loginModal .form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

#loginModal .form-group input:focus {
    outline: none;
    border-color: #007bff;
}

#loginModal .error-text {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    min-height: 1rem;
}

#loginModal .form-actions {
    margin-top: 0.75rem;
}

#loginModal .btn-primary {
    background-color: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

#loginModal .btn-primary:hover {
    background-color: #0056b3;
}

#loginModal .btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Закрытие модального окна */
.modal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal .close:hover {
    background-color: #f8f9fa;
    color: #212529;
}

