/* Nuisia Chatbot Styles */

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.chatbot-container.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.chatbot-container.minimized {
    height: 60px;
}

.chatbot-header {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%) !important;
    color: white !important;
    padding: 15px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 20px 20px 0 0 !important;
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 60px !important;
    z-index: 100 !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='white' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    border-radius: 20px 20px 0 0;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    position: relative;
    z-index: 1;
}

.chatbot-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.chatbot-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-info .status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.chatbot-info .status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chatbot-controls {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.chatbot-controls button {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.chatbot-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    min-height: 200px;
    gap: 15px;
    scroll-behavior: smooth;
    background: #fafafa;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlide 0.3s ease-out;
}

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

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e0e0e0;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.message-text a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.user-message .message-text a {
    color: white;
    text-decoration: underline;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

.chatbot-typing {
    padding: 0 20px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 12px;
    background: #fafafa;
}

.typing-indicator {
    display: flex;
    gap: 3px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chatbot-footer {
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

.chatbot-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chatbot-input-container input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4;
}

.chatbot-input-container input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

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

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    transform: translateY(-1px);
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    font-size: 24px;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
}

.chatbot-toggle.active {
    background: #666;
    transform: scale(0.9);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #F44336;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .quick-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #388E3C;
}

/* Animation for new messages */
.message.new-message {
    animation: messageSlide 0.3s ease-out;
}

/* Loading state */
.chatbot-container.loading .chatbot-messages {
    opacity: 0.7;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-container {
        background: #2d2d2d;
        border-color: rgba(76, 175, 80, 0.3);
    }
    
    .chatbot-messages {
        background: #1e1e1e;
    }
    
    .bot-message .message-content {
        background: #3d3d3d;
        color: #fff;
        border-color: #555;
    }
    
    .chatbot-footer {
        background: #2d2d2d;
        border-color: #555;
    }
    
    .chatbot-input-container input {
        background: #3d3d3d;
        border-color: #555;
        color: #fff;
    }
    
    .quick-btn {
        background: #3d3d3d;
        border-color: #555;
        color: #ccc;
    }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        width: 95vw;
        height: 85vh;
        right: 2.5vw;
        bottom: 2.5vh;
        max-width: 400px;
        left: auto;
        margin: 0;
    }
    
    .chatbot-messages {
        max-height: calc(85vh - 120px);
        min-height: 150px;
        padding: 15px;
    }
    
    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
    }
    
    .message {
        max-width: 90%;
        margin-bottom: 10px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: 100vw;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
    
    .chatbot-messages {
        max-height: calc(100vh - 120px);
        min-height: 200px;
        padding: 10px;
    }
    
    .chatbot-header {
        border-radius: 0;
    }
}

/* Chatbot Control Buttons */
.minimize-btn, .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 5px;
}

.minimize-btn:hover, .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}


/* Control buttons layout */
.chatbot-controls {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 11 !important;
}

.chatbot-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-info h4 {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
}

.chatbot-info .status {
    font-size: 12px !important;
    opacity: 0.9 !important;
    color: white !important;
}

/* Ensure close button is visible */
.close-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: white !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin-left: 5px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.3) !important;
    transform: scale(1.1) !important;
}
