/* =========================================
   Chatbot Page Styles (Dark Luxury Edition)
   Consistent with styles.css & formbooking.css
   ========================================= */

/* Hero Section */
.chatbot-hero {
    position: relative;
    padding: clamp(5rem, 10vw, 9rem) 0 clamp(2rem, 4vw, 3rem);
    text-align: center;
    background-color: var(--clr-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-eyebrow {
    display: block;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--clr-accent);
    margin-bottom: 0.75rem;
}

.chatbot-hero h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    font-weight: var(--fw-bold);
    color: var(--clr-secondary);
    margin-bottom: 0.75rem;
}

.hero-desc {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: var(--clr-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Chat Section */
.chat-section {
    padding: clamp(1.5rem, 3vw, 3rem) 0 clamp(3rem, 6vw, 6rem);
    background-color: var(--clr-primary);
}

.chat-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Chat Container */
.chat-container {
    background-color: var(--clr-surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: var(--clr-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(213, 175, 54, 0.15);
    color: var(--clr-accent);
    flex-shrink: 0;
}

.chat-header-text h3 {
    font-size: 0.95rem;
    font-weight: var(--fw-semibold);
    color: var(--clr-secondary);
    margin-bottom: 0;
}

.chat-header-text p {
    font-size: 0.75rem;
    color: var(--clr-text-secondary);
    margin-bottom: 0;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    min-height: 300px;
    max-height: 480px;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* =========================================
   Message Bubbles
   PRD §13.1: assistant-message-block structure
   - assistant-bubble-row -> bubble
   - assistant-cta-row -> cta-container (BELOW bubble, NEVER beside)
   ========================================= */
.message {
    display: flex;
    animation: messageIn 0.3s ease forwards;
}

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

/* PRD §10.1: CTA must be BELOW bubble, not beside.
   flex-direction: column ensures vertical stacking. */
.message-bot {
    flex-direction: column !important;
    align-items: flex-start !important;
}

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

.message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* PRD §15.1: Border bubble assistant MUST be visible on desktop */
.message-bot .message-bubble {
    background-color: var(--clr-elevated);
    color: var(--clr-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom-left-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
}

.message-user .message-bubble {
    background-color: var(--clr-accent);
    color: #111111;
    border-bottom-right-radius: 4px;
}

/* =========================================
   Inline CTA Buttons (below bot bubble)
   PRD §13.1 & §14.2: CTA container is a SEPARATE row
   below the bubble, never inside or beside the bubble.
   ========================================= */
.chat-cta-inline {
    margin-top: 0.5rem;
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 80%;
    /* PRD §14.4: CTA follows assistant alignment area */
    align-items: flex-start;
}

/* PRD §18.6: Empty CTA container must not render */
.chat-cta-inline:empty {
    display: none !important;
}

.chat-cta-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* PRD §15.1: Border tombol Booking sekarang MUST be visible on desktop */
.chat-cta-btn.cta-booking {
    background-color: var(--clr-accent);
    color: #111111;
    border: 1px solid var(--clr-accent);
}

.chat-cta-btn.cta-booking:hover {
    background-color: var(--clr-accent-hover);
    border-color: var(--clr-accent-hover);
}

/* PRD §15.4: hover/focus must NOT remove border */
.chat-cta-btn.cta-booking:focus {
    border-color: var(--clr-accent);
    outline: 2px solid rgba(213, 175, 54, 0.4);
    outline-offset: 2px;
}

/* PRD §15.1: Border tombol Chat via WhatsApp MUST be visible on desktop */
.chat-cta-btn.cta-wa {
    background-color: transparent;
    color: var(--clr-accent);
    border: 1px solid var(--clr-accent);
}

.chat-cta-btn.cta-wa:hover {
    background-color: rgba(213, 175, 54, 0.1);
    border-color: var(--clr-accent-hover);
}

/* PRD §15.4: hover/focus must NOT remove border */
.chat-cta-btn.cta-wa:focus {
    border-color: var(--clr-accent);
    outline: 2px solid rgba(213, 175, 54, 0.4);
    outline-offset: 2px;
}

/* Loading Indicator */
.chat-loading {
    display: none;
    padding: 0 1.25rem 0.25rem;
}

.chat-loading.visible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.75rem 1rem;
    background-color: var(--clr-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--clr-text-secondary);
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Error Message */
.message-error .message-bubble {
    background-color: rgba(220, 53, 69, 0.15);
    color: #f8a5a5;
    border: 1px solid rgba(220, 53, 69, 0.25);
}

/* Quick Questions */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-btn {
    padding: 0.4rem 0.85rem;
    background: transparent;
    color: var(--clr-accent);
    border: 1px solid rgba(213, 175, 54, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background-color: rgba(213, 175, 54, 0.1);
    border-color: var(--clr-accent);
}

.quick-btn:active {
    transform: scale(0.96);
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background-color: var(--clr-elevated);
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background-color: var(--clr-surface);
    color: var(--clr-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.chat-input:focus {
    border-color: var(--clr-accent);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    background-color: var(--clr-accent);
    color: #111111;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.15s ease;
}

.chat-send-btn:hover {
    background-color: var(--clr-accent-hover);
}

.chat-send-btn:active {
    transform: scale(0.94);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(213, 175, 54, 0.3);
}

/* CTA Section (static, below chat container) */
.chat-cta {
    text-align: center;
    padding: 2rem 1.25rem 0;
}

.chat-cta p {
    font-size: 0.9rem;
    color: var(--clr-text-secondary);
    margin-bottom: 1rem;
}

.chat-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================
   Responsive: Tablet
   ========================================= */
@media (max-width: 992px) {
    .chat-messages {
        max-height: 400px;
    }

    .chat-wrapper {
        padding: 0 0.5rem;
    }
}

/* =========================================
   Responsive: Mobile
   ========================================= */
@media (max-width: 576px) {
    .chatbot-hero {
        padding: clamp(4rem, 12vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2rem);
    }

    .chat-messages {
        max-height: 360px;
        min-height: 250px;
        padding: 1rem 0.75rem;
    }

    .message-bubble {
        max-width: 88%;
        font-size: 0.825rem;
        padding: 0.65rem 0.85rem;
    }

    .quick-questions {
        padding: 0.75rem;
        gap: 0.4rem;
    }

    .quick-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
    }

    .chat-input-area {
        padding: 0.65rem 0.75rem;
    }

    .chat-header {
        padding: 0.85rem 1rem;
    }

    .chat-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .chat-cta-buttons .btn-outline,
    .chat-cta-buttons .btn-primary {
        width: 100%;
        text-align: center;
    }

    /* PRD §14.6: Mobile — two CTA buttons may stack vertically */
    .chat-cta-inline {
        flex-direction: column;
    }

    .chat-cta-btn {
        width: 100%;
    }
}
