/* GeoDirectory Hotel Chat Styles */
.gdhc-chat-container {
    width: 100%;
    margin: 0;                  /* ← убрал любой внешний отступ */
    padding: 0;                 /* ← убрал любой внешний паддинг */
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.gdhc-chat-container .gdhc-chat-wrapper {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 0;                  /* ← на всякий случай убираем отступы у обёртки */
}

.gdhc-chat-container .gdhc-chat-header {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.gdhc-chat-container .gdhc-user-info {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
    padding: 0 10px;
}

.gdhc-chat-container .gdhc-admin-badge {
    background: #4CAF50;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 8px;
}

.gdhc-chat-container #gdhc-chat-messages {
    max-height: 600px;
    min-height: 100px;
    overflow-y: auto;
    padding: 10px 10px 10px 0;  /* ← убрал отступ слева (было 10px со всех сторон) */
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;                  /* ← дополнительно убираем любой margin */
}

.gdhc-chat-container .gdhc-user-message, 
.gdhc-chat-container .gdhc-admin-message,
.gdhc-chat-container .gdhc-owner-message,
.gdhc-chat-container .gdhc-bot-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 70%;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.gdhc-chat-container .gdhc-user-message {
    background-color: #f1f1f1;
    color: #333;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.gdhc-chat-container .gdhc-owner-message {
    background-color: #00ffd5;
    color: #333;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.gdhc-chat-container .gdhc-admin-message {
    background-color: #c957f7;
    color: rgb(217, 255, 0);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.gdhc-chat-container .gdhc-bot-message {
    background-color: #00eeff;
    color: rgb(44, 43, 43);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.gdhc-chat-container .gdhc-message-text {
    font-size: 1em;
}

.gdhc-chat-container .gdhc-reply-quote {
    border-left: 2px solid #0088cc;
    padding-left: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #666;
}

.gdhc-chat-container .gdhc-reply-button,
.gdhc-chat-container .gdhc-delete-button {
    background: #fff;
    border: none;
    color: #0088cc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8em;
    display: none;
}

.gdhc-chat-container .gdhc-delete-button {
    color: #e74c3c;
}

.gdhc-chat-container .gdhc-user-message:hover .gdhc-reply-button,
.gdhc-chat-container .gdhc-admin-message:hover .gdhc-reply-button,
.gdhc-chat-container .gdhc-owner-message:hover .gdhc-reply-button,
.gdhc-chat-container .gdhc-bot-message:hover .gdhc-reply-button,
.gdhc-chat-container .gdhc-user-message:hover .gdhc-delete-button,
.gdhc-chat-container .gdhc-admin-message:hover .gdhc-delete-button,
.gdhc-chat-container .gdhc-owner-message:hover .gdhc-delete-button,
.gdhc-chat-container .gdhc-bot-message:hover .gdhc-delete-button {
    display: inline-block;
}

.gdhc-chat-container .gdhc-reply-preview {
    background: #f9f9f9;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.gdhc-chat-container .gdhc-cancel-reply {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.8em;
}

.gdhc-chat-container .gdhc-timestamp {
    font-size: 0.75em;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

.gdhc-chat-container .gdhc-chat-form {
    display: flex;
    align-items: flex-end;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.gdhc-chat-container .gdhc-form-group {
    display: flex;
    align-items: flex-end;
    position: relative;
    flex: 1;
}

.gdhc-chat-container #gdhc-message-input {
    min-width: 840px;
    min-height: 40px;
    padding: 10px 40px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.gdhc-chat-container #gdhc-send-button {
    background: #02acfc;
    border-radius: 50%;
    border: none;
    justify-content: center;
    font-size: 20px;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    color: #0088cc;
    width: 40px;
    height: 40px;
}

.gdhc-chat-container #gdhc-send-button:hover {
    background: #021bfc;
    border-radius: 50%;
    border: none;
    justify-content: center;
    font-size: 20px;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    color: #0088cc;
    width: 40px;
    height: 40px;
}

.gdhc-send-icon {
    color: white;
    font-size: 20px;
}

/* Форма чата */
.gdhc-chat-container .gdhc-chat-form {
    position: relative; /* Чтобы абсолютное позиционирование работало внутри формы */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Контейнер для textarea */
.gdhc-chat-container .gdhc-form-group {
    position: relative;
    flex: 1; /* Занимает всё доступное пространство */
}

/* Textarea */
.gdhc-chat-container .gdhc-message-input {
    width: 100%;
    resize: none;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Контейнер для действий (кнопка эмодзи) */
.gdhc-chat-container .gdhc-message-actions {
    display: flex;
    align-items: center;
    position: absolute;
    right: 10px;
    top: 10%;
    transform: translateY(-50%); /* Центрируем по вертикали */
}

.gdhc-chat-container .gdhc-message-emoji {
    display: flex;
    align-items: center;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%); /* Центрируем по вертикали */
}

/* Кнопка эмодзи */
.gdhc-chat-container .gdhc-emoji-toggle {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    display: inline-block;
    color: #0088cc;
    line-height: 1;
}

/* Усиливаем стили для кнопки эмодзи, если нужно */
.gdhc-chat-container .gdhc-chat-form .gdhc-form-group .gdhc-message-actions .gdhc-emoji-toggle {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Emoji picker */
.gdhc-chat-container .gdhc-emoji-picker {
    position: absolute;
    z-index: 10;
    width: 300px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    bottom: 50px;
    right: 0;
    background: #fff; /* Добавляем белый фон */
}

/* Убедимся, что содержимое внутри emoji-picker видно */
.gdhc-chat-container .gdhc-emoji-picker * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Кнопка отправки */
.gdhc-chat-container .gdhc-send-button {
    background-color: #28a745;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gdhc-chat-container .gdhc-send-icon {
    color: white;
    font-size: 20px;
}

.gdhc-chat-container .gdhc-loading-messages {
    text-align: center;
    padding: 20px;
    color: #666;
}

.gdhc-chat-container .gdhc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ccc;
    border-top-color: #0088cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.gdhc-chat-container .gdhc-typing-indicator {
    font-style: italic;
    color: #666;
    padding: 5px 10px;
}

/* --- НОВЫЕ СТИЛИ ДЛЯ АНИМАЦИИ ПЕЧАТИ --- */
.gdhc-chat-container .gdhc-typing-dots {
    display: inline-flex;
    align-items: center;
    line-height: 1; 
    margin-left: 5px;
}

.gdhc-chat-container .gdhc-typing-dots span {
    opacity: 0;
    animation: typing-dot-fade 1.5s infinite;
}

/* Задержка для каждой точки, чтобы они мигали последовательно */
.gdhc-chat-container .gdhc-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.gdhc-chat-container .gdhc-typing-dots span:nth-child(2) {
    animation-delay: 0.5s;
}

.gdhc-chat-container .gdhc-typing-dots span:nth-child(3) {
    animation-delay: 1s;
}

/* Ключевые кадры для анимации мигания */
@keyframes typing-dot-fade {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}
/* --- КОНЕЦ НОВЫХ СТИЛЕЙ --- */

.gdhc-chat-container .gdhc-guest-notice {
    padding: 10px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 0.9em;
}

.gdhc-chat-container .gdhc-guest-notice a {
    color: #0088cc;
    text-decoration: underline;
}

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

@media (max-width: 640px) {
    .gdhc-chat-container {
        margin: 0;              /* ← убрал margin:10px на мобильных */
        padding: 0;             /* ← убрал padding:10px на мобильных */
    }
    .gdhc-chat-container #gdhc-chat-messages {
        max-height: 300px;
        padding-left: 0 !important;  /* ← принудительно убираем любой левый отступ на мобилках */
    }
    .gdhc-chat-container .gdhc-user-message,
    .gdhc-chat-container .gdhc-owner-message,
    .gdhc-chat-container .gdhc-admin-message,
    .gdhc-chat-container .gdhc-bot-message {
        max-width: 85%;
    }
    .gdhc-chat-container #gdhc-message-input {
        padding-right: 35px;
    }
}

#gd_contacts_wrapper {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.contacts-blurred #hide_contacts {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.contacts-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
}

.reveal-btn {
    background: #ff5a5f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.reveal-btn:hover {
    transform: scale(1.05);
}

.contacts-revealed #hide_contacts {
    filter: blur(0);
    pointer-events: auto;
}

.gdhc-anonim-badge {
    font-size: 0.82em;
    color: #999;
    font-weight: normal;
    margin-left: 6px;
    opacity: 0.75;
}

/* опционально — чуть красивее */
.gdhc-message-author + .gdhc-anonim-badge {
    color: #e67e22;
    font-style: italic;
}