/**
 * Стили для плавающего чат-бота AI
 */

.ds-chatbot-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
}

.ds-chatbot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ds-chatbot-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(37, 99, 235, 0.45);
}

.ds-chatbot-toggle__icon {
    font-size: 18px;
    line-height: 1;
}

.ds-chatbot-toggle__label {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.ds-chatbot-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ds-chatbot-panel {
    box-sizing: border-box;
    position: absolute;
    width: 520px;
    height: 520px;
    min-width: 320px;
    max-width: calc(100vw - 24px);
    min-height: 360px;
    max-height: calc(100vh - 120px);
    background: #0b172e;
    color: #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    right: 0;
    bottom: 72px;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(6px);
    resize: both;
    overflow: hidden;
}

.ds-chatbot-open .ds-chatbot-panel {
    display: flex;
}

.ds-chatbot-header {
    padding: 16px 18px;
    background: rgb(76, 88, 227);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ds-chatbot-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.ds-chatbot-close {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s ease, transform 0.15s ease;
    align-items: center;
    padding: 0;
}

.ds-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.02);
}

.ds-chatbot-messages {
    flex: 1;
    padding: 14px 14px 0;
    overflow-y: auto;
    background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.08), transparent 26%), radial-gradient(circle at 80% 10%, rgba(37, 99, 235, 0.08), transparent 24%), #0b172e;
    min-height: 0;
}

.ds-chatbot-message {
    margin-bottom: 12px;
    display: flex;
}

.ds-chatbot-message-user {
    justify-content: flex-end;
}

.ds-chatbot-message-assistant {
    justify-content: flex-start;
}

.ds-chatbot-bubble {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    white-space: pre-wrap;
}

.ds-chatbot-message-user .ds-chatbot-bubble {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ds-chatbot-message-assistant .ds-chatbot-bubble {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ds-chatbot-bubble a {
    color: #38bdf8;
    text-decoration: underline;
}

.ds-chatbot-bubble strong {
    font-weight: 700;
}

.ds-chatbot-bubble em {
    font-style: italic;
}

.ds-chatbot-bubble code {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-family: ui-monospace, SFMono-Regular, SFMono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
}

.ds-chatbot-input {
    padding: 12px;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 8px;
    align-items: center;
}

.ds-chatbot-input textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    padding: 10px 12px;
    resize: vertical;
    min-height: 56px;
    max-height: 50vh;
    font-size: 14px;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

.ds-chatbot-input textarea:focus {
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}


.ds-chatbot-send {
    padding: 10px 16px;
    border: 1px solid rgba(37, 99, 235, 0.8) !important;
    border-radius: 12px;
    background: #2563eb;
    color: rgba(37, 99, 235, 0.8) !important;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    align-self: center;
    justify-self: center;
}

.ds-chatbot-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    background-color: rgba(37, 99, 235, 0.8) !important;
    color: #fff !important;
}
.ds-chatbot-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.ds-chatbot-send:disabled:hover {
    transform: none;
    box-shadow: none;
}

#button-3 {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ds-chatbot-send__label {
    position: relative;
    z-index: 2;
    transition: color .45s ease-out;
}

#circle,
.ds-chatbot-send__circle {
    width: 0%;
    height: 0%;
    opacity: 0;
    line-height: 40px;
    border-radius: 50%;
    background: #BFC0C0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all .5s ease-out;
    z-index: 1;
    pointer-events: none;
}

#button-3:not(:disabled):hover #circle,
#button-3:not(:disabled):hover .ds-chatbot-send__circle {
    width: 200%;
    height: 500%;
    opacity: 1;
    top: 50%;
    left: 50%;
}

#button-3:not(:disabled):hover a,
#button-3:not(:disabled):hover .ds-chatbot-send__label {
    color: #2D3142;
}

.ds-chatbot-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ds-spin 1s linear infinite;
}

.ds-chatbot-resizer {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 20px;
    height: 20px;
    cursor: nesw-resize;
    background: linear-gradient(135deg, transparent 0%, transparent 45%, rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0.35) 100%);
    border-radius: 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.15s ease;
    z-index: 2;
    touch-action: none;
    transform: rotate(180deg);
}

.ds-chatbot-resizer:hover {
    opacity: 1;
    transform: rotate(180deg) scale(1.05);
}

.ds-chatbot-resizing,
.ds-chatbot-resizing * {
    user-select: none !important;
}

.ds-chatbot-resizer.ds-chatbot-resizing {
    opacity: 1;
    transform: rotate(180deg) scale(1.05);
}

@media (max-width: 640px) {
    .ds-chatbot-panel {
        left: 12px;
        right: 12px;
        bottom: 82px;
        width: auto;
        max-width: none;
        height: 70vh;
        min-height: 320px;
        border-radius: 14px;
    }

    .ds-chatbot-input {
        grid-template-columns: 1fr;
    }
}
