/* Chatbox Widget Styles - Airplane Theme */
.chatbox-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    z-index: 100000;
}

.chatbox-toggle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #415691 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.3);
    transition: all 0.3s ease;
    border: 3px solid #f59e0b;
    padding: 0;
    position: relative;
}

.chatbox-toggle:hover {
    transform: scale(1.15) rotateZ(10deg);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

.chatbox-toggle::before {
    content: '✈️';
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbox-toggle svg {
    display: none;
}

.chatbox-toggle.open svg {
    display: none;
}

.chatbox-container {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 600px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f4f8 100%);
    border-radius: 16px;
    box-shadow: 0 8px 45px rgba(30, 58, 138, 0.25);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.90) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 0;
    border: 2px solid #f59e0b;
}

.chatbox-container.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    max-height: 600px;
}

.chatbox-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #f59e0b;
    cursor: grab;
    touch-action: none;
    position: relative;
    overflow: hidden;
}

.chatbox-header::before {
    content: '✈️';
    position: absolute;
    right: -15px;
    top: -10px;
    font-size: 60px;
    opacity: 0.1;
}

.chatbox-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.chatbox-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbox-export,
.chatbox-email,
.chatbox-contact {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: 28px;
    height: 28px;
}

.chatbox-export:hover,
.chatbox-email:hover,
.chatbox-contact:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chatbox-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.chatbox-close:hover {
    opacity: 1;
    transform: scale(1.15);
}
}

.chatbox-widget.dragging {
    user-select: none;
}

.chatbox-widget.dragging .chatbox-header {
    cursor: grabbing;
}

.chatbox-faq {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

.chatbox-faq.show {
    display: flex;
}

.faq-btn {
    background: white;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
    min-height: 34px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.faq-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
    transform: translateX(2px);
}

.chatbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
    position: relative;
}

.chatbox-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
}

.message {
    display: flex;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 12px rgba(30, 58, 138, 0.2);
}

.message.assistant .message-content {
    background: #e8f1f8;
    color: #1e3a8a;
    border-bottom-left-radius: 4px;
    border-left: 3px solid #f59e0b;
}

.chatbox-input-area {
    padding: 14px 16px;
    border-top: 2px solid #f59e0b;
    display: flex;
    gap: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f4f8 100%);
}

.chatbox-input {
    flex: 1;
    border: 2px solid #dbeafe;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.chatbox-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    background: #fefbf3;
}

.chatbox-send {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.chatbox-send:hover {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.chatbox-send:active {
    transform: scale(0.95);
}

.chatbox-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #e9ecef;
    border-radius: 12px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Navbar Chatbox Styles */
.chatbox-navbar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100000;
}

.chatbox-navbar-toggle {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.chatbox-navbar-toggle:hover {
    transform: translateY(2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatbox-navbar-container {
    position: absolute;
    top: 50px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.chatbox-navbar-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbox-widget {
        position: fixed;
        right: auto;
        left: 0;
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .chatbox-container {
        position: fixed;
        width: calc(100vw - 24px);
        left: 12px;
        right: auto;
        height: min(480px, calc(100vh - 140px));
        max-height: calc(100vh - 140px);
        bottom: 76px;
    }

    .message-content {
        max-width: 85%;
    }

    .chatbox-navbar-container {
        width: calc(100vw - 16px);
        max-width: 380px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .chatbox-widget {
        position: fixed;
        right: auto;
        left: 0;
        bottom: max(8px, env(safe-area-inset-bottom));
    }

    .chatbox-toggle {
        width: 50px;
        height: 50px;
    }

    .chatbox-container {
        position: fixed;
        width: calc(100vw - 16px);
        left: 8px;
        right: auto;
        height: min(420px, calc(100vh - 120px));
        max-height: calc(100vh - 120px);
        bottom: 64px;
    }

    .message-content {
        max-width: 90%;
        font-size: 13px;
    }

    .chatbox-faq {
        max-height: 100px;
    }

    .faq-btn {
        font-size: 12px;
        padding: 10px 12px;
        line-height: 1.3;
        min-height: 34px;
    }
}
