/* Enhanced PHUSA Chatbot Styles */
.phusa-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chatbot-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.chatbot-toggle:hover::before {
    left: 100%;
}

.chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.chatbot-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-icon i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover .chatbot-icon i {
    transform: rotate(15deg);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 1s infinite;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.status-dot.online {
    background: #2ed573;
}

.chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.chatbot-container.show {
    display: flex;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.bot-avatar i {
    font-size: 18px;
}

.title-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bot-name {
    font-size: 16px;
    font-weight: 600;
}

.bot-status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #2ed573;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.chatbot-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.chatbot-action-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.chatbot-action-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.chatbot-action-btn:active {
    transform: translateY(0) scale(0.95);
}

.chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
    color: white;
}

.message-content {
    flex: 1;
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.bot-message .message-content {
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    border-bottom-right-radius: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message-content p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
    line-height: 1.4;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.quick-questions {
    padding: 15px 20px;
    background: #f8f9ff;
    border-top: 1px solid #e0e0e0;
}

.quick-questions-header {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-questions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #333;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.quick-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.quick-btn i {
    font-size: 14px;
    opacity: 0.8;
}

.quick-btn.admin-chat-btn {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-color: transparent;
    justify-content: center;
    font-weight: 600;
}

.quick-btn.admin-chat-btn:hover {
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
    transform: translateY(-2px) scale(1.02);
}

.chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f8f9ff;
    border-radius: 25px;
    padding: 8px 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-input input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    padding: 8px 0;
}

.chatbot-input input::placeholder {
    color: #999;
}

.send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.send-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
    transform: translateY(0) scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #666;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #667eea;
    font-style: italic;
}

.typing-indicator i {
    font-size: 8px;
    animation: typingDots 1.4s infinite;
}

.typing-indicator i:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator i:nth-child(3) {
    animation-delay: 0.4s;
}

.input-suggestions {
    opacity: 0.7;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes typingDots {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .phusa-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 70px;
    }
    
    .quick-questions-grid {
        grid-template-columns: 1fr;
    }
    
    .chatbot-toggle {
        padding: 12px 16px;
    }
    
    .chatbot-text {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-container {
        background: #1a1a1a;
        border-color: rgba(102, 126, 234, 0.3);
    }
    
    .chatbot-messages {
        background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    }
    
    .message-content {
        background: #2a2a2a;
        color: #fff;
    }
    
    .quick-questions {
        background: #2a2a2a;
    }
    
    .quick-btn {
        background: #2a2a2a;
        color: #fff;
        border-color: #444;
    }
    
    .input-wrapper {
        background: #2a2a2a;
    }
    
    .chatbot-input input {
        color: #fff;
    }
    
    .chatbot-input input::placeholder {
        color: #999;
    }
}




