/* ============================================
   Xamu Systems - Sophia Chatbot Modal Styles
   Dark Theme + Gold Accents
   ============================================ */

/* Header Chat Button */
.xamu-chat-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #B38728, #DBAC34);
    color: #0a0a0a;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.xamu-chat-header-btn:hover {
    background: linear-gradient(135deg, #DBAC34, #FBF5B7);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(179, 135, 40, 0.4);
}

.xamu-chat-header-btn svg {
    flex-shrink: 0;
}

.xamu-chat-header-btn .btn-text {
    display: inline;
}

/* Body scroll lock when chat is open */
body.xamu-chat-open {
    overflow: hidden;
}

/* ============================================
   Modal Overlay
   ============================================ */
.xamu-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.xamu-chat-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Modal Container
   ============================================ */
.xamu-chat-modal {
    width: 420px;
    height: 560px;
    background: #1a1a1f;
    border-radius: 16px;
    border: 1px solid rgba(179, 135, 40, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(179, 135, 40, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.xamu-chat-overlay.active .xamu-chat-modal {
    transform: scale(1) translateY(0);
}

/* ============================================
   Chat Header
   ============================================ */
.xamu-chat-header {
    background: linear-gradient(135deg, #1a1a1f 0%, #2a2a30 100%);
    border-bottom: 1px solid rgba(179, 135, 40, 0.4);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.xamu-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.xamu-chat-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #B38728, #DBAC34);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    flex-shrink: 0;
}

.xamu-chat-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.xamu-chat-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.xamu-chat-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.xamu-chat-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.xamu-chat-close:hover {
    background: rgba(179, 135, 40, 0.2);
    border-color: rgba(179, 135, 40, 0.4);
    color: #DBAC34;
}

/* ============================================
   Messages Area
   ============================================ */
.xamu-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #12121a;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom scrollbar */
.xamu-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.xamu-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(179, 135, 40, 0.3);
    border-radius: 3px;
}

.xamu-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(179, 135, 40, 0.5);
}

/* Message Bubbles */
.xamu-msg {
    display: flex;
}

.xamu-msg-bot {
    justify-content: flex-start;
}

.xamu-msg-user {
    justify-content: flex-end;
}

.xamu-msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.xamu-msg-bot .xamu-msg-bubble {
    background: #1e1e28;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 4px;
}

.xamu-msg-user .xamu-msg-bubble {
    background: linear-gradient(135deg, #B38728, #DBAC34);
    color: #0a0a0a;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* ============================================
   Typing Indicator
   ============================================ */
.xamu-typing {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.xamu-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B38728;
    animation: xamu-bounce 1.4s infinite;
}

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

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

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

/* ============================================
   Input Area
   ============================================ */
.xamu-chat-input-area {
    padding: 16px 20px;
    background: #1a1a1f;
    border-top: 1px solid rgba(179, 135, 40, 0.2);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.xamu-chat-input {
    flex: 1;
    padding: 10px 14px;
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.xamu-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.xamu-chat-input:focus {
    outline: none;
    border-color: rgba(179, 135, 40, 0.5);
    box-shadow: 0 0 0 2px rgba(179, 135, 40, 0.1);
}

.xamu-chat-send {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #B38728, #DBAC34);
    border: none;
    border-radius: 8px;
    color: #0a0a0a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.xamu-chat-send:hover {
    background: linear-gradient(135deg, #DBAC34, #FBF5B7);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(179, 135, 40, 0.3);
}

.xamu-chat-send:active {
    transform: scale(0.95);
}

.xamu-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (max-width: 768px) {
    .xamu-chat-header-btn .btn-text {
        display: none;
    }

    .xamu-chat-header-btn {
        padding: 8px 10px;
        gap: 0;
    }

    .xamu-chat-modal {
        width: 95vw;
        height: 80vh;
        max-height: 600px;
    }
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 480px) {
    .xamu-chat-overlay {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
        top: 60px;
    }

    .xamu-chat-modal {
        width: 100%;
        height: calc(100% - 60px);
        max-height: none;
        border-radius: 12px 12px 0 0;
        border: none;
        border-top: 1px solid rgba(179, 135, 40, 0.3);
    }
}
