/* Chatbot CSS - Clean Professional Design */

/* Font Awesome Icons - Define if not available */
.fa-comments::before, .fas.fa-comments::before { content: "\f086"; }
.fa-times::before, .fas.fa-times::before { content: "\f00d"; }
.fa-check-circle::before, .fas.fa-check-circle::before { content: "\f058"; }

/* Ensure chatbot stays at bottom */
body {
    margin: 0 !important;
    padding: 0 !important;
}

html, body {
    height: 100% !important;
}

.chatbot-container {
    position: fixed !important;
    bottom: 0 !important;
    right: 68px;
    z-index: 999999 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
}

.chatbot-toggle {
    width: auto;
    height: 35px;
    background: linear-gradient(135deg, #0066cc 0%, #00004a 100%);
    border-radius: 6px 0 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 8px rgba(0,0,74,0.3);
    transition: all 0.3s ease;
    border: none;
    padding: 0 12px;
    min-width: 140px;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 -4px 12px rgba(0,0,74,0.4);
}

.chatbot-toggle.attention {
    animation: attention 0.8s ease-in-out 2;
}

@keyframes attention {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    75% { transform: translateY(-2px); }
}

.chatbot-toggle-text {
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

.chatbot-toggle i {
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.chatbot-toggle.active i.fa-comments {
    display: none;
}

.chatbot-toggle.active i.fa-times {
    display: block;
}

.chatbot-toggle i.fa-times {
    display: none;
}

.chatbot-window {
    position: absolute !important;
    bottom: 35px !important;
    right: 0 !important;
    width: 300px;
    max-width: 300px;
    height: 420px;
    max-height: 420px;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.chatbot-window.show {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.chatbot-header {
    background: linear-gradient(135deg, #0066cc 0%, #00004a 100%);
    color: #ffffff;
    padding: 15px;
    text-align: center;
    position: relative;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.chatbot-header p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #ffffff;
    opacity: 1;
}

.chatbot-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.chatbot-content::-webkit-scrollbar {
    width: 4px;
}

.chatbot-content::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.chatbot-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #ffffff;
    color: #2c3e50;
}

.form-group input::placeholder {
    color: #7f8c8d;
    opacity: 1;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.submit-btn {
    background: linear-gradient(135deg, #0066cc 0%, #00004a 100%);
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,102,204,0.3);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.success-message {
    text-align: center;
    padding: 30px;
    color: #27ae60;
}

.success-message i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.success-message h4 {
    margin: 0 0 10px 0;
    color: #27ae60;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    background: #fdf2f2;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #fbc2c2;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-action {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #bbdefb;
}

.quick-action:hover {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .chatbot-window {
        width: 280px;
        height: 380px;
        max-height: calc(100vh - 120px);
    }
    
    .chatbot-content {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        right: 20px !important;
        bottom: 0 !important;
    }
    
    .chatbot-toggle {
        min-width: 100px;
        height: 28px;
        padding: 0 8px;
        font-size: 10px;
    }
    
    .chatbot-toggle-text {
        font-size: 10px;
    }
    
    .chatbot-toggle i {
        font-size: 11px;
    }
    
    .chatbot-window {
        width: 250px;
        height: 320px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 100px);
        bottom: 28px !important;
        right: 0 !important;
    }
    
    .chatbot-header {
        padding: 10px;
    }
    
    .chatbot-header h3 {
        font-size: 14px;
    }
    
    .chatbot-header p {
        font-size: 10px;
    }
    
    .chatbot-content {
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .form-group {
        gap: 3px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px;
        font-size: 12px;
    }
    
    .form-group textarea {
        min-height: 60px;
    }
    
    .submit-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .quick-actions {
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .quick-action {
        padding: 6px 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        right: 15px !important;
        bottom: 0 !important;
    }
    
    .chatbot-toggle {
        min-width: 90px;
        height: 26px;
        padding: 0 6px;
        font-size: 9px;
    }
    
    .chatbot-toggle-text {
        font-size: 9px;
    }
    
    .chatbot-toggle i {
        font-size: 10px;
    }
    
    .chatbot-window {
        width: 220px;
        height: 280px;
        max-width: calc(100vw - 15px);
        max-height: calc(100vh - 80px);
        bottom: 26px !important;
        right: 0 !important;
    }
    
    .chatbot-header {
        padding: 8px;
    }
    
    .chatbot-header h3 {
        font-size: 12px;
    }
    
    .chatbot-header p {
        font-size: 9px;
    }
    
    .chatbot-content {
        padding: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .form-group {
        gap: 2px;
    }
    
    .form-group label {
        font-size: 11px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 6px;
        font-size: 11px;
    }
    
    .form-group textarea {
        min-height: 50px;
    }
    
    .submit-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .quick-actions {
        gap: 4px;
        margin-bottom: 12px;
    }
    
    .quick-action {
        padding: 4px 8px;
        font-size: 9px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .chatbot-container {
        right: 10px !important;
        bottom: 0 !important;
    }
    
    .chatbot-toggle {
        min-width: 80px;
        height: 24px;
        padding: 0 4px;
        font-size: 8px;
    }
    
    .chatbot-toggle-text {
        font-size: 8px;
    }
    
    .chatbot-window {
        width: 200px;
        height: 250px;
        max-width: calc(100vw - 10px);
        max-height: calc(100vh - 60px);
        bottom: 24px !important;
        right: 0 !important;
    }
    
    .chatbot-header {
        padding: 6px;
    }
    
    .chatbot-header h3 {
        font-size: 11px;
    }
    
    .chatbot-header p {
        font-size: 8px;
    }
    
    .chatbot-content {
        padding: 8px;
    }
    
    .form-group label {
        font-size: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 4px;
        font-size: 10px;
    }
    
    .form-group textarea {
        min-height: 40px;
    }
    
    .submit-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .quick-action {
        padding: 3px 6px;
        font-size: 8px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
