/* Chat Widget Container */
#chat-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Widget Icon */
#chat-widget-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    order: 2;
    position: relative;
    overflow: hidden;
}

#chat-widget-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

#chat-widget-icon:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 120, 255, 0.4);
}

#chat-widget-icon:hover::before {
    opacity: 1;
}

#chat-widget-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
    transition: transform 0.3s;
}

#chat-widget-icon:hover svg {
    transform: scale(1.1);
}

/* Chat Widget */
#chat-widget {
    width: 370px;
    max-height: 550px;
    background: #ffffff;
    border-radius: 20px;
    /* box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    order: 1;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#chat-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* Chat Header */
#chat-header {
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    color: white;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

#chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shine 3s infinite linear;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Theme Toggle Button */
#theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    z-index: 1;
    flex-shrink: 0;
}

#theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(30deg);
}

#theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    transition: transform 0.3s;
}

#theme-toggle-btn .sun-icon {
    display: block;
}

#theme-toggle-btn .moon-icon {
    display: none;
}

/* Restart Button */
#restart-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 1;
    flex-shrink: 0;
}

#restart-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Messages Container */
#messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    background: #fafbfc;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
#messages::-webkit-scrollbar {
    width: 6px;
}

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

#messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Message Styles */
.message {
    margin: 12px 0;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot Message */
.message.bot {
    background: white;
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    color: #333;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.message.bot::before {
    content: '';
    position: absolute;
    left: -6px;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* User Message */
.message.user {
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    padding: 14px 18px;
    border-radius: 18px 18px 4px 18px;
    color: white;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(0, 120, 255, 0.2);
    position: relative;
}

.message.user::before {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: #0078FF;
    transform: rotate(45deg);
}

/* Typing Indicator */
.message.typing {
    background: white;
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    width: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.typing span {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: #0078FF;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

/* Connecting Animation */
.message.connecting {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 18px;
    padding: 16px 20px;
    margin: 12px 0;
    text-align: center;
    max-width: 85%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 120, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(0, 120, 255, 0);
    }
}

.connecting-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.connecting-text {
    font-weight: 600;
    color: #1976d2;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.connecting-dots {
    display: flex;
    gap: 6px;
}

.connecting-dot {
    width: 10px;
    height: 10px;
    background: #1976d2;
    border-radius: 50%;
    animation: connectingBounce 1.4s infinite ease-in-out both;
}

.connecting-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.connecting-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes connectingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
    }

    40% {
        transform: scale(1);
    }
}

.message.connecting .timer {
    font-size: 12px;
    color: #1976d2;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    opacity: 0.8;
}

/* FAQ Container Styles */
.faq-container {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-container.show {
    opacity: 1;
    transform: translateY(0);
}

/* FAQ Dropdown */
.faq-dropdown {
    background: white;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.faq-dropdown-header {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
    background: #f8fafc;
    transition: background-color 0.2s;
}

.faq-dropdown-header:hover {
    background: #e8f2ff;
}

.faq-dropdown-arrow {
    transition: transform 0.3s;
}

.faq-dropdown.active .faq-dropdown-arrow {
    transform: rotate(180deg);
}

.faq-dropdown-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.faq-dropdown.active .faq-dropdown-content {
    padding: 12px 0;
    max-height: 400px;
    overflow-y: auto;
}

/* FAQ Items */
.faq-item {
    margin: 0 12px 8px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f4f8;
    background: #fafbfc;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-question {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #2d3748;
    transition: background-color 0.2s;
}

.faq-question:hover {
    background: #f1f5f9;
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.faq-item.active .faq-answer {
    padding: 16px;
    max-height: 200px;
}

.faq-answer-content {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
}

/* FAQ Bubble Buttons */
.faq-bubble {
    background: white;
    border: 1px solid #e1e8f0;
    padding: 14px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.faq-bubble:hover {
    background: #e8f2ff;
    border-color: #0078FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.15);
}

/* Secondary FAQ Bubble */
.faq-bubble.secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.faq-bubble.secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
}

/* ===============================
   INPUT AREA - DIPERBAIKI
================================ */
#input-area {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 20px;
    border: 1px solid #e1e8f0;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.3s;
    outline: none;
    min-width: 0;
}

#user-input:focus {
    border-color: #0078FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.1);
}

/* BUTTON CONTAINER - DIPERBAIKI */
.button-container {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ===============================
   VOICE BUTTON - DIPERBAIKI
================================ */
#voiceBtn {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    flex-shrink: 0;
    padding: 0;
}

#voiceBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* ACTIVE LISTENING STATE */
#voiceBtn.listening {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    animation: voicePulse 1.5s infinite;
}

/* Pulse animation */
@keyframes voicePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

/* ===============================
   SEND BUTTON - DIPERBAIKI
================================ */
#send-btn {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    padding: 0;
}

#send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.25);
}

#send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* ===============================
   AGENT BUTTON - DIPERBAIKI
================================ */
#agent-btn {
    height: 46px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    border-radius: 23px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 16px;
    font-size: 14px;
}

#agent-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
}

/* Selection Container */
.selection-container {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: flex !important;
    margin-top: 12px;
    flex-direction: column;
    gap: 10px;
}

.selection-container.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.selection-bubble {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: white !important;
    border: 1px solid #e1e8f0 !important;
    padding: 16px 20px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    transition: all 0.3s !important;
    text-align: left !important;
    align-items: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    margin-bottom: 8px !important;
}

.selection-bubble:hover {
    background: #e8f2ff !important;
    border-color: #0078FF !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 120, 255, 0.15) !important;
}

.selection-bubble .number {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%) !important;
    color: white !important;
    border-radius: 50% !important;
    margin-right: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

.selection-bubble .label {
    flex: 1 !important;
}

/* Demo Container */
.demo-container {
    margin-top: 12px;
    background: white;
    border: 1px solid #e1e8f0;
    border-radius: 16px;
    padding: 20px;
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.demo-container.show {
    opacity: 1;
    transform: translateY(0);
}

.demo-form-group {
    margin-bottom: 16px;
}

.demo-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.demo-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e1e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: #f8fafc;
    outline: none;
}

.demo-form-group input:focus {
    border-color: #0078FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.1);
}

.demo-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.demo-submit-btn {
    flex: 1;
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.demo-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.25);
}

.demo-cancel-btn {
    flex: 1;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.demo-cancel-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.demo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    gap: 8px;
}

.demo-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.25);
    color: white;
    text-decoration: none;
}

.demo-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.demo-option-btn {
    background: white;
    border: 1px solid #e1e8f0;
    padding: 16px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: left;
}

.demo-option-btn:hover {
    background: #e8f2ff;
    border-color: #0078FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.15);
}

/* Product Option Button */
.product-option-btn {
    background: white;
    border: 1px solid #e1e8f0;
    padding: 16px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.product-option-btn:hover {
    background: #e8f2ff;
    border-color: #0078FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.15);
}

.product-option-btn i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Redirect Message */
.redirect-message {
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 12px;
    border: 1px solid #ffeaa7;
    font-size: 14px;
    line-height: 1.5;
    color: #856404;
}

/* Agent Badge */
.agent-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 4px 0 8px 0;
    background: rgba(0, 120, 255, 0.1);
    border: 1px solid rgba(0, 120, 255, 0.2);
    color: #0078FF;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Analysis Badge */
.analysis-badge {
    margin: 8px 0;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Escalation Container */
.escalation-container {
    margin: 16px 0;
    animation: fadeIn 0.3s ease;
}

.escalation-container>div {
    background: #fff9e6;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 16px;
}

/* Modal Overlays */
#captcha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 10000;
    animation: overlayFadeIn 0.3s ease;
}

/* @keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
} */

/* Modals */
#captcha-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 10001;
    animation: modalPopIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    max-width: 400px;
    width: 90%;
}

/* @keyframes modalPopIn {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
} */

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e1e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #0078FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.1);
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-buttons button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
}

#submit-agent-form {
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    color: white;
}

#submit-agent-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.25);
}

#cancel-agent-form {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

#cancel-agent-form:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Confirmation Buttons */
.confirmation-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.confirmation-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

#confirm-yes {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

#confirm-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

#confirm-no {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

#confirm-no:hover {
    background: #e2e8f0;
    color: #475569;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-button {
    display: block;
    padding: 14px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s;
}

.file-input-button:hover {
    background: #e8f2ff;
    border-color: #0078FF;
    color: #0078FF;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #0078FF 0%, #0056CC 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: notificationSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    max-width: 300px;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dark Mode Styles */
#chat-widget.dark-mode {
    background: #1a1a1a;
    border-color: #333;
}

#chat-widget.dark-mode #messages {
    background: #121212;
}

#chat-widget.dark-mode .message.bot {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #333;
}

#chat-widget.dark-mode .message.bot::before {
    background: #2a2a2a;
    border-left-color: #333;
    border-bottom-color: #333;
}

#chat-widget.dark-mode .message.typing {
    background: #2a2a2a;
    border-color: #333;
}

#chat-widget.dark-mode .message.connecting {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
    border-color: #444;
}

#chat-widget.dark-mode #input-area {
    background: #1a1a1a;
    border-color: #333;
}

#chat-widget.dark-mode #user-input {
    background: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

#chat-widget.dark-mode #user-input:focus {
    border-color: #0078FF;
    background: #333;
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.2);
}

#chat-widget.dark-mode .faq-bubble,
#chat-widget.dark-mode .selection-bubble,
#chat-widget.dark-mode .demo-option-btn,
#chat-widget.dark-mode .product-option-btn {
    background: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

#chat-widget.dark-mode .faq-bubble:hover,
#chat-widget.dark-mode .selection-bubble:hover,
#chat-widget.dark-mode .demo-option-btn:hover,
#chat-widget.dark-mode .product-option-btn:hover {
    background: #333;
    border-color: #0078FF;
}

#chat-widget.dark-mode .faq-dropdown,
#chat-widget.dark-mode .faq-item,
#chat-widget.dark-mode .demo-container {
    background: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

#chat-widget.dark-mode .faq-dropdown-header,
#chat-widget.dark-mode .faq-question {
    background: #333;
    color: #e0e0e0;
}

#chat-widget.dark-mode .faq-dropdown-header:hover,
#chat-widget.dark-mode .faq-question:hover {
    background: #3a3a3a;
}

#chat-widget.dark-mode .faq-answer,
#chat-widget.dark-mode .faq-dropdown-content {
    background: #2a2a2a;
}

#chat-widget.dark-mode .faq-answer-content {
    color: #ccc;
}

#chat-widget.dark-mode .faq-bubble.secondary {
    background: #333;
    border-color: #444;
    color: #aaa;
}

#chat-widget.dark-mode .faq-bubble.secondary:hover {
    background: #3a3a3a;
    border-color: #555;
    color: #ccc;
}

#chat-widget.dark-mode .demo-form-group input {
    background: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

#chat-widget.dark-mode .demo-form-group input:focus {
    background: #333;
    border-color: #0078FF;
}

#chat-widget.dark-mode .demo-cancel-btn {
    background: #333;
    color: #ccc;
    border-color: #444;
}

#chat-widget.dark-mode .demo-cancel-btn:hover {
    background: #3a3a3a;
    color: #e0e0e0;
}

#chat-widget.dark-mode .redirect-message {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
    border-color: #444;
    color: #ffd700;
}

#chat-widget.dark-mode .agent-badge {
    background: rgba(0, 120, 255, 0.2);
    border-color: rgba(0, 120, 255, 0.3);
    color: #66b3ff;
}

/* Dark mode for modals */
.dark-mode #captcha-modal,
.dark-mode #agent-form-modal {
    background: #1a1a1a;
    color: #e0e0e0;
}

.dark-mode .form-group input,
.dark-mode .form-group textarea {
    background: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

.dark-mode .form-group input:focus,
.dark-mode .form-group textarea:focus {
    background: #333;
    border-color: #0078FF;
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.2);
}

.dark-mode .file-input-button {
    background: #2a2a2a;
    border-color: #333;
    color: #ccc;
}

.dark-mode .file-input-button:hover {
    background: #333;
    border-color: #0078FF;
    color: #0078FF;
}

.dark-mode #cancel-agent-form {
    background: #333;
    color: #ccc;
    border-color: #444;
}

.dark-mode #cancel-agent-form:hover {
    background: #3a3a3a;
    color: #e0e0e0;
}

.dark-mode #confirm-no {
    background: #333;
    color: #ccc;
    border-color: #444;
}

.dark-mode #confirm-no:hover {
    background: #3a3a3a;
    color: #e0e0e0;
}

/* Tambahkan di file CSS Anda */
.rating-container {
    animation: fadeIn 0.3s ease;
    margin: 10px 0;
}

.rating-btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

.rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

/* Agent Info Form Styles */
.agent-info-form-container {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.agent-info-form-container.show {
    opacity: 1;
    transform: translateY(0);
}

.agent-info-form-container input {
    font-size: 14px;
    transition: border-color 0.2s;
}

.agent-info-form-container input:focus {
    outline: none;
    border-color: #0078FF !important;
    box-shadow: 0 0 0 2px rgba(0, 120, 255, 0.1);
}

/* AI Rating Styles */
.ai-rating-container {
    animation: fadeIn 0.3s ease-in-out;
}

.ai-rating-star {
    transition: all 0.2s ease;
}

.ai-rating-star:hover {
    transform: scale(1.2) !important;
}

/* Scrollbar in dark mode */
#chat-widget.dark-mode #messages::-webkit-scrollbar-track {
    background: #2a2a2a;
}

#chat-widget.dark-mode #messages::-webkit-scrollbar-thumb {
    background: #444;
}

#chat-widget.dark-mode #messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===============================
   RESPONSIVE DESIGN - DIPERBAIKI
================================ */
@media (max-width: 480px) {
    #chat-widget-container {
        bottom: 16px;
        right: 16px;
    }

    #chat-widget {
        width: calc(100vw - 32px);
        max-height: 80vh;
        border-radius: 16px;
    }

    #chat-widget-icon {
        width: 56px;
        height: 56px;
    }

    #theme-toggle-btn {
        width: 32px;
        height: 32px;
    }

    #theme-toggle-btn svg {
        width: 18px;
        height: 18px;
    }

    .message {
        max-width: 90%;
    }

    .selection-bubble,
    .faq-bubble,
    .demo-option-btn {
        padding: 14px 16px;
        font-size: 14px;
    }

    /* INPUT AREA RESPONSIVE */
    #input-area {
        padding: 12px;
        gap: 8px;
        flex-wrap: wrap;
	display: block;
    }
    
    #user-input {
        padding: 12px 16px;
        font-size: 14px;
        width: -webkit-fill-available;
        margin-bottom: 8px;
    }
    
    .button-container {
        order: 2;
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }
    
    #voiceBtn,
    #send-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
	margin: 0 3px;
    }
    
    #agent-btn {
        height: 44px;
        padding: 0 14px;
        font-size: 13px;
        flex: 1;
        max-width: none;
    }
}

/* Untuk layar sangat kecil */
@media (max-width: 360px) {
    .button-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #agent-btn {
        order: -1;
        width: 100%;
        margin-bottom: 8px;
        height: 44px;
        border-radius: 22px;
    }
    
    #voiceBtn,
    #send-btn {
        width: 42px;
        height: 42px;
    }
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.agent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.agent-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.85);
    background: #fff;
    width: 90%;
    max-width: 420px;
    padding: 26px;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
}

@keyframes modalPop {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.agent-modal h3 {
    margin: 0 0 15px;
}

.agent-modal input,
.agent-modal textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.agent-modal button {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

#submit-agent-btn {
    background: #0078ff;
    color: #fff;
}

#cancel-agent-btn {
    background: #e2e2e2;
    margin-left: 8px;
}

.agent-overlay,
.agent-modal {
    display: block;
    visibility: hidden;
}

.agent-overlay.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.agent-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    visibility: visible;
}