
/* ЧАТ ВИДЖЕТ */
.chat-widget {
    width: 100%;
    max-width: 1300px;
    height: 600px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98), rgba(20, 20, 30, 0.98));
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.chat-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="gridDots" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1" fill="rgba(0,255,136,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23gridDots)"/></svg>');
    pointer-events: none;
    border-radius: 24px;
}

/* Заголовок */
.chat-header {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.12), rgba(0, 204, 255, 0.08));
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    position: relative;
    z-index: 2;
}

.chat-header span:first-child {
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-close {
    font-size: 28px;
    font-weight: 300;
    opacity: 0.5;
    transition: all 0.2s;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
}

.chat-close:hover {
    opacity: 1;
    color: #00ff88;
    transform: rotate(90deg);
}

/* Тело чата */
#chat {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #0a0a0a;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.msg {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 70%;
    word-wrap: break-word;
    animation: slideMsg 0.3s ease;
}

@keyframes slideMsg {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg.user {
    background: linear-gradient(135deg, #00ff88, #00ccff);
    color: #0a0a0a;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

.msg.bot {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-bottom-left-radius: 4px;
    color: rgba(255, 255, 255, 0.95);
    align-self: flex-start;
}

.msg p {
    margin: 0;
    word-break: break-word;
}

/* Прокрутка */
#chat::-webkit-scrollbar {
    width: 8px;
}

#chat::-webkit-scrollbar-track {
    background: transparent;
}

#chat::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.25);
    border-radius: 4px;
}

#chat::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.45);
}

/* Поле ввода */
.input-area {
    display: flex;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(0, 255, 136, 0.15);
    gap: 12px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-area input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.input-area input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.12);
}

.input-area button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    color: #0a0a0a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.25);
}

.input-area button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.input-area button:hover::before {
    left: 100%;
}

.input-area button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.input-area button:active {
    transform: translateY(-1px);
}


/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 2rem 1rem;
    }

    .chat-widget {
        height: 500px;
        max-width: 100%;
        width: calc(100vw - 2rem);  /* ← Добавь это */
    }

    .msg {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;  /* ← Уменьши padding */
    }

    .chat-widget {
        width: calc(100vw - 2rem);  /* ← Добавь это */
        height: 100vh;
        border-radius: 0;
        max-width: none;
        margin: 0 auto;  /* ← Центрируй */
    }

    .msg {
        max-width: 90%;
    }

    .chat-header {
        padding: 16px 20px;  /* ← Уменьши padding */
    }

    #chat {
        padding: 16px;  /* ← Уменьши padding */
    }

    .input-area {
        padding: 16px;  /* ← Уменьши padding */
    }
}