/* PTS Chatbot widget styles */

.pts-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.pts-chatbot-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #1b1a3a;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(27, 26, 58, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}
.pts-chatbot-toggle:hover { transform: translateY(-2px); background: #24224a; }
.pts-chatbot-toggle:focus-visible { outline: 2px solid #6fa8dc; outline-offset: 3px; }

.pts-chatbot-icon-close { display: none; }
.pts-chatbot-toggle[aria-expanded="true"] .pts-chatbot-icon-open { display: none; }
.pts-chatbot-toggle[aria-expanded="true"] .pts-chatbot-icon-close { display: block; }

.pts-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(20, 20, 50, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pts-chatbot-header {
    background: #1b1a3a;
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.pts-chatbot-title { margin: 0; font-size: 15px; font-weight: 700; }
.pts-chatbot-subtitle { margin: 2px 0 0; font-size: 12px; color: #b9c0e0; }
.pts-chatbot-close {
    background: transparent;
    border: none;
    color: #b9c0e0;
    cursor: pointer;
    padding: 4px;
    display: flex;
}
.pts-chatbot-close:hover { color: #ffffff; }

.pts-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f4f6fb;
}

.pts-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.pts-msg-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #1b1a3a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(20, 20, 50, 0.08);
}
.pts-msg-user {
    align-self: flex-end;
    background: #6fa8dc;
    color: #0d2540;
    border-bottom-right-radius: 4px;
}
.pts-msg-typing { align-self: flex-start; }
.pts-typing-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.pts-typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #9aa2c9;
    animation: pts-typing 1.1s infinite ease-in-out;
}
.pts-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.pts-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pts-typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-2px); }
}

.pts-chatbot-input-area {
    border-top: 1px solid #e6e8f2;
    padding: 12px;
    flex-shrink: 0;
    background: #ffffff;
}

.pts-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pts-option-btn {
    border: 1.5px solid #1b1a3a;
    background: #ffffff;
    color: #1b1a3a;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pts-option-btn:hover { background: #1b1a3a; color: #ffffff; }
.pts-option-btn:focus-visible { outline: 2px solid #6fa8dc; outline-offset: 2px; }

.pts-text-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.pts-text-form textarea,
.pts-text-form input[type="text"] {
    flex: 1;
    resize: none;
    border: 1.5px solid #d8dcec;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13.5px;
    font-family: inherit;
    min-height: 38px;
    max-height: 90px;
}
.pts-text-form textarea:focus,
.pts-text-form input[type="text"]:focus { outline: none; border-color: #6fa8dc; }

.pts-send-btn {
    background: #1b1a3a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pts-send-btn:hover { background: #24224a; }
.pts-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pts-contact-form { display: flex; flex-direction: column; gap: 8px; }
.pts-contact-form input {
    border: 1.5px solid #d8dcec;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13.5px;
    font-family: inherit;
}
.pts-contact-form input:focus { outline: none; border-color: #6fa8dc; }
.pts-contact-form .pts-field-error {
    font-size: 12px;
    color: #c0392b;
    display: none;
}
.pts-contact-form .pts-submit-btn {
    background: #1b1a3a;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 2px;
}
.pts-contact-form .pts-submit-btn:hover { background: #24224a; }

.pts-link-btn {
    display: inline-block;
    background: #6fa8dc;
    color: #0d2540;
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    margin-top: 4px;
}
.pts-link-btn:hover { background: #5a97cf; }

.pts-chatbot-done {
    text-align: center;
    font-size: 12px;
    color: #8a8fae;
    padding: 6px 0;
}

@media (max-width: 480px) {
    .pts-chatbot { right: 12px; bottom: 12px; }
    .pts-chatbot-panel { width: calc(100vw - 24px); right: -6px; }
}
