/* ============================================ */
/* LUXURY CHAT ASSISTANT - BLACK & GOLD THEME */
/* Matching Screenshot Design Exactly */
/* ============================================ */

:root {
    /* Primary Colors - Black & Gold */
    --chat-gold: #D4AF37;
    --chat-gold-light: #F0D57B;
    --chat-gold-dark: #B8941E;
    --chat-gold-dim: rgba(212, 175, 55, 0.1);

    --chat-black: #1a1a1a;
    --chat-black-darker: #0f0f0f;
    --chat-surface: #2a2a2a;

    /* Text Colors */
    --chat-text: #ffffff;
    --chat-text-muted: #999999;

    /* Borders */
    --chat-border: rgba(212, 175, 55, 0.3);

    /* Shadows */
    --chat-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    --chat-glow: 0 0 20px rgba(212, 175, 55, 0.4);

    /* Status Colors */
    --chat-success: #10b981;
    --chat-error: #ef4444;

    /* Z-index levels */
    --chat-z-base: 9999;
    --chat-z-overlay: 9998;
}

/* ============================================ */
/* BASE CHAT WIDGET CONTAINER */
/* ============================================ */

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--chat-z-base);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================ */
/* CHAT TOGGLE BUTTON */
/* ============================================ */

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-gold) 0%, var(--chat-gold-dark) 100%);
    border: none;
    box-shadow: var(--chat-shadow), var(--chat-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--chat-shadow), 0 0 30px rgba(212, 175, 55, 0.6);
}

.chat-toggle.active {
    background: var(--chat-black);
    border: 2px solid var(--chat-gold);
}

.chat-toggle-icon {
    font-size: 24px;
    color: var(--chat-black);
    transition: all 0.3s ease;
}

.chat-toggle.active .chat-toggle-icon {
    color: var(--chat-gold);
    transform: rotate(90deg);
}

/* ============================================ */
/* NOTIFICATION BADGE */
/* ============================================ */

.chat-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #ef4444;
    border: 2px solid var(--chat-black);
    border-radius: 11px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ============================================ */
/* CHAT WINDOW - MATCHING SCREENSHOT */
/* ============================================ */

.chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--chat-black);
    border: 1px solid var(--chat-border);
    border-radius: 16px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ============================================ */
/* CHAT HEADER - MATCHING SCREENSHOT */
/* ============================================ */

.chat-header {
    padding: 16px 20px;
    background: var(--chat-black-darker);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--chat-gold) 0%, var(--chat-gold-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar i {
    font-size: 20px;
    color: var(--chat-black);
}

.chat-info {
    flex: 1;
}

.chat-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--chat-text);
    margin: 0;
}

.chat-subtitle {
    font-size: 12px;
    color: var(--chat-text-muted);
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status-indicator {
    width: 8px;
    height: 8px;
    background: var(--chat-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--chat-success);
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--chat-text-muted);
}

.chat-action-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--chat-gold);
    color: var(--chat-gold);
}

.chat-action-btn i {
    font-size: 14px;
}

/* ============================================ */
/* CHAT MESSAGES CONTAINER */
/* ============================================ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chat-black);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 2px;
}

/* ============================================ */
/* MESSAGE STYLES */
/* ============================================ */

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.message-avatar.bot {
    background: linear-gradient(135deg, var(--chat-gold) 0%, var(--chat-gold-dark) 100%);
    color: var(--chat-black);
}

.message-avatar.user {
    background: var(--chat-surface);
    color: var(--chat-gold);
}

.message.user {
    flex-direction: row-reverse;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.message.user .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: var(--chat-surface);
    border-top-left-radius: 4px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--chat-gold) 0%, var(--chat-gold-dark) 100%);
    border-top-right-radius: 4px;
}

.message-text {
    margin: 0;
    line-height: 1.5;
    color: var(--chat-text);
    font-size: 14px;
}

.message.user .message-text {
    color: var(--chat-black);
    font-weight: 500;
}

.message-time {
    font-size: 11px;
    color: var(--chat-text-muted);
    margin-top: 4px;
}

/* ============================================ */
/* TYPING INDICATOR */
/* ============================================ */

.typing-indicator {
    opacity: 0.7;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--chat-gold);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ============================================ */
/* QUICK ACTIONS - EXACT MATCH TO SCREENSHOT */
/* ============================================ */

.quick-actions {
    display: block;
    padding: 16px 20px;
    background: var(--chat-black-darker);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.quick-actions-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--chat-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-action {
    padding: 8px 10px;
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--chat-text);
}

.quick-action i {
    font-size: 12px;
    color: var(--chat-gold);
    flex-shrink: 0;
}

.quick-action:hover {
    background: rgba(42, 42, 42, 0.9);
    border-color: var(--chat-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.quick-action:hover i {
    transform: scale(1.1);
    color: var(--chat-gold-light);
}

/* ============================================ */
/* COMPLAINT SELECTOR */
/* ============================================ */

.complaint-selector {
    position: absolute;
    top: 57px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--chat-black);
    padding: 20px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: none;
    overflow-y: auto;
}

.complaint-selector.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.complaint-selector h4 {
    color: var(--chat-gold);
    margin-bottom: 16px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.complaint-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.complaint-option {
    padding: 14px 16px;
    background: var(--chat-surface);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--chat-text);
}

.complaint-option i {
    font-size: 18px;
    color: var(--chat-gold);
}

.complaint-option:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--chat-gold);
}

.complaint-option.selected {
    background: var(--chat-gold);
    border-color: var(--chat-gold);
    color: var(--chat-black);
}

.complaint-option.selected i {
    color: var(--chat-black);
}

/* ============================================ */
/* ESCALATION NOTIFICATION */
/* ============================================ */

.escalation-notification {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--chat-error);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    display: none;
}

.escalation-notification.active {
    display: block;
}

.escalation-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 8px;
}

.escalation-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--chat-error);
    text-align: center;
    margin-bottom: 4px;
}

.escalation-subtitle {
    font-size: 12px;
    color: var(--chat-text-muted);
    text-align: center;
}

/* ============================================ */
/* FILE UPLOAD AREA */
/* ============================================ */

.file-upload-area {
    background: var(--chat-surface);
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    margin: 12px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--chat-gold);
}

.file-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.file-upload-text {
    font-weight: 600;
    color: var(--chat-text);
    margin-bottom: 4px;
    font-size: 13px;
}

.file-upload-hint {
    font-size: 11px;
    color: var(--chat-text-muted);
}

/* ============================================ */
/* CHAT INPUT CONTAINER - MATCHING SCREENSHOT */
/* ============================================ */

.chat-input-container {
    padding: 16px 20px;
    background: var(--chat-black-darker);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--chat-surface);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--chat-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--chat-text);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: var(--chat-text-muted);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--chat-gold) 0%, var(--chat-gold-dark) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    color: var(--chat-black);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.chat-send-btn i {
    font-size: 14px;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

@media (max-width: 768px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .chat-toggle {
        width: 56px;
        height: 56px;
    }

    .chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        max-height: 600px;
        bottom: 70px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: -16px;
        border-radius: 0;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.chat-toggle:focus-visible,
.chat-action-btn:focus-visible,
.quick-action:focus-visible,
.chat-send-btn:focus-visible {
    outline: 2px solid var(--chat-gold);
    outline-offset: 2px;
}