/* Новый современный стиль модального окна */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    transition: opacity 0.2s;
    opacity: 1;
    pointer-events: all;
}
.modal[hidden] {
    opacity: 0;
    pointer-events: none;
}
.modal__dialog {
    background: white; /* Задаем белый фон для светлой темы */
    border-radius: 16px;
    max-width: 95vw;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); /* Добавляем тень для лучшей видимости */
    position: relative;
    padding: 32px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    animation: modal-fade-in 0.2s;
}

/* Специальные размеры для iframe модального окна */
.modal__dialog:has(.modal-iframe-container) {
    width: 90vw;
    max-width: 1200px;
    max-height: 95vh;
    height: 90vh;
    padding: 16px;
}

@media (max-width: 768px) {
    .modal__dialog:has(.modal-iframe-container) {
        width: 98vw;
        height: 95vh;
        max-height: 95vh;
        padding: 8px;
    }
}

/* Fallback для браузеров без поддержки :has() */
.modal__dialog.iframe-modal {
    width: 90vw;
    max-width: 1200px;
    max-height: 95vh;
    height: 90vh;
    padding: 16px;
}

@media (max-width: 768px) {
    .modal__dialog.iframe-modal {
        width: 98vw;
        height: 95vh;
        max-height: 95vh;
        padding: 8px;
    }
}

[data-theme='dark'] .modal__dialog {
    background: var(--bg-light, #2a2a2a); /* Темный фон для темной темы */
    color: var(--text-dark, #ffffff);
}

/* Стили для содержимого модального окна */
.modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

[data-theme='dark'] .modal-header h3 {
    color: var(--text-dark, #ffffff);
}

[data-theme='dark'] .modal-header {
    border-bottom-color: #444;
}

.modal-content {
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

[data-theme='dark'] .modal-actions {
    border-top-color: #444;
}

/* Стили для формы в модальном окне */
.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
}

[data-theme='dark'] .modal .form-group label {
    color: var(--text-dark, #ffffff);
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

[data-theme='dark'] .modal .form-group input,
[data-theme='dark'] .modal .form-group select,
[data-theme='dark'] .modal .form-group textarea {
    background: #333;
    border-color: #555;
    color: var(--text-dark, #ffffff);
}

.modal .form-error {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

@keyframes modal-fade-in {
    from { transform: translateY(40px) scale(0.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #555;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}
@media (max-width: 600px) {
    .modal__dialog {
        width: 98vw;
        min-width: 0;
        padding: 16px 6px 16px 6px;
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: none; /* Убираем тень */
    z-index: 1100;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-info {
    background: linear-gradient(135deg, var(--primary-color, #3e6d26), #2e531d);
}

.notification-success {
    background: linear-gradient(135deg, var(--secondary-color), #1e7e34);
}

.notification-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.notification-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

/* Responsive modal */
@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: 16px;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

html, body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Стили для изображений тарифов - чтобы не обрезались */
.tariff-photo,
.tariff-image,
.tariff-image-container img,
.tariff-card img,
[class*="tariff"] img {
    object-fit: contain !important;
    object-position: center !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* Для контейнеров изображений */
.tariff-media,
.tariff-image-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}