/* Chatbot Widget Styles - Matching Batangas Website Theme */
:root {
    --primary: #003366;
    --accent: #ff7e00;
    --light-bg: #f8f9fa;
    --shadow-light: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-medium: 0 8px 25px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
    --gradient-primary: linear-gradient(135deg, #003366 0%, #004080 100%);
    --gradient-accent: linear-gradient(135deg, #ff7e00 0%, #ff9500 100%);
}

.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--gradient-accent);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-medium);
    animation: bounce 2s infinite;
}

.chatbot-toggle {
    width: 65px;
    height: 65px;
    background: var(--gradient-primary);
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
}

.chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0,51,102,0.4);
    border-color: var(--accent);
}

.chatbot-toggle:active {
    transform: translateY(-1px) scale(0.98);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    max-width: 400px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dee2e6;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chatbot-container.active {
    display: flex;
    width: 400px;
    height: auto;
    min-height: 500px;
    border-radius: 15px;
    transform: scale(1);
    opacity: 1;
}

.chatbot-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.chatbot-header-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.language-selector {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.lang-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.lang-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

.lang-btn.active {
    background: var(--gradient-accent);
    border-color: var(--accent);
}

.chatbot-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-close {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.chatbot-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--light-bg);
    position: relative;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.message {
    margin-bottom: 20px;
    animation: slideInMessage 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.message:hover .message-actions {
    opacity: 1;
    visibility: visible;
}

.message-actions {
    position: absolute;
    top: -10px;
    right: 0;
    display: flex;
    gap: 5px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.message-action-btn {
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-action-btn:hover {
    background: rgba(0,51,102,0.8);
    transform: scale(1.1);
}

.message.user {
    text-align: right;
}

.message.bot {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #ff7e00 0%, #ff9500 100%);
    color: white;
    border-bottom-right-radius: 6px;
    margin-left: auto;
    position: relative;
}

.message.user .message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -6px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent #ff9500 transparent;
}

.message.bot .message-bubble {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2c3e50;
    border: 1px solid #e8ecef;
    border-bottom-left-radius: 6px;
    position: relative;
}

.message.bot .message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -6px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    margin-right: 12px;
    margin-top: 5px;
    flex-shrink: 0;
    box-shadow: var(--shadow-light);
    border: 2px solid white;
}

.message.bot {
    display: flex;
    align-items: flex-start;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.chatbot-input-container {
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}





.chatbot-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background: white;
    font-family: inherit;
    color: var(--primary);
}

.chatbot-input::placeholder {
    color: #6c757d;
    font-weight: 400;
}

.chatbot-input:focus {
    border-color: #ff7e00;
    box-shadow: 0 0 0 3px rgba(255,126,0,0.1), 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.chatbot-send {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 8px;
}

.chatbot-send:hover {
    background: #e86d00;
    transform: translateY(-1px);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}



.suggestion-btn:hover {
    background: var(--gradient-accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.typing-indicator {
    display: none;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 500px;
        bottom: 80px;
        right: 10px;
        max-width: 350px;
    }
    
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-toggle {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .message-bubble {
        max-width: 90%;
    }

    .chatbot-header {
        padding: 15px 20px;
    }

    .language-selector {
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .chatbot-container.active {
        width: calc(100vw - 30px);
        max-height: calc(100vh - 100px);
        height: auto;
        min-height: 450px;
        right: 15px;
    }

    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .chatbot-messages {
        padding: 15px;
    }

    .suggestion-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .suggestion-btn {
        width: 100%;
        text-align: center;
    }
}