/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--meadow-600), var(--meadow-800));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(49, 174, 129, 0.3);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(49, 174, 129, 0.4);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(49, 174, 129, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(49, 174, 129, 0.5);
    }
    100% {
        box-shadow: 0 4px 20px rgba(49, 174, 129, 0.3);
    }
}

.chatbot-window {
    display: none;
    flex-direction: column;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 9999;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease-out;
    max-height: calc(100vh - 110px);
}

.chatbot-window.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--meadow-700), var(--meadow-900));
    color: white;
    padding: 20px;
    position: relative;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.chatbot-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chatbot-content {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

.chatbot-page {
    display: none;
    height: 100%;
    padding: 20px;
}

.chatbot-page.active {
    display: block;
}

.chatbot-navigation {
    display: flex;
    background: white;
    border-top: 1px solid #e9ecef;
}

.nav-item {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.nav-item:hover {
    background: #f8f9fa;
}

.nav-item.active {
    color: var(--meadow-600);
    background: #f0f9f5;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* Home Page Styles */
.quick-actions {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.quick-action {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-action:hover {
    background: #f0f9f5;
    border-color: var(--meadow-300);
    color: inherit;
    text-decoration: none;
}

.quick-action i {
    color: var(--meadow-600);
    font-size: 18px;
    width: 20px;
}

.quick-action-content h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.quick-action-content p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #6c757d;
}

.contact-info {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.contact-info h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.contact-item i {
    color: var(--meadow-600);
    width: 16px;
}

.contact-item a {
    color: var(--meadow-600);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Messages Page Styles */
.message-input-area {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 16px;
}

.message-input-area h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
}

.message-input:focus {
    outline: none;
    border-color: var(--meadow-600);
}

.send-message-btn {
    background: var(--meadow-600);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    align-self: flex-end;
}

.send-message-btn:hover {
    background: var(--meadow-700);
}

.recent-messages {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.recent-messages h4 {
    margin: 0;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
}

.message-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background 0.2s ease;
}

.message-item:hover {
    background: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.message-meta span {
    font-size: 12px;
    font-weight: 500;
    color: #212529;
}

.message-meta small {
    font-size: 11px;
    color: #6c757d;
}

.message-preview {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
}

/* Help Page Styles */
.search-help {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    font-size: 13px;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--meadow-600);
}

.help-topics {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.help-topics h4 {
    margin: 0;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
}

.help-topic {
    padding: 12px 16px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-topic:hover {
    background: #f8f9fa;
}

.help-topic:last-child {
    border-bottom: none;
}

.help-topic span {
    font-size: 13px;
    color: #212529;
}

.help-topic i {
    color: #6c757d;
    font-size: 12px;
}

/* Response Indicator */
.response-time {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.response-indicator {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.response-text {
    font-size: 12px;
    color: #6c757d;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chatbot-window {
        bottom: 90px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        height: 400px !important;
    }
    
    .chatbot-trigger {
        bottom: 15px !important;
        right: 15px !important;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        bottom: 80px;
        right: 5px;
        left: 5px;
        height: 350px;
    }
    
    .chatbot-trigger {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .blog-search-results {
        max-height: 200px;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 4px;
    }
}

/* Blog Search Styles */
.blog-search-container {
    margin-bottom: 20px;
}

.search-input-container {
    position: relative;
    margin-bottom: 10px;
}

.blog-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--meadow-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 174, 129, 0.1);
}

.blog-search-input::placeholder {
    color: #64748b;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--meadow-600);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: var(--meadow-700);
}

.blog-search-results {
    display: none;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results-header {
    padding: 12px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
}

.search-results-header h4 {
    margin: 0;
    font-size: 14px;
    color: #334155;
    font-weight: 600;
}

.blog-search-result {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.blog-search-result:hover {
    background: #f8fafc;
}

.blog-search-result:last-child {
    border-bottom: none;
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.result-header i {
    color: var(--meadow-600);
    font-size: 16px;
    margin-top: 2px;
    min-width: 16px;
}

.result-info {
    flex: 1;
}

.result-info h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.result-category {
    background: var(--meadow-100);
    color: var(--meadow-800);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.result-excerpt {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-loading, .search-error, .no-results {
    padding: 20px;
    text-align: center;
    color: #64748b;
}

.search-loading i {
    color: var(--meadow-600);
    margin-right: 8px;
}

.search-error {
    color: #dc2626;
}

.no-results {
    color: #64748b;
}

.no-results i {
    font-size: 24px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.no-results p {
    margin: 8px 0 4px 0;
    font-weight: 500;
    color: #475569;
}

.no-results small {
    color: #94a3b8;
}

/* Welcome Popup Bubble */
.chatbot-welcome-bubble {
    position: fixed;
    bottom: 100px;
    right: 30px;
    max-width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid var(--meadow-100);
}

.chatbot-welcome-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.welcome-content {
    padding: 20px;
    position: relative;
}

.welcome-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.welcome-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.welcome-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--meadow-500), var(--meadow-600));
    border-radius: 50%;
    margin: 0 auto 15px auto;
    color: white;
    font-size: 20px;
    animation: pulse-gentle 2s infinite;
}

@keyframes pulse-gentle {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(49, 174, 129, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(49, 174, 129, 0);
    }
}

.welcome-message h4 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.welcome-message p {
    margin: 0 0 15px 0;
    color: #64748b;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

.welcome-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.welcome-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.welcome-btn.primary {
    background: var(--meadow-600);
    color: white;
}

.welcome-btn.primary:hover {
    background: var(--meadow-700);
    transform: translateY(-1px);
}

.welcome-btn.secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.welcome-btn.secondary:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Speech bubble arrow pointing to chatbot */
.chatbot-welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--meadow-100);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Mobile responsiveness for welcome bubble */
@media (max-width: 768px) {
    .chatbot-welcome-bubble {
        right: 15px;
        bottom: 90px;
        max-width: calc(100vw - 30px);
    }
    
    .chatbot-welcome-bubble::after {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .chatbot-welcome-bubble {
        right: 10px;
        bottom: 85px;
        max-width: calc(100vw - 20px);
    }
    
    .welcome-buttons {
        flex-direction: column;
    }
    
    .welcome-btn {
        width: 100%;
    }
}