/* bot_app/web_app/css/components/modals.css */

/* Модальные окна */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1100; }

#info-modal.modal-overlay {
    z-index: 1200; /* Убедимся, что info-modal всегда поверх */
}
.modal-content { 
    background-color: var(--primary-color); 
    padding: 20px; 
    border-radius: 16px; 
    text-align: center; 
    width: 85%; 
    max-width: 320px; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.4); 
    border: 1px solid var(--secondary-color); 
    max-height: 80vh; 
    /* Делаем flex-контейнером для управления кнопкой */
    display: flex;
    flex-direction: column;
}

.modal-content .scrollable-grid {
    max-height: 45vh; /* Ограничиваем высоту, чтобы помещалась кнопка */
    overflow-y: auto;
    margin-top: 15px;
}

/* Заставляем кнопку "Закрыть" прижиматься к низу */
#dice-inventory-modal .modal-content .button-secondary {
    margin-top: 20px;
}

.modal-header {
    padding: 15px 20px 10px 20px; /* top right bottom left */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#withdraw-gifts-modal .modal-header {
    justify-content: center;
}

.modal-content h2 {
    margin: 0;
    text-align: center;
}

/* Специальное центрирование для заголовков модальных окон промокодов */
#create-promo-modal-title,
#activate-promo-modal-title {
    text-align: center !important;
    margin: 0 auto;
    display: block;
    width: 100%;
}

#info-modal .modal-message p {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the text and icon */
    gap: 5px; /* Add a small gap between text and icon */
    margin: 0; /* Remove default paragraph margins */
    position: relative; /* Make it a positioning context for absolute SVG */
}

#sell-confirm-message {
    display: flex;
    flex-direction: column; /* Allow text to stack */
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 21px; /* Добавляем высоту, чтобы модальное окно не "прыгало" */
    margin-bottom: 20px; /* Moved slightly higher */
    font-size: 17px; /* Slightly larger font size */
}

#sell-confirm-message .star-icon {
     width: 14px; /* Чуть больше для читаемости в тексте */
     height: 14px;
}

/* Общие стили для модальных окон с классами modal-body, modal-footer, text-input, button-primary, button-secondary */
.modal-content .modal-body {
    padding: 15px;
}

.modal-content .modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 20px; /* Добавляем отступ сверху */
}

.modal-buttons .button-primary,
.modal-buttons .button-secondary {
    flex: 1; /* Кнопки занимают равную ширину */
}

.modal-content .text-input {
    width: calc(100% - 20px); /* Учитываем padding */
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--secondary-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    box-sizing: border-box; /* Включаем padding и border в общую ширину */
}

.modal-content .button-primary,
.modal-content .button-secondary {
    flex-grow: 1;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.modal-content .button-primary {
    background-image: linear-gradient(to right, #28a745, #218838);
    color: white;
}

.modal-content .button-secondary {
    background-color: transparent;
    color: #aaa;
    border: 2px solid #555;
}

.modal-close-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    margin-top: 20px;
}

.modal-close-btn:hover {
    background-color: #3a3a3a;
}

.modal-close-btn:active {
    transform: scale(0.98);
}