/* ==========================================
   КРАТКОЕ ОГЛАВЛЕНИЕ
   ==========================================
   ФАЙЛ: edit-chat-modal.css
   НАЗНАЧЕНИЕ: Стили модального окна редактирования чат-комнаты
   (Структура идентична add-chat-modal.css, только классы с edit-)
   ========================================== */

.edit-chat-modal {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ffdd76;
    border-radius: 12px;
    z-index: 1000;
    padding: 20px 28px;
    padding-top: 60px; /* отступ под абсолютную кнопку "Найти" */
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.edit-chat-modal.active { display: flex; }

.edit-chat-modal__close {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    font-size: 30px; color: var(--text-dark);
    line-height: 1; cursor: pointer;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease;
    z-index: 1001;
}

.edit-chat-modal__close:hover { transform: scale(1.2); }

.edit-chat-modal__content {
    width: calc(100% - 60px);
    max-width: 760px;
    margin: 0 auto;
}

.edit-chat-modal__title {
    font-size: 20px; font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 20px 0;
    text-align: center;
}

.edit-chat-modal__form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.edit-chat-modal__input {
    border: none; border-radius: 8px;
    padding: 13px 16px; font-size: 14px;
    color: var(--text-dark); font-family: inherit;
    background: #fff; outline: none;
    transition: box-shadow 0.2s;
    width: 100%; box-sizing: border-box;
}

.edit-chat-modal__input:focus { box-shadow: 0 0 0 2px var(--green-primary); }
.edit-chat-modal__input::placeholder { color: #999; }

.edit-chat-modal__icon-upload {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-radius: 8px; padding: 8px 12px;
}

.edit-chat-modal__icon-preview {
    width: 44px; height: 44px; border-radius: 8px;
    background: #e8f5e9; display: flex;
    align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
    color: var(--green-primary);
}

.edit-chat-modal__icon-img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 8px;
}

.edit-chat-modal__icon-btn {
    flex: 1; font-size: 13px; font-weight: 600;
    color: #555; background: #f0f0f0; border: none;
    border-radius: 6px; padding: 9px 10px;
    cursor: pointer; font-family: inherit;
    transition: background 0.2s; text-align: center; line-height: 1.3;
}

.edit-chat-modal__icon-btn:hover { background: #e0e0e0; }

.edit-chat-modal__link-field {
    background: #fff; border-radius: 8px;
    padding: 10px 12px; display: flex;
    flex-direction: column; gap: 6px;
}

.edit-chat-modal__link-label {
    font-size: 11px; font-weight: 600;
    color: #888; text-transform: uppercase; letter-spacing: 0.4px;
}

.edit-chat-modal__link-copy {
    display: flex; align-items: center; gap: 8px;
}

.edit-chat-modal__link-input {
    flex: 1; border: 1px solid #e8e8e8; border-radius: 6px;
    padding: 6px 10px; font-size: 12px; color: #555;
    background: #f8f8f8; outline: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.edit-chat-modal__copy-btn {
    background: #1a6b6d; color: #fff;
    border: none; border-radius: 6px; padding: 7px 9px;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.2s;
}

.edit-chat-modal__copy-btn:hover { opacity: 0.85; }
.edit-chat-modal__copy-btn.copied { background: #43a047; }

.edit-chat-modal__toggle {
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    background: #fff; border-radius: 8px; padding: 10px 14px;
}

.edit-chat-modal__toggle input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--green-primary);
    cursor: pointer; flex-shrink: 0;
}

.edit-chat-modal__toggle-label {
    font-size: 14px; font-weight: 600; color: var(--text-dark);
}

.edit-chat-modal__toggle-desc {
    font-size: 12px; color: #888; margin-top: 2px;
}

.edit-chat-modal__save {
    padding: 15px 30px; background: #4caf50;
    color: #fff; border: none; border-radius: 8px;
    font-size: 16px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: all 0.3s ease; width: 100%;
}

.edit-chat-modal__save:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.edit-chat-modal__save:disabled {
    background: #a5d6a7; cursor: not-allowed;
    transform: none; box-shadow: none;
}

@media (max-width: 600px) {
    .edit-chat-modal__form { grid-template-columns: 1fr; }
    .edit-chat-modal__content { width: 100%; }
    .edit-chat-modal {
        padding: 16px;
        padding-top: 16px;
    }
    .add-chat-modal__find-btn {
        position: static;
        transform: none;
        width: auto;
        align-self: center;
        margin-bottom: 14px;
    }
    .add-chat-modal__find-btn:hover {
        transform: translateY(-1px);
    }
    /* Крестик — в потоке, всегда виден сверху */
    .edit-chat-modal__close {
        position: static;
        align-self: flex-end;
        margin-bottom: 4px;
        font-size: 24px;
    }
}
