/**
 * Общие стили для модальных окон
 */

/* Применяем шрифт ко всем модальным окнам */
.modal,
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Базовые стили модального окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Открытое состояние модального окна */
.modal.is-open {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

/* Содержимое модального окна */
.modal-content {
    background: var(--panel-bg);
    border: 2px solid #333;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-left: 4px solid var(--accent-it);
    border-right: 4px solid var(--accent-car);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.is-open .modal-content {
    transform: scale(1);
}

/* Заголовок модального окна */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-it);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: var(--shadow-it);
}

/* Кнопка закрытия модального окна */
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-it);
}

.close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}

.close:hover {
    color: var(--accent-it);
}

/* Тело модального окна */
.modal-body {
    padding: 25px;
    color: var(--text-main);
}

.modal-body p {
    margin: 0 0 10px 0;
}

/* Ссылки в модальных окнах без подчеркивания */
.modal a,
.modal-body a {
    text-decoration: none;
    color: var(--accent-it);
}

.modal a:hover,
.modal-body a:hover {
    text-decoration: underline;
    text-shadow: var(--shadow-it);
}

/* Футер модального окна */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #333;
}

/* Предупреждающий текст в модальном окне */
.modal-warning {
    color: #ff6b6b;
    font-weight: 500;
    margin-top: 10px;
}

.text-warning {
    color: #ff6b6b;
    font-weight: 500;
    margin-top: 10px;
}

/* Анимация исчезновения сообщений */
.fade-out {
    opacity: 0 !important;
    transition: opacity 0.5s ease;
}

/* Кнопки модального окна */
.btn-modal {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-modal-danger {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff6b6b;
}

.btn-modal-danger:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.btn-modal-secondary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    color: var(--text-main);
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-it);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    color: var(--text-main);
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-it);
}

.btn-danger {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff6b6b;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* Кнопка закрытия модального окна (класс close-modal) */
.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-it);
}

/* Стили для модального окна подтверждения перехода (leave-modal) */
.leave-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.leave-modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #00d4ff;
    border-radius: 16px;
    padding: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 320px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.leave-modal-content h3 {
    color: #00d4ff;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.leave-modal-content p {
    color: #e0e0e0;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.5;
}

.leave-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.leave-modal-buttons button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leave-modal-buttons .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.leave-modal-buttons .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.leave-modal-buttons .btn-confirm {
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    color: #000;
}

.leave-modal-buttons .btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}
