/* ========================================
   Chatbot Widget Styles
   Link Holdings Group
   ======================================== */

/* CSS Variables */
:root {
    --chatbot-primary: #c9a84c;
    --chatbot-primary-dark: #a68a3e;
    --chatbot-primary-light: #e2c97e;
    --chatbot-bg-dark: #111111;
    --chatbot-bg-light: #ffffff;
    --chatbot-text-dark: #f0f0f0;
    --chatbot-text-light: #333333;
    --chatbot-border: rgba(255, 255, 255, 0.1);
    --chatbot-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --chatbot-message-user: rgba(201, 168, 76, 0.15);
    --chatbot-message-bot: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   CHATBOT CONTAINER
============================================================ */
.chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ============================================================
   FLOATING TOGGLE BUTTON
============================================================ */
.chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary-light), var(--chatbot-primary));
    color: #000;
    border: none;
    cursor: none;
    box-shadow: 0 8px 24px rgba(201, 168, 76, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(201, 168, 76, 0.4);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover::before {
    transform: translateX(0);
}

.chatbot-icon-chat,
.chatbot-icon-close {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
    position: absolute;
}

.chatbot-window.open ~ .chatbot-toggle .chatbot-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.8);
}

.chatbot-window.open ~ .chatbot-toggle .chatbot-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ============================================================
   CHAT WINDOW
============================================================ */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: var(--chatbot-bg-dark);
    border: 1px solid var(--chatbot-border);
    border-radius: 12px;
    box-shadow: var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ============================================================
   CHAT HEADER
============================================================ */
.chatbot-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--chatbot-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.03));
}

.chatbot-header-content {
    flex: 1;
}

.chatbot-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--chatbot-text-dark);
    margin: 0;
    letter-spacing: 0.3px;
}

.chatbot-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin: 4px 0 0 0;
}

.chatbot-minimize {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.chatbot-minimize svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   MESSAGES CONTAINER
============================================================ */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.5);
}

/* ============================================================
   MESSAGE BUBBLES
============================================================ */
.chatbot-message {
    display: flex;
    animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.bot-message {
    justify-content: flex-start;
}

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

.chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message .chatbot-message-content {
    background: var(--chatbot-message-bot);
    border: 1px solid rgba(201, 168, 76, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.user-message .chatbot-message-content {
    background: var(--chatbot-message-user);
    border: 1px solid rgba(201, 168, 76, 0.2);
    color: var(--chatbot-primary);
}

.chatbot-message-content p {
    margin: 0;
}

/* ============================================================
   SUGGESTIONS
============================================================ */
.chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    animation: suggestionsSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes suggestionsSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-suggestion-btn {
    padding: 10px 14px;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: var(--chatbot-primary-light);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: none;
    transition: all 0.2s ease;
    text-align: left;
}

.chatbot-suggestion-btn:hover {
    background: rgba(201, 168, 76, 0.2);
    border-color: rgba(201, 168, 76, 0.5);
    transform: translateX(4px);
}

.chatbot-suggestion-btn:active {
    transform: translateX(2px);
}

/* ============================================================
   INPUT CONTAINER
============================================================ */
.chatbot-input-container {
    padding: 16px;
    border-top: 1px solid var(--chatbot-border);
    background: rgba(0, 0, 0, 0.3);
}

.chatbot-input-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--chatbot-text-dark);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.chatbot-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 168, 76, 0.4);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.chatbot-send-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--chatbot-primary-light), var(--chatbot-primary));
    border: none;
    color: #000;
    border-radius: 8px;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-send-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}

.chatbot-send-btn:hover::before {
    transform: translateX(0);
}

.chatbot-send-btn svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   TYPING INDICATOR
============================================================ */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--chatbot-message-bot);
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: 12px;
    width: fit-content;
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: typing 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* ============================================================
   LIGHT MODE SUPPORT
============================================================ */
[data-theme="light"] .chatbot-window {
    background: var(--chatbot-bg-light);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .chatbot-title,
[data-theme="light"] .chatbot-header-content {
    color: var(--chatbot-text-light);
}

[data-theme="light"] .chatbot-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .chatbot-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.05), rgba(201, 168, 76, 0.02));
}

[data-theme="light"] .chatbot-minimize {
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .chatbot-minimize:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .chatbot-input-container {
    border-top-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .chatbot-input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--chatbot-text-light);
}

[data-theme="light"] .chatbot-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .chatbot-input:focus {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--chatbot-primary-dark);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

[data-theme="light"] .bot-message .chatbot-message-content {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--chatbot-text-light);
}

[data-theme="light"] .user-message .chatbot-message-content {
    background: rgba(201, 168, 76, 0.12);
    border-color: rgba(201, 168, 76, 0.25);
    color: var(--chatbot-primary-dark);
}

[data-theme="light"] .chatbot-suggestion-btn {
    background: rgba(201, 168, 76, 0.08);
    border-color: rgba(201, 168, 76, 0.25);
    color: var(--chatbot-primary-dark);
}

[data-theme="light"] .chatbot-suggestion-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--chatbot-primary-dark);
}

[data-theme="light"] .chatbot-typing {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chatbot-typing-dot {
    background: rgba(0, 0, 0, 0.4);
}

/* ============================================================
   RESPONSIVE DESIGN
============================================================ */
@media (max-width: 640px) {
    .chatbot-widget {
        bottom: 16px;
        right: 16px;
    }

    .chatbot-window {
        width: calc(100vw - 32px);
        height: 480px;
        bottom: 72px;
        right: 0;
        left: 0;
        margin: 0 auto;
    }

    .chatbot-toggle {
        width: 48px;
        height: 48px;
    }

    .chatbot-icon-chat,
    .chatbot-icon-close {
        width: 20px;
        height: 20px;
    }

    .chatbot-message-content {
        max-width: 85%;
        font-size: 13px;
        padding: 10px 14px;
    }

    .chatbot-input {
        font-size: 14px;
    }

    .chatbot-title {
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .chatbot-messages {
        padding: 12px;
    }
}
