/* ============================================
   CHATBOTS.CSS - ChatBot Enterprise Demo
   Scoped styles for interactive chat demo
   ============================================ */

/* CSS Variables */
:root {
    --blue-500: #1E88E5;
    --blue-700: #0B3B6E;
    --red-500: #E53935;
    --red-700: #B71C1C;
    --amber: #FFC107;
    --bg-900: #0B1220;
    --text-100: #E6EEF7;
    --text-400: #9FB3C8;
    --card: #111a2e;
    --border: #193255;
    
    /* Additional variables */
    --glass-bg: rgba(17, 26, 46, 0.8);
    --glass-border: rgba(25, 50, 85, 0.5);
    --gradient-primary: linear-gradient(135deg, var(--blue-500), var(--red-500));
    --shadow-glow: 0 0 30px rgba(30, 136, 229, 0.3);
    --shadow-glow-red: 0 0 30px rgba(229, 57, 53, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ============================================
   CHATBOT SECTION STYLES
   ============================================ */

.chatbot-section {
    min-height: 100vh;
    background: var(--bg-900);
    padding: 120px 0 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

.chatbot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0.8;
}

.chatbot-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), var(--shadow-glow);
    border-color: var(--blue-500);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.card-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 20px rgba(30, 136, 229, 0.3);
}

.card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 193, 7, 0.1);
    color: var(--amber);
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Card Content */
.card-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-100);
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-description {
    color: var(--text-400);
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.card-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-400);
    font-size: 0.95rem;
}

.feature-item i {
    color: var(--blue-500);
    font-size: 1.125rem;
    width: 20px;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-500);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-400);
}

.stat-rating .stars {
    display: flex;
    gap: 2px;
}

.stat-rating .stars i {
    color: var(--amber);
    font-size: 1rem;
}

.stat-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--red-500);
}

.stat-period {
    font-size: 0.875rem;
    color: var(--text-400);
}

/* Demo CTA Button */
.demo-cta-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 auto;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(30, 136, 229, 0.3);
}

.demo-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.demo-cta-btn:hover::before {
    left: 100%;
}

.demo-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(30, 136, 229, 0.4), var(--shadow-glow);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 20px 40px rgba(30, 136, 229, 0.4), 0 0 30px rgba(30, 136, 229, 0.6);
    }
    50% {
        box-shadow: 0 20px 40px rgba(229, 57, 53, 0.4), 0 0 30px rgba(229, 57, 53, 0.6);
    }
}

/* ============================================
   CHAT DEMO OVERLAY
   ============================================ */

.chat-demo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 18, 32, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    overflow-y: auto;
    padding: 3rem 1rem;
}

.chat-demo-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.chat-demo-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 960px;
    width: 100%;
    min-height: 560px;
    max-height: 85vh;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    overflow: hidden;
    margin: auto;
}

.chat-demo-overlay.active .chat-demo-container {
    transform: scale(1);
}

/* Demo Header */
.demo-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 18, 32, 0.8);
}

.demo-header h2 {
    color: var(--text-100);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.demo-close-btn {
    background: none;
    border: none;
    color: var(--text-400);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.demo-close-btn:hover {
    background: rgba(229, 57, 53, 0.1);
    color: var(--red-500);
    transform: scale(1.1);
}

/* Bot Selector Tabs */
.bot-selector {
    display: flex;
    padding: 1rem 2rem;
    gap: 1rem;
    background: rgba(11, 18, 32, 0.5);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.bot-tab {
    background: rgba(25, 50, 85, 0.3);
    border: 1px solid var(--border);
    color: var(--text-400);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.bot-tab:hover {
    background: rgba(30, 136, 229, 0.2);
    border-color: var(--blue-500);
    color: var(--text-100);
    transform: translateY(-2px);
}

.bot-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 5px 15px rgba(30, 136, 229, 0.3);
}

.bot-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: white;
    border-radius: 1px;
}

/* ============================================
   CHAT PANEL
   ============================================ */

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 450px;
    background: var(--card);
}

/* Chat Header */
.chat-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 18, 32, 0.8);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bot-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 5px 15px rgba(30, 136, 229, 0.3);
}

.bot-details h4 {
    color: var(--text-100);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.bot-badges {
    display: flex;
    gap: 0.25rem;
}

.tech-badge {
    background: rgba(255, 193, 7, 0.1);
    color: var(--amber);
    padding: 0.125rem 0.5rem;
    border-radius: 8px;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-400);
    font-size: 0.875rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    animation: pulse-status 2s ease-in-out infinite;
}

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

/* Messages Area */
.messages-area {
    flex: 1;
    padding: 1rem 2rem;
    overflow-y: auto;
    background: var(--bg-900);
    scroll-behavior: smooth;
}

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

.messages-area::-webkit-scrollbar-track {
    background: rgba(25, 50, 85, 0.2);
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--blue-500);
    border-radius: 3px;
}

.welcome-message,
.message-group {
    margin-bottom: 1rem;
}

.bot-message,
.user-message {
    display: flex;
    margin-bottom: 0.5rem;
}

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

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    animation: slideInMessage 0.3s ease-out;
}

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

.bot-bubble {
    background: rgba(30, 136, 229, 0.15);
    border: 1px solid rgba(30, 136, 229, 0.3);
    color: var(--text-100);
    border-bottom-left-radius: 4px;
}

.user-bubble {
    background: rgba(229, 57, 53, 0.15);
    border: 1px solid rgba(229, 57, 53, 0.3);
    color: var(--text-100);
    border-bottom-right-radius: 4px;
}

.message-time {
    display: block;
    font-size: 0.625rem;
    color: var(--text-400);
    margin-top: 0.25rem;
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    padding: 0 2rem 1rem;
    background: var(--bg-900);
}

.typing-bubble {
    background: rgba(30, 136, 229, 0.15);
    border: 1px solid rgba(30, 136, 229, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--blue-500);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite both;
}

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

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Area */
.input-area {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    background: rgba(11, 18, 32, 0.8);
}

.input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--bg-900);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 0.5rem;
    transition: border-color var(--transition-fast);
}

.input-container:focus-within {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

#message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-100);
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    outline: none;
    resize: none;
}

#message-input::placeholder {
    color: var(--text-400);
}

.send-btn,
.clear-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.send-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
}

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

.clear-btn {
    background: rgba(229, 57, 53, 0.1);
    color: var(--red-500);
    border: 1px solid rgba(229, 57, 53, 0.3);
}

.clear-btn:hover {
    background: rgba(229, 57, 53, 0.2);
    transform: scale(1.1);
}

.input-help {
    margin-top: 0.5rem;
    text-align: center;
}

.input-help small {
    color: var(--text-400);
    font-size: 0.75rem;
}

/* ============================================
   INFO CARDS
   ============================================ */

.info-cards {
    padding: 2rem;
    background: rgba(11, 18, 32, 0.5);
    border-top: 1px solid var(--border);
}

.info-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease-out;
}

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

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--blue-500);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.3);
}

.info-card h4 {
    color: var(--text-100);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.info-card p {
    color: var(--text-400);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.info-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.info-badge {
    background: rgba(255, 193, 7, 0.1);
    color: var(--amber);
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Shake animation for empty input */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* Cross-fade transition */
.cross-fade-enter {
    opacity: 0;
    transform: translateX(20px);
}

.cross-fade-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease-out;
}

.cross-fade-exit {
    opacity: 1;
    transform: translateX(0);
}

.cross-fade-exit-active {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease-out;
}

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

@media (max-width: 992px) {
    .chatbot-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .card-title {
        font-size: 2rem;
    }
    
    .card-features {
        grid-template-columns: 1fr;
    }
    
    .chat-demo-container {
        margin: 1rem;
        min-height: 500px;
    }
    
    .demo-header {
        padding: 1rem;
    }
    
    .demo-header h2 {
        font-size: 1.25rem;
    }
    
    .bot-selector {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .bot-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .chat-panel {
        height: 400px;
    }
    
    .info-cards {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .chatbot-section {
        padding: 100px 0 60px;
    }
    
    .chatbot-card {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .chat-demo-overlay {
        padding: 1rem 0.5rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.75rem;
    }
    
    .card-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .demo-cta-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .chat-demo-overlay {
        padding: 1rem 0.5rem;
    }
    
    .chat-demo-container {
        min-height: 400px;
        max-height: 90vh;
        margin: 1rem auto;
    }
    
    .demo-header {
        padding: 1rem;
    }
    
    .demo-header h2 {
        font-size: 1.125rem;
    }
    
    .bot-selector {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .bot-tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }
    
    .chat-header {
        padding: 0.75rem 1rem;
    }
    
    .bot-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .bot-details h4 {
        font-size: 1rem;
    }
    
    .messages-area {
        padding: 1rem;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .input-area {
        padding: 1rem;
    }
    
    .send-btn,
    .clear-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

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

/* Focus styles */
.bot-tab:focus,
.demo-cta-btn:focus,
.send-btn:focus,
.clear-btn:focus,
.demo-close-btn:focus {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

#message-input:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-400: #FFFFFF;
        --bg-900: #000000;
        --card: #1a1a1a;
        --border: #333333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   END OF CHATBOTS.CSS
   ============================================ */
