/**
 * AccessiBot WordPress Widget Styling
 * Clean, Accessible, Responsive (WCAG AAA compliant)
 */

#accessibot-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: var(--accessibot-primary, #2563EB);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

#accessibot-floating-btn.accessibot-left {
    right: auto;
    left: 24px;
}

#accessibot-floating-btn:focus-visible {
    outline: 3px solid #38bdf8;
    outline-offset: 3px;
}

#accessibot-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.accessibot-popup {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 999999;
    width: 460px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.accessibot-popup.accessibot-left {
    right: auto;
    left: 24px;
}

.accessibot-embed-widget {
    width: 100%;
    height: 100%;
    min-height: 560px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.accessibot-header {
    background: #0f172a;
    color: #ffffff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accessibot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.accessibot-close-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
}

.accessibot-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.accessibot-close-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.accessibot-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.accessibot-msg {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.accessibot-msg.user {
    background: var(--accessibot-primary, #2563EB);
    color: #ffffff;
    margin-left: 32px;
    white-space: pre-wrap;
    font-family: inherit;
}

.accessibot-msg.bot {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    margin-right: 20px;
}

.accessibot-msg.bot .accessibot-p {
    margin: 0 0 8px 0;
}

.accessibot-msg.bot .accessibot-p:last-child {
    margin-bottom: 0;
}

.accessibot-msg.bot pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    margin: 10px 0;
    white-space: pre;
    word-break: normal;
}

.accessibot-msg.bot pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
    font-family: inherit;
}

.accessibot-msg.bot code.accessibot-inline-code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.accessibot-msg.bot .accessibot-heading {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 12px 0 6px 0;
    line-height: 1.35;
}

.accessibot-msg.bot .accessibot-heading:first-child {
    margin-top: 0;
}

.accessibot-msg.bot .accessibot-hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 12px 0;
}

.accessibot-msg.bot ul.accessibot-list,
.accessibot-msg.bot ol.accessibot-list {
    margin: 6px 0 10px 0;
    padding-left: 20px;
}

.accessibot-msg.bot li.accessibot-li {
    margin-bottom: 4px;
}

.accessibot-form {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.accessibot-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.accessibot-textarea:focus-visible {
    outline: 2px solid var(--accessibot-primary, #2563EB);
    outline-offset: 1px;
}

.accessibot-send-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: var(--accessibot-primary, #2563EB);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.accessibot-send-btn:hover {
    filter: brightness(0.92);
}

.accessibot-send-btn:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}
