.sw-chatbot {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
}

.swal2-container {
    z-index: 2200 !important;
}

.sw-chatbot section {
    padding: 0;
}

.sw-chatbot-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 280px;
    border: none;
    border-radius: 16px;
    background: #e74c3c;
    color: #fff;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.sw-chatbot-panel {
    display: none;
    width: min(92vw, 360px);
    height: min(75vh, 520px);
    max-height: calc(100vh - 90px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e5e5;
    overflow: hidden;
}

.sw-chatbot-panel.is-open {
    display: flex;
    flex-direction: column;
}

.sw-chatbot-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.sw-chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    background: #f7f8fa;
}

.sw-chatbot-header h3 {
    margin: 0;
    font-size: 1rem;
}

.sw-chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sw-chatbot-header button {
    border: none;
    background: transparent;
    font-size: 1.3rem;
    line-height: 1;
}

.sw-chatbot-header-actions button {
    width: 28px;
    height: 28px;
    padding: 0;
}

.sw-chatbot-header-actions button:hover {
    color: #e74c3c;
}

.sw-chatbot-consent,
.sw-chatbot-messages {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    background: #fcfcfc;
}

.sw-chatbot-message {
    margin-bottom: 10px;
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.93rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.sw-chatbot-message.user {
    margin-left: auto;
    background: #eaf2ff;
}

.sw-chatbot-message.assistant {
    margin-right: auto;
    background: #f0f0f0;
}

.sw-chatbot-sources {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #666;
}

.sw-chatbot-create-demo {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.sw-chatbot-consent {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
    justify-content: center;
}

.sw-chatbot-consent-text {
    margin: 0;
    color: #444;
    line-height: 1.45;
}

.sw-chatbot-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    color: #333;
}

.sw-chatbot-consent-check input {
    margin-top: 9px;
}

.sw-chatbot-consent-btn {
    align-self: flex-start;
    border: none;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
}

.sw-chatbot-consent-btn:disabled {
    opacity: 0.65;
}

.sw-chatbot-form {
    display: flex;
    gap: 8px;
    border-top: 1px solid #eee;
    padding: 10px;
    background: #fff;
}

.sw-chatbot-form input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.sw-chatbot-form button {
    border: none;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    padding: 8px 12px;
    font-weight: 700;
}

.sw-chatbot-form button:disabled {
    opacity: 0.65;
}

.sw-chatbot-spinner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
    font-size: 0.84rem;
    color: #555;
}

.sw-chatbot-spinner.is-visible {
    display: flex;
}

.sw-chatbot-spinner-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid #d0d0d0;
    border-top-color: #e74c3c;
    animation: sw-chatbot-spin 0.9s linear infinite;
}

.sw-chatbot-panel.is-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    z-index: 1200;
}

.sw-chatbot-panel.is-fullscreen .sw-chatbot-content {
    flex: 1;
    min-height: 0;
}

@keyframes sw-chatbot-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mode selection screen */
.sw-chatbot-mode-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sw-chatbot-mode-prompt {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #222;
}

.sw-chatbot-mode-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.3;
}

.sw-chatbot-mode-btn:hover {
    border-color: #e74c3c;
    background: #fff7f7;
}

.sw-chatbot-mode-btn strong {
    font-size: 0.95rem;
    color: #111;
}

.sw-chatbot-mode-btn span {
    font-size: 0.82rem;
    color: #666;
}
