/* static/css/offer_modal.css */

/* Оверлей (затемнённый фон) */
.offer-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 !important;
}

.offer-modal-overlay.show {
    opacity: 1;
}

/* Контейнер модалки */
.offer-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.offer-modal-overlay.show .offer-modal {
    transform: scale(1);
}

/* Заголовок модалки */
.offer-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.offer-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.offer-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.offer-modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Тело модалки с прокруткой */
.offer-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.offer-modal-content {
    color: #374151;
    font-size: 15px;
    line-height: 1.7;
}

.offer-modal-content h1,
.offer-modal-content h2,
.offer-modal-content h3 {
    color: #111827;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.offer-modal-content h1:first-child,
.offer-modal-content h2:first-child,
.offer-modal-content h3:first-child {
    margin-top: 0;
}

.offer-modal-content p {
    margin: 0 0 1em 0;
}

.offer-modal-content ul,
.offer-modal-content ol {
    margin: 0 0 1em 0;
    padding-left: 1.5em;
}

.offer-modal-content li {
    margin-bottom: 0.5em;
}

/* Футер модалки */
.offer-modal-footer {
    padding: 20px 28px 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Чекбокс с согласием */
.offer-modal-checkbox {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

.offer-modal-checkbox input[type="checkbox"] {
    margin: 1px 12px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.offer-modal-checkbox label {
    font-size: 15px;
    color: #374151;
    cursor: pointer;
    user-select: none;
    line-height: 1.5;
}

/* Контейнер с кнопками */
.offer-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Стили кнопок */
.offer-modal-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.offer-modal-btn-cancel {
    background-color: #f3f4f6;
    color: #374151;
}

.offer-modal-btn-cancel:hover {
    background-color: #e5e7eb;
}

.offer-modal-btn-continue {
    background-color: #3b82f6;
    color: #ffffff;
}

.offer-modal-btn-continue:hover:not(:disabled) {
    background-color: #2563eb;
}

.offer-modal-btn-continue:disabled {
    background-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Индикатор загрузки */
.offer-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: #ffffff;
    font-size: 16px;
}

.offer-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .offer-modal-overlay {
        padding: 12px;
    }

    .offer-modal {
        max-width: 100%;
        border-radius: 8px;
        max-height: 95vh;
    }

    .offer-modal-header {
        padding: 20px;
    }

    .offer-modal-header h3 {
        font-size: 18px;
    }

    .offer-modal-body {
        padding: 20px;
    }

    .offer-modal-content {
        font-size: 14px;
    }

    .offer-modal-footer {
        padding: 16px 20px 20px;
    }

    .offer-modal-buttons {
        flex-direction: column;
    }

    .offer-modal-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .offer-modal-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}

/* Дополнительные стили для прокрутки */
.offer-modal-body::-webkit-scrollbar {
    width: 8px;
}

.offer-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.offer-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.offer-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
/* Информация о версии оферты */
.offer-modal-info {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #6b7280;
}

.offer-version,
.offer-date {
    display: flex;
    align-items: center;
}

.offer-version strong,
.offer-date strong {
    color: #374151;
    margin-right: 6px;
    font-weight: 600;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .offer-modal-info {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
        padding: 10px 14px;
    }
}