/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* Chat Bubble */
.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-drawer.active ~ .chat-bubble {
    bottom: 85vh;
    z-index: 997;
}

@media (min-width: 768px) {
    .chat-drawer.active ~ .chat-bubble {
        bottom: 20px;
        right: 440px;
    }
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.bubble-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.chat-icon {
    width: 24px;
    height: 24px;
    fill: #666;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Chat Drawer */
.chat-drawer {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 70vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chat-drawer.active {
    transform: translateY(0);
}

/* Desktop styles */
@media (min-width: 768px) {
    .chat-drawer {
        width: 400px;
        height: 600px;
        bottom: 20px;
        right: 20px;
        border-radius: 20px;
        transform: translateX(100%);
    }
    
    .chat-drawer.active {
        transform: translateX(0);
    }
    
    .overlay {
        display: none;
    }
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #d4a574, #b8956b);
    color: white;
    border-radius: 20px 20px 0 0;
}

@media (min-width: 768px) {
    .chat-header {
        border-radius: 20px 20px 0 0;
    }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-title {
    font-weight: 600;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

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

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot {
    background: #000000;
    color: white;
    align-self: flex-start;
}

.message.bot a {
    color: #d4a574;
    text-decoration: underline;
}

.message.bot a:hover {
    color: #e5b685;
}

.message.user {
    background: linear-gradient(135deg, #d4a574, #b8956b);
    color: white;
    align-self: flex-end;
}

.message.intro {
    margin-bottom: 10px;
}

/* Alan's intro messages - dark style */
.message.intro.left[data-sender="Alan"] {
    background: #4B2E2E;
    color: white;
    align-self: flex-start;
}

/* Bella intro messages - light style */
.message.intro.right {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #333;
}

/* Kesi intro messages - black style */
.message.intro.left[data-sender="Kesi"] {
    background: #000000;
    color: white;
}

.message.intro.left {
    align-self: flex-start;
}

.message.intro.right {
    align-self: flex-end;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.message-sender {
    font-weight: 600;
    font-size: 12px;
    opacity: 0.9;
}

.message-text {
    line-height: 1.4;
}

.question-link {
    color: #d4a574;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin: 4px 0;
    padding: 4px 0;
    border-bottom: 1px dotted rgba(212, 165, 116, 0.5);
    transition: all 0.2s ease;
}

.question-link:hover {
    color: #b8956b;
    text-decoration: none;
    border-bottom-color: #b8956b;
}

/* Starter Options - Hidden */
.starter-options {
    display: none;
}

.starter-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    font-style: italic;
}

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

.option-btn {
    background: white;
    border: 2px solid #d4a574;
    color: #8b7355;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover {
    background: #d4a574;
    color: white;
}

.open-text-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

#openTextInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#openTextInput:focus {
    border-color: #d4a574;
}

#openTextBtn {
    background: #d4a574;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#openTextBtn:hover {
    background: #b8956b;
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

#chatInput {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#chatInput:focus {
    border-color: #d4a574;
}

/* Call to action link styling */
.cta-link {
    color: #d4a574;
    text-decoration: none;
    font-weight: 600;
}

.cta-link:hover {
    text-decoration: underline;
}

/* Continue Button */
.continue-button {
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 12px 20px;
    margin: 15px auto;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    max-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.continue-button:hover {
    background: #e8e8e8;
    border-color: #ccc;
    transform: translateY(-1px);
}

.continue-button span {
    font-size: 12px;
    opacity: 0.8;
}

/* Intro Choice Buttons */
.intro-choice {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px auto;
    max-width: 280px;
}

.choice-btn {
    display: block;
    text-align: center;
    padding: 14px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.choice-btn.twiga-choice {
    background: #d4a574;
    color: white;
}

.choice-btn.twiga-choice:hover {
    background: #c49464;
    transform: translateY(-2px);
}

.choice-btn.schedule-choice {
    background: white;
    color: #333;
    border: 2px solid #d4a574;
}

.choice-btn.schedule-choice:hover {
    background: #f9f5f1;
    transform: translateY(-2px);
}

/* Scrollbar styling for webkit browsers */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d4a574;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #b8956b;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    max-width: 85%;
    align-self: flex-start;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Email capture form */
.email-capture-link {
    color: #c8a86b;
    text-decoration: underline;
    cursor: pointer;
}

.email-form-container {
    margin-top: 8px;
}

.email-form-container p {
    margin-bottom: 10px;
}

.email-form {
    display: flex;
    gap: 8px;
}

.email-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.email-input:focus {
    border-color: #c8a86b;
}

.email-submit-btn {
    padding: 10px 20px;
    background-color: #c8a86b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.email-submit-btn:hover {
    background-color: #b69555;
}