/* AI Chat Section */
.ai-chat-section {
    background: #08202A;
    padding: 0 0 80px 0;
    position: relative;
    margin-top: -2px;
}

.ai-chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 0 20px;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-label {
    color: white;
    font-size: 38px;
    font-family: 'Adieu', sans-serif;
    font-weight: 400;
    margin-top: 16px; /* Match bottom margin */
    margin-bottom: 16px;
}

.section-title {
    color: white;
    font-size: 16px;
    font-family: 'Formular', 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Chat Demo Layout */
.chat-demo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 56px;
}

.chat-demo-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.button-dots-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Role Buttons */
.role-button {
    width: 181px;
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    outline: 1px solid white;
    outline-offset: -1px;
    display: flex;
    align-items: center;
    gap: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-size: 14px;
    font-family: 'Formular', sans-serif;
    font-weight: 400;
}

.role-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.role-button.active {
    background: #133035;
    outline: 1px solid #7ABF98;
    box-shadow: 0px 0px 4px rgba(122, 191, 152, 0.25);
}

.role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid white;
    flex-shrink: 0;
}

.role-button.active .role-dot {
    background: #7ABF98;
    border-color: #7ABF98;
}

/* Connection Dots */
.connection-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.connection-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.50);
    border-radius: 50%;
}

.connection-dots.active span {
    background: #7ABF98;
    box-shadow: 0px 0px 4px rgba(122, 191, 152, 0.25);
}

/* Chat Window */
.chat-window-container {
    width: 736px;
    height: 436px;
    padding: 10px;
    background: radial-gradient(ellipse 19.71% 45.81% at 49.93% 111.90%, rgba(18, 51, 64, 0.50) 0%, #08202A 100%);
    box-shadow: 0px 0px 4px #F28B50;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-window-header {
    display: flex;
    align-items: flex-start;
    position: relative;
    flex-shrink: 0;
    padding: 10px;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    left: 10px;
    top: 10px;
}

.control-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.control-dot.red { background: #F47074; }
.control-dot.yellow { background: #FDD41B; }
.control-dot.green { background: #73CD7D; }



/* Chat Logo */
.chat-window-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

.ebba-chat-logo {
    height: 1.2em;
    width: auto;
    opacity: 0.8;
}

/* Chat Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

/* Message Wrappers */
.user-message-wrapper {
    display: flex;
    justify-content: flex-start;
    padding-top: 10px;
}

.ai-message-wrapper {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

/* User Message */
.user-message {
    display: flex;
    align-items: flex-end;
    gap: 1em;
    max-width: 452px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 100px;
    overflow: hidden;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    outline: 1px solid #7ABF98;
}

.user-message-bubble {
    max-width: 420px;
    padding: 10px;
    background: #133035;
    border-radius: 4px 4px 4px 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-message-text {
    flex: 1;
    color: white;
    font-size: 12px;
    font-family: 'Formular', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
    line-height: 1.4;
}

/* AI Message */
.ai-message {
    display: flex;
    align-items: flex-end;
    gap: 1em;
    max-width: 452px;
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 24px;
    height: 24px;
    border-radius: 100px;
    overflow: hidden;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    outline: 1px solid #F28B50;
}

.ai-message-bubble {
    max-width: 420px;
    padding: 10px;
    background: #373632;
    border-radius: 4px 4px 3px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
}

.ai-message-text {
    flex: 1;
    color: white;
    font-size: 12px;
    font-family: 'Formular', sans-serif;
    font-weight: 400;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Typing Animation */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 16px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: whatsappTyping 1.5s infinite;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

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

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message-appear {
    animation: messageAppear 0.2s ease-out;
}

/* AI Message Content Container */
.ai-message-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.ai-message-text.dashboard-intro {
    margin-bottom: -8px;
}

.ai-message-text.follow-up {
    margin-top: 8px;
    font-style: italic;
}

/* Dashboard Button */
.dashboard-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(122, 191, 152, 0.1);
    border: 1px solid #7ABF98;
    color: #7ABF98;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Formular', sans-serif;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.dashboard-button:hover {
    background: rgba(122, 191, 152, 0.2);
    transform: translateX(2px);
}

.dashboard-button svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.dashboard-button:hover svg {
    transform: translateX(2px);
}

/* Spreadsheet Button */
.spreadsheet-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(242, 139, 80, 0.1);
    border: 1px solid #F28B50;
    color: #F28B50;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Formular', sans-serif;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.spreadsheet-button:hover {
    background: rgba(242, 139, 80, 0.2);
    transform: translateY(-1px);
}

.spreadsheet-button svg {
    width: 14px;
    height: 14px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-button {
    padding: 8px 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    font-family: 'Formular', sans-serif;
    font-weight: 400;
    text-decoration: none;
}

.action-button.outlined {
    background: #123340;
    outline: 1px solid white;
    outline-offset: -1px;
    color: white;
}

.action-button.filled {
    background: #F28B50;
    color: #123340;
}

/* Responsive */
@media (max-width: 1200px) {
    .chat-window-container {
        width: 600px;
        height: 400px;
    }
    
    .chat-demo-container {
        gap: 10px;
    }
}

@media (max-width: 1024px) {
    .chat-demo-container {
        flex-direction: column;
    }
    
    .chat-demo-column {
        width: 100%;
    }
    
    .button-dots-row {
        justify-content: center;
    }
    
    .connection-dots {
        display: none;
    }
    
    .chat-demo-column.left .role-button,
    .chat-demo-column.right .role-button {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .ai-chat-section {
        padding: 0 0 3em 0;
    }
    
    .ai-chat-container {
        padding: 3em 1em 0 1em;
    }
    
    .section-label {
        font-size: 2.25em; /* Same as hero-title */
        line-height: 1.2;
    }
    
    .section-title {
        font-size: 1em; /* Same as hero-subtitle */
        line-height: 1.5;
        margin-bottom: 1em; /* Reduced by 50% from 2em */
    }
    
    .chat-demo-container {
        flex-direction: column;
        gap: 1.5em;
    }
    
    .chat-demo-column.left,
    .chat-demo-column.right {
        display: none;
    }
    
    /* Role dropdown on mobile */
    .role-selector-mobile {
        display: block;
        width: 100%;
        max-width: 350px;
        margin: 0 auto 0.75em; /* Reduced by 50% from 1.5em */
    }
    
    .role-dropdown {
        width: 100%;
        padding: 12px 16px;
        background: #133035;
        border: 1px solid #7ABF98;
        box-shadow: 0px 0px 4px rgba(122, 191, 152, 0.25);
        border-radius: 10px;
        color: white;
        font-size: 14px;
        font-family: 'Formular', sans-serif;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237ABF98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 16px center;
        background-size: 20px;
        padding-right: 48px;
    }
    
    .role-dropdown option {
        background: #08202A;
        color: white;
    }
    
    .chat-window-container {
        width: calc(100% - 2em);
        max-width: 350px;
        height: 455px; /* 30% increase from 350px */
        margin: 0 auto;
    }
    
    .role-button {
        font-size: 12px;
        padding: 10px 8px;
        width: 160px;
    }
    
    /* Reduce message box width by 30% on mobile */
    .user-message,
    .ai-message {
        max-width: 70%; /* 30% reduction - relative to container */
    }
    
    .user-message-bubble,
    .ai-message-bubble {
        max-width: calc(100% - 40px); /* Account for avatar and gap */
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
    .role-selector-mobile {
        display: none;
    }
    
    .mobile-guide-text {
        display: none;
    }
}

/* Show mobile guide text only on mobile */
.mobile-guide-text {
    display: none;
}

@media (max-width: 768px) {
    .mobile-guide-text {
        display: inline;
    }
}