/**
 * WP GPT Chatbot Styles
 */

#wp-gpt-chatbot-container {
    position: fixed;
    z-index: 99999;
}

.wp-gpt-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wp-gpt-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

.wp-gpt-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.wp-gpt-chatbot-button svg {
    color: white;
    width: 30px;
    height: 30px;
}

.wp-gpt-chatbot-button:hover {
    transform: scale(1.05);
}

.wp-gpt-chatbot-box {
    position: absolute;
    bottom: 80px;
    width: 350px;
    height: 500px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wp-gpt-chatbot-bottom-right .wp-gpt-chatbot-box {
    right: 0;
}

.wp-gpt-chatbot-bottom-left .wp-gpt-chatbot-box {
    left: 0;
}

.wp-gpt-chatbot-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wp-gpt-chatbot-title {
    font-weight: bold;
    font-size: 16px;
}

.wp-gpt-chatbot-close {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.wp-gpt-chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.wp-gpt-chatbot-message {
    margin-bottom: 15px;
    display: flex;
}

.wp-gpt-chatbot-message.user {
    justify-content: flex-end;
}

.wp-gpt-chatbot-message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wp-gpt-chatbot-message.bot .wp-gpt-chatbot-message-content {
    background-color: #f1f0f0;
}

.wp-gpt-chatbot-message.user .wp-gpt-chatbot-message-content {
    background-color: #007bff;
    color: white;
}

/* Link styles in chat messages */
.wp-gpt-chatbot-message-content a {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.wp-gpt-chatbot-message-content a:hover {
    color: #0056b3;
    text-decoration: none;
}

.wp-gpt-chatbot-message-content a:visited {
    color: #6f42c1;
}

/* Related content suggestions styling */
.wp-gpt-chatbot-message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.wp-gpt-chatbot-message-content li {
    margin: 5px 0;
    line-height: 1.4;
}

/* Style for suggested links section */
.wp-gpt-chatbot-message-content strong {
    color: #333;
    font-weight: 600;
}

.wp-gpt-chatbot-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}

.wp-gpt-chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
    resize: none;
    height: 40px;
    font-family: inherit;
}

.wp-gpt-chatbot-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.wp-gpt-chatbot-send svg {
    width: 20px;
    height: 20px;
}

.wp-gpt-chatbot-loading {
    display: flex;
    padding: 10px;
}

.wp-gpt-chatbot-loading span {
    width: 10px;
    height: 10px;
    margin: 0 2px;
    background-color: #ccc;
    border-radius: 50%;
    display: inline-block;
    animation: wp-gpt-chatbot-loading 1.4s infinite ease-in-out both;
}

.wp-gpt-chatbot-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.wp-gpt-chatbot-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes wp-gpt-chatbot-loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

/* Inline Chatbot Styles */
.wp-gpt-chatbot-inline {
    width: 100%;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.wp-gpt-chatbot-inline-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.wp-gpt-chatbot-inline-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

.wp-gpt-chatbot-inline .wp-gpt-chatbot-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    outline: none;
    padding: 10px;
    resize: none;
    height: 40px;
    font-family: inherit;
}

.wp-gpt-chatbot-inline .wp-gpt-chatbot-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.wp-gpt-chatbot-inline .wp-gpt-chatbot-send svg {
    width: 20px;
    height: 20px;
}

/* Shortcode Inline Chatbot Styles */
.wp-gpt-chatbot-inline-form-wrapper {
    --wp-gpt-primary: #007bff;
    --wp-gpt-secondary: #ffffff;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    font-family: inherit;
}

.wp-gpt-chatbot-inline-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #FF9F00;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: relative;
}

.wp-gpt-chatbot-questions-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px 0 0;
    height: 44px;
    width: 36px;
    transition: background 0.18s;
}

.wp-gpt-chatbot-questions-btn:hover {
    background: rgba(255,159,0,0.08);
    border-radius: 50%;
}

.wp-gpt-chatbot-inline-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #222;
    font-size: 1.1em;
    padding: 19px 17px;
}

.wp-gpt-chatbot-inline-input:focus {
    outline: none !important;
}

.wp-gpt-chatbot-inline-input::placeholder {
    color: #243550;
    font-weight: 700;
    opacity: 1;
}

.wp-gpt-chatbot-inline-btn {
    border-radius: 8px;
    background: linear-gradient(90deg, #9E005D 0%, #FF9F00 100%);
    color: #fff;
    border: none;
    padding: 18px 28px;
    font-weight: bold;
    font-size: 1em;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.9s, color 0.2s;
    box-shadow: 0 2px 8px rgba(76,110,245,0.10);
}
.wp-gpt-chatbot-inline-btn:hover {
     background: linear-gradient(90deg, #FF9F00 0%, #FF9F00 100%);
     color: #fff !important;
}

.wp-gpt-chatbot-popup-content {
    padding: 20px 20px 10px 20px;

    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: none;
    border-radius: 0;
    box-shadow: none;
    max-height: 323px;
}

.wp-gpt-chatbot-msg-user {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}
.wp-gpt-chatbot-msg-user span { 
    background:  #FF9F00;
    color: #243550;
    font-weight: 500;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 18px;
    display: inline-block;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(76,110,245,0.08);
    font-size: 1em;
    line-height: 1.5;
}

.wp-gpt-chatbot-msg-assistant {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}
.wp-gpt-chatbot-msg-assistant span {
    background: #fff;
    color: #243550;
    border-radius: 18px 18px 18px 4px;
    padding: 10px 18px;
    display: inline-block;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(36,53,80,0.08);
    font-size: 1em;
    line-height: 1.5;
    border: 1px solid #e9ecef;
}

.wp-gpt-chatbot-thinking {
    color: #243550;
    font-style: italic;
    margin-bottom: 8px;
}

.wp-gpt-chatbot-error {
    color: #b00020;
    font-weight: bold;
    margin-bottom: 8px;
}

.wp-gpt-chatbot-human-msg {
    color: var(--wp-gpt-primary);
    font-style: italic;
    margin-top: 10px;
}

.wp-gpt-chatbot-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 20px;
    border-top: 1px solid #eee;
    background: rgba(255,255,255,0.3);
    border-radius: 0 0 16px 16px;
}

.wp-gpt-chatbot-popup-close,
.wp-gpt-chatbot-popup-human {
    background: #FF9F00;
    color: #243550;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(76,110,245,0.10);
    font-weight: 700;
}
.wp-gpt-chatbot-popup-close:hover,
.wp-gpt-chatbot-popup-human:hover {
    background: #ffb733;
    color: #243550;
    filter: brightness(1.08);
}

.wp-gpt-chatbot-popup-close {
    background: none;
    color: #243550;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: none;
    padding: 0;
}
.wp-gpt-chatbot-popup-close:hover {
    background: #f5f5f5;
    color: #FF9F00;
    filter: none;
}

/* Pills Styles */
.wp-gpt-chatbot-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px 0 2px;
    justify-content: flex-start;
    align-items: center;
    animation: fadeInPills 0.3s;
}
@keyframes fadeInPills {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.wp-gpt-chatbot-pill {
    background: linear-gradient(90deg, #f4f6fa 0%, #fff 100%);
    color: #243550;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 7px 18px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px rgba(36,53,80,0.06);
    outline: none;
}
.wp-gpt-chatbot-pill:hover, .wp-gpt-chatbot-pill:focus {
    background: linear-gradient(90deg, #FF9F00 0%, #ffd580 100%);
    color: #243550;
    border-color: #FF9F00;
    box-shadow: 0 2px 8px rgba(255,159,0,0.10);
}

/* Absolute Pills List Styles */
.wp-gpt-chatbot-pills-list-absolute {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.98);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    padding: 18px 18px 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 20;
    min-width: 220px;
    max-width: 98vw;
    animation: fadeInPills 0.3s;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    max-height: 160px;
}
.wp-gpt-chatbot-pills-list-absolute .wp-gpt-chatbot-pills-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 0;
    padding: 0;
    justify-content: flex-start;
    align-items: flex-start;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100%;
}
.wp-gpt-chatbot-pills-list-absolute .wp-gpt-chatbot-pill {
    margin-bottom: 7px;
    margin-right: 7px;
    background: linear-gradient(90deg, #f4f6fa 0%, #fff 100%);
    color: #243550;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 7px 18px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px rgba(36,53,80,0.06);
    outline: none;
    display: inline-block;
    max-width: 100%;
    white-space: pre-line;
    word-break: break-word;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    .wp-gpt-chatbot-pills-list-absolute {
        left: 0;
        right: 0;
        min-width: 0;
        padding: 12px 6px 8px 6px;
        max-height: 120px;
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .wp-gpt-chatbot-box {
        width: 300px;
        height: 450px;
    }
    
    .wp-gpt-chatbot-inline {
        height: 350px !important;
    }
}

@media (max-width: 600px) {
    .wp-gpt-chatbot-inline-form-wrapper {
        max-width: 98vw;
    }
    .wp-gpt-chatbot-inline-popup {
        max-height: 60vw;
    }
}

.wp-gpt-chatbot-pills-popup {
    position: absolute;
    left: 0;
    top: 110%;
    min-width: 280px;
    /* max-width: 380px; */
    font-size: 0.97em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(.4,1.6,.4,1);
    z-index: 30;
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    padding: 0;
    display: block !important;
    border: 1.5px solid var(--wp-gpt-primary, #FF9F00);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
}
.wp-gpt-chatbot-pills-popup-inner {
    padding: 18px 18px 12px 18px;
}
.wp-gpt-chatbot-pills-heading {
    font-weight: 800;
    color: var(--wp-gpt-primary, #FF9F00);
    margin-bottom: 12px;
    font-size: 1.13em;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 #fff, 0 2px 8px rgba(255,159,0,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}
.wp-gpt-chatbot-pills-heading::before {
    content: '\1F4AC'; /* 💬 */
    font-size: 1.2em;
    margin-right: 2px;
    opacity: 0.85;
}
.wp-gpt-chatbot-pills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* max-height: 180px; */
    overflow-y: auto;
    padding-bottom: 2px;
    align-items: flex-start;
}
.wp-gpt-chatbot-pills-popup .wp-gpt-chatbot-pill {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #f4f6fa 0%, #fff 100%);
    color: #243550;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 6px 14px 6px 14px;
    font-size: 0.97em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px rgba(36,53,80,0.06);
    outline: none;
    margin-bottom: 7px;
    margin-right: 7px;
    max-width: 100%;
    white-space: pre-line;
    word-break: break-word;
    box-sizing: border-box;
}
.wp-gpt-chatbot-pills-popup .wp-gpt-chatbot-pill span {
    flex: 1;
    margin-right: 6px;
}
.wp-gpt-chatbot-pill-send {
    margin-left: 2px;
    opacity: 0.8;
    transition: opacity 0.18s;
}
.wp-gpt-chatbot-pills-popup .wp-gpt-chatbot-pill:hover,
.wp-gpt-chatbot-pills-popup .wp-gpt-chatbot-pill:focus {
    background: linear-gradient(90deg, #FF9F00 0%, #ffd580 100%);
    color: #243550;
    border-color: #FF9F00;
    box-shadow: 0 2px 8px rgba(255,159,0,0.10);
}
.wp-gpt-chatbot-pills-popup .wp-gpt-chatbot-pill:hover .wp-gpt-chatbot-pill-send {
    opacity: 1;
}
@media (max-width: 600px) {
    .wp-gpt-chatbot-pills-popup {
        min-width: 0;
        max-width: 98vw;
    }
}

/*
 * FIX: Ensure .wp-gpt-chatbot-pills-popup is fully visible when open
 */
.wp-gpt-chatbot-pills-popup.opening {
    opacity: 1 !important;
    pointer-events: auto;
    transition: opacity 0.18s cubic-bezier(.4,1.6,.4,1);
}

/*
 * Restore glass effect for .wp-gpt-chatbot-inline-popup (open state)
 */
.wp-gpt-chatbot-inline-popup,
.wp-gpt-chatbot-inline-popup.open {
    top: 73px;
    width: 100%;
    position: absolute;
    background: rgba(255,255,255,0.7);
    border-radius: 16px;
    max-height: 390px;

    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.wp-gpt-chatbot-inline-popup.open {
        border: 1px solid rgba(0, 0, 0, 0.18);
}