/**
 * OCPRO.PL - style widgetu agenta AI
 */

.ocpro-ai-widget,
.ocpro-ai-widget * {
    box-sizing: border-box;
}

.ocpro-ai-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ocpro-ai-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #123f2a;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(18, 63, 42, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ocpro-ai-toggle:hover {
    transform: translateY(-1px);
    background: #0f3524;
    box-shadow: 0 18px 42px rgba(18, 63, 42, 0.35);
}

.ocpro-ai-toggle-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.18);
}

.ocpro-ai-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 110px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.ocpro-ai-widget.is-open .ocpro-ai-panel {
    display: flex;
}

.ocpro-ai-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, #123f2a 0%, #1b5a3d 100%);
    color: #ffffff;
}

.ocpro-ai-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
}

.ocpro-ai-subtitle {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    line-height: 1.35;
}

.ocpro-ai-close {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 24px;
    line-height: 28px;
    cursor: pointer;
}

.ocpro-ai-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.ocpro-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    background: #f8fafc;
}

.ocpro-ai-message {
    display: flex;
    margin-bottom: 12px;
}

.ocpro-ai-message-user {
    justify-content: flex-end;
}

.ocpro-ai-message-assistant {
    justify-content: flex-start;
}

.ocpro-ai-bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ocpro-ai-message-assistant .ocpro-ai-bubble {
    border-top-left-radius: 5px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.ocpro-ai-message-user .ocpro-ai-bubble {
    border-top-right-radius: 5px;
    background: #123f2a;
    color: #ffffff;
}

.ocpro-ai-message-error .ocpro-ai-bubble {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.ocpro-ai-typing .ocpro-ai-bubble {
    color: #64748b;
}

.ocpro-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px 12px;
    overflow: visible;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.ocpro-ai-suggestions button {
    flex: 0 0 auto;
    border: 1px solid rgba(18, 63, 42, 0.20);
    border-radius: 999px;
    background: #ffffff;
    color: #123f2a;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.ocpro-ai-suggestions button:hover {
    background: #f0fdf4;
}

.ocpro-ai-suggestions button[data-ai-action="fill-start-form"],
.ocpro-ai-fill-form-main {
    border: 0;
    background: #123f2a;
    color: #ffffff;
}

.ocpro-ai-suggestions button[data-ai-action="fill-start-form"]:hover,
.ocpro-ai-fill-form-main:hover {
    background: #0f3524;
}

.ocpro-ai-transfer-box {
    margin: 0;
    padding: 12px 14px;
    background: #f0fdf4;
    border-top: 1px solid rgba(18, 63, 42, 0.12);
    color: #164e33;
    font-size: 12px;
    line-height: 1.45;
}

.ocpro-ai-fill-form-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 9px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.ocpro-ai-form {
    display: flex;
    gap: 9px;
    align-items: flex-end;
    padding: 13px 14px;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.ocpro-ai-input {
    flex: 1;
    min-height: 42px;
    max-height: 110px;
    resize: none;
    padding: 10px 11px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 13px;
    color: #111827;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.ocpro-ai-input:focus {
    border-color: rgba(18, 63, 42, 0.55);
    box-shadow: 0 0 0 3px rgba(18, 63, 42, 0.10);
}

.ocpro-ai-send {
    min-height: 42px;
    padding: 0 15px;
    border: 0;
    border-radius: 13px;
    background: #123f2a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.ocpro-ai-send:hover {
    background: #0f3524;
}

.ocpro-ai-send:disabled,
.ocpro-ai-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ocpro-ai-note {
    padding: 0 14px 13px;
    background: #ffffff;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .ocpro-ai-widget {
        right: 14px;
        bottom: 14px;
    }

    .ocpro-ai-panel {
        right: -2px;
        bottom: 62px;
        width: calc(100vw - 24px);
        height: min(620px, calc(100vh - 96px));
        border-radius: 18px;
    }

    .ocpro-ai-toggle {
        min-height: 46px;
        padding: 0 15px;
    }

    .ocpro-ai-toggle-text {
        font-size: 14px;
    }
}