/**
 * EMPOWERED SOLUTIONS - DEMO CHATBOT STYLES v2
 * Premium floating chat widget with demo conversations
 */

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

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   FLOATING CHAT BUTTON - Premium & Polished
   ============================================ */

.chat-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4d9eff 0%, #3b82f6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(77, 158, 255, 0.35), 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chat-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(77, 158, 255, 0.45), 0 6px 12px rgba(0, 0, 0, 0.4);
}

.chat-button:active {
    transform: translateY(-2px) scale(1.02);
}

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

.chat-button i {
    font-size: 26px;
}

.chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Subtle pulse animation */
@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(77, 158, 255, 0.35), 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(77, 158, 255, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

.chat-button {
    animation: subtle-pulse 3s ease-in-out infinite;
}

/* ============================================
   CHAT WINDOW - Premium Dark Theme
   ============================================ */

.chat-window {
    position: absolute;
    bottom: 88px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 640px;
    max-height: calc(100vh - 140px);
    background: #1e1f2e;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.chat-window.open {
    display: flex;
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   CHAT HEADER - Gradient & Clean
   ============================================ */

.chat-header {
    background: linear-gradient(135deg, #4d9eff 0%, #3b82f6 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(8px);
}

.chat-header-text {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 3px;
}

.chat-status {
    font-size: 13px;
    opacity: 0.92;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: blink 2.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms;
    border-radius: 8px;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

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

/* ============================================
   DEMO SELECTOR - Modern Grid
   ============================================ */

.demo-selector {
    padding: 24px 20px;
    overflow-y: auto;
    flex: 1;
    background: #1a1b24;
}

.demo-selector-header h4 {
    font-size: 19px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px 0;
    letter-spacing: -0.01em;
}

.demo-selector-header p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.demo-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-option {
    background: #24253 8;
    border: 1.5px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.demo-option:hover {
    border-color: rgba(77, 158, 255, 0.4);
    background: #2a2b3c;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.demo-option:active {
    transform: translateY(-1px);
}

.demo-option i {
    font-size: 28px;
    color: #4d9eff;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.demo-option-text {
    flex: 1;
}

.demo-option-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.demo-option-text span {
    font-size: 13px;
    color: #94a3b8;
}

.demo-selector-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.demo-selector-footer p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-selector-footer i {
    color: #4d9eff;
}

/* ============================================
   CHAT MESSAGES - Clean & Readable
   ============================================ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1b24;
    display: none;
}

.demo-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.demo-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4d9eff, #3b82f6);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(77, 158, 255, 0.3);
}

.demo-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 4px 0;
    letter-spacing: -0.015em;
}

.demo-header p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: messageSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.message-ai .message-avatar {
    background: linear-gradient(135deg, #4d9eff, #3b82f6);
    color: white;
    box-shadow: 0 4px 12px rgba(77, 158, 255, 0.3);
}

.message-customer .message-avatar {
    background: #2a2b3c;
    color: #cbd5e1;
    border: 1.5px solid rgba(148, 163, 184, 0.12);
}

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

.message-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
}

.message-ai .message-bubble {
    background: #24253 8;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 14px 14px 14px 4px;
}

.message-customer .message-bubble {
    background: linear-gradient(135deg, #4d9eff 0%, #3b82f6 100%);
    color: white;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 4px 12px rgba(77, 158, 255, 0.25);
}

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

.message-customer .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* ============================================
   MESSAGE ACTIONS - Status Indicators
   ============================================ */

.message-actions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(77, 158, 255, 0.08);
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid rgba(77, 158, 255, 0.15);
    font-weight: 500;
}

.action-item i {
    color: #4d9eff;
    font-size: 13px;
}

/* ============================================
   TYPING INDICATOR - Smooth Animation
   ============================================ */

.typing-indicator {
    background: #24253 8;
    border: 1px solid rgba(148, 163, 184, 0.08);
    padding: 12px 16px;
    border-radius: 14px 14px 14px 4px;
    display: flex;
    gap: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4d9eff;
    animation: typing 1.5s ease-in-out infinite;
}

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

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

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

/* ============================================
   CHAT CONTROLS - Clear CTAs
   ============================================ */

.chat-controls {
    padding: 16px 20px;
    background: #1e1f2e;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    display: none;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.chat-controls button,
.chat-controls a {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-restart {
    background: transparent;
    border: 1.5px solid rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

.btn-restart:hover {
    border-color: rgba(77, 158, 255, 0.4);
    color: #4d9eff;
    background: rgba(77, 158, 255, 0.05);
}

.btn-choose {
    background: #24253 8;
    border: 1.5px solid rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.btn-choose:hover {
    background: #2a2b3c;
    border-color: rgba(77, 158, 255, 0.3);
    color: #f1f5f9;
}

.btn-cta {
    background: linear-gradient(135deg, #4d9eff 0%, #3b82f6 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(77, 158, 255, 0.3);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(77, 158, 255, 0.4);
}

.btn-cta:active {
    transform: translateY(0);
}

/* ============================================
   CHAT FOOTER - Subtle Branding
   ============================================ */

.chat-footer {
    padding: 12px 20px;
    background: #13141a;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    text-align: center;
    flex-shrink: 0;
}

.chat-footer p {
    font-size: 11px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .chat-button {
        width: 60px;
        height: 60px;
    }
    
    .chat-button i {
        font-size: 24px;
    }
    
    .chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 84px;
        right: 0;
        border-radius: 18px;
    }
    
    .demo-selector {
        padding: 20px 16px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .message-content {
        max-width: 82%;
    }
}

/* ============================================
   SCROLLBAR STYLING - Premium Dark
   ============================================ */

.chat-messages::-webkit-scrollbar,
.demo-selector::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.demo-selector::-webkit-scrollbar-track {
    background: #1a1b24;
}

.chat-messages::-webkit-scrollbar-thumb,
.demo-selector::-webkit-scrollbar-thumb {
    background: #3a3b4a;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.demo-selector::-webkit-scrollbar-thumb:hover {
    background: #4a4b5a;
}
