/* modal.css - Стили для модальных окон с улучшенной мобильной адаптацией */

/* Общие стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 25px 20px;
    border-radius: 12px;
    width: 95%;
    max-width: 500px;
    max-height: 85vh; /* Ограничение по высоте */
    overflow-y: auto; /* Прокрутка если контент не помещается */
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(13,26,41,0.1);
    position: relative;
    
    /* Улучшения для мобильных */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .modal-content {
        margin: 2% auto;
        padding: 20px 15px;
        width: 98%;
        max-height: 90vh; /* Больше высота на мобильных */
        border-radius: 8px;
    }
    
    .modal h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 60px 15px 20px; /* Больше отступ сверху для крестика */
    }
    
    .close-modal {
        position: fixed;
        top: 15px;
        right: 15px;
        background: var(--card-bg);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}

.modal h3 {
    color: var(--text);
    margin-bottom: 20px;
    font-family: Montserrat, Inter, sans-serif;
    word-wrap: break-word;
}

.close-modal {
    color: var(--muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
}

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

/* Стили для Telegram модального окна */
.telegram-qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    max-width: 100%; /* Защита от переполнения */
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .telegram-qr-code {
        width: 180px;
        height: 180px;
        margin: 0 auto 15px;
    }
}

.telegram-link {
    display: block;
    color: var(--sea-turquoise);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 15px 0;
    padding: 12px;
    border: 2px solid var(--sea-turquoise);
    border-radius: 8px;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.telegram-link:hover {
    background-color: var(--sea-turquoise);
    color: white;
}

.telegram-description {
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Стили для модального окна обратной связи */
.feedback-content {
    text-align: left;
}

.feedback-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .feedback-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
}

.feedback-message {
    color: var(--text);
    margin-bottom: 25px;
    line-height: 1.6;
    word-wrap: break-word;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.contact-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid rgba(13,26,41,0.1);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    min-height: 60px;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .contact-option {
        padding: 12px;
        min-height: 55px;
    }
}

.contact-option:hover {
    background-color: var(--section-bg);
    border-color: var(--sea-turquoise);
}

.contact-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
    flex-shrink: 0; /* Запрещаем уменьшение иконки */
}

.contact-text {
    flex: 1;
    min-width: 0; /* Позволяет тексту переноситься */
}

.contact-title {
    font-weight: 600;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.contact-description {
    color: var(--muted);
    font-size: 0.9rem;
    word-wrap: break-word;
}

/* Предотвращение прокрутки body когда модальное окно открыто */
body.modal-open {
    overflow: hidden;
}