/* Чат клиента с владельцем анкеты — модалка на странице анкеты */

.premium-owner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #F6055B 0%, #8B5CF6 100%);
    box-shadow: 0 6px 18px rgba(246, 5, 91, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.premium-owner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(246, 5, 91, 0.36);
}

.premium-owner-btn:active {
    transform: translateY(0);
}

/* Overlay */
.owner-chat-modal-bg {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(17, 12, 34, 0.45);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
}

.owner-chat-modal-bg.open {
    opacity: 1;
    visibility: visible;
}

/* Window */
.owner-chat-window {
    width: 400px;
    max-width: 100%;
    height: 600px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(17, 12, 34, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.owner-chat-modal-bg.open .owner-chat-window {
    transform: translateY(0) scale(1);
}

/* Header */
.owner-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #F6055B 0%, #8B5CF6 100%);
    color: #fff;
    flex-shrink: 0;
}

.owner-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.owner-chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.owner-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owner-chat-header-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.owner-chat-header-status {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 2px;
}

.owner-chat-close {
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.owner-chat-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Body */
.owner-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    background: #f7f7fb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.owner-chat-body::-webkit-scrollbar {
    width: 6px;
}

.owner-chat-body::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.25);
    border-radius: 6px;
}

/* Empty state */
.owner-chat-empty {
    margin: auto;
    text-align: center;
    color: #8a86a0;
    padding: 20px;
}

.owner-chat-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(246, 5, 91, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #8B5CF6;
}

.owner-chat-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #3a3552;
    margin-bottom: 6px;
}

.owner-chat-empty-text {
    font-size: 14px;
    line-height: 1.5;
    max-width: 260px;
    margin: 0 auto;
}

/* Messages */
.owner-msg {
    display: flex;
    max-width: 82%;
}

.owner-msg--sent {
    align-self: flex-end;
    justify-content: flex-end;
}

.owner-msg--received {
    align-self: flex-start;
}

.owner-msg-bubble {
    position: relative;
    padding: 9px 13px 7px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.4;
    word-break: break-word;
}

.owner-msg--sent .owner-msg-bubble {
    background: linear-gradient(135deg, #F6055B 0%, #8B5CF6 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.owner-msg--received .owner-msg-bubble {
    background: #fff;
    color: #241f36;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(17, 12, 34, 0.06);
}

.owner-msg-time {
    display: inline-block;
    font-size: 14px;
    opacity: 0.7;
    margin-left: 8px;
    vertical-align: baseline;
    white-space: nowrap;
}

.owner-msg--received .owner-msg-time {
    color: #9a95ad;
}

.owner-msg-image img {
    max-width: 200px;
    border-radius: 12px;
    display: block;
}

.owner-msg-file {
    color: inherit;
    text-decoration: underline;
}

.owner-chat-load-more {
    align-self: center;
    margin-bottom: 6px;
    padding: 7px 16px;
    border: 1px solid #e0dcf0;
    background: #fff;
    color: #8B5CF6;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.owner-chat-load-more:hover { background: #f4f2fb; }

/* Input area */
.owner-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #ececf3;
    flex-shrink: 0;
}

.owner-chat-attach {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9a95ad;
    transition: background 0.15s ease, color 0.15s ease;
}

.owner-chat-attach:hover {
    background: #f2f0f9;
    color: #8B5CF6;
}

.owner-chat-attach svg {
    width: 20px;
    height: 20px;
}

.owner-chat-input {
    flex: 1;
    border: 1px solid #e6e4ef;
    background: #f7f7fb;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14.5px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.owner-chat-input:focus {
    border-color: #8B5CF6;
    background: #fff;
}

.owner-chat-send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #F6055B 0%, #8B5CF6 100%);
    box-shadow: 0 4px 12px rgba(246, 5, 91, 0.3);
    transition: transform 0.15s ease;
}

.owner-chat-send:hover {
    transform: scale(1.06);
}

.owner-chat-send svg {
    width: 19px;
    height: 19px;
}

/* Галочки прочтения */
.owner-tick {
    font-size: 14px;
    opacity: 0.7;
    letter-spacing: -2px;
}

.owner-tick--read {
    color: #4ade80;
    opacity: 1;
}

/* Онлайн-точка в шапке */
.owner-chat-online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 5px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

/* Уведомление о блокировке */
.owner-chat-blocked {
    padding: 10px 16px;
    background: #fff4f4;
    color: #d64545;
    font-size: 14px;
    text-align: center;
    border-top: 1px solid #f6d5d5;
}

/* Ошибка отправки */
.owner-chat-error {
    padding: 9px 16px;
    background: #fff8e6;
    color: #b7791f;
    font-size: 14px;
    text-align: center;
    border-top: 1px solid #f3e0b3;
}

/* Mobile */
@media (max-width: 600px) {
    .owner-chat-modal-bg {
        padding: 0;
    }

    .owner-chat-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
