/* Chat Button */
#chat-toggle-btn {
    position: fixed;
    bottom: 80px;
    right: 18px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006400 0%, #228b22 100%);
    border: 3px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0,100,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;

}

#chat-toggle-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 30px rgba(0,100,0,0.6);
}

#chat-toggle-btn.active {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    bottom: 30px;
    transform: scale(0.9);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(255,0,0,0.3);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    /* 100% { transform: scale(1); } */
}

/* Chat Container - Desktop */
#agri-chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 650px;
    max-height: calc(100vh - 140px);
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.15),
        0 0 0 1px rgba(0,100,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

#agri-chatbot-container.show {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

#chatbot-header {
    background: linear-gradient(135deg, #006400 0%, #228b22 50%, #32a852 100%);
    color: white;
    padding: 24px 20px;
    font-weight: 700;
    text-align: center;
    border-bottom: none;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,100,0,0.2);
}

#chatbot-header h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#chatbot-header p {
    margin: 8px 0 0 0;
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.3;
    font-weight: 400;
}

.minimize-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.minimize-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.chat-restored-indicator {
    text-align: center;
    padding: 8px;
    background: #e8f5e8;
    color: #006400;
    font-size: 12px;
    border-bottom: 1px solid #d4edda;
    flex-shrink: 0;
}

#chatbot-messages {
    padding: 24px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0,100,0,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34,139,34,0.03) 0%, transparent 50%),
        #fafafa;
    min-height: 0;
}

.message {
    padding: 16px 20px;
    border-radius: 22px;
    max-width: 82%;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    animation: messageSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-message {
    background: linear-gradient(135deg, #dcf8c6 0%, #c8f7c5 100%);
    align-self: flex-end;
    border-bottom-right-radius: 8px;
    border: 1px solid #b8f5b1;
    margin-left: 18%;
}

.bot-message {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    align-self: flex-start;
    border-bottom-left-radius: 8px;
    border: 1px solid #e8f5e8;
    margin-right: 18%;
    position: relative;
}

.bot-message::before {
    content: '🌱';
    position: absolute;
    left: -30px;
    top: 12px;
    font-size: 16px;
    opacity: 0.7;
}

/* Enhanced formatting for bot messages */
.bot-message h1, .bot-message h2, .bot-message h3, .bot-message h4 {
    color: #006400;
    margin: 0 0 12px 0;
    line-height: 1.3;
    font-weight: 700;
}

.bot-message h1 { font-size: 18px; }
.bot-message h2 { font-size: 17px; }
.bot-message h3 { font-size: 16px; }
.bot-message h4 { font-size: 15px; }

.bot-message ul, .bot-message ol {
    margin: 12px 0;
    padding-left: 24px;
}

.bot-message li {
    margin: 10px 0;
    line-height: 1.5;
    padding-left: 8px;
}

.bot-message li::marker {
    color: #006400;
    font-weight: bold;
}

.bot-message strong {
    color: #006400;
    font-weight: 700;
}

.bot-message em {
    color: #555;
    font-style: italic;
}

.bot-message a {
    color: #006400;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.bot-message a:hover {
    color: #228b22;
    border-bottom-color: #228b22;
}

/* Contact Info Card */

.contact-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 16px;
    padding: 18px;
    margin: 15px 0;
    border-left: 5px solid #006400;
    box-shadow: 0 4px 15px rgba(0,100,0,0.1);
}

.contact-info h5 {
    margin: 0 0 12px 0;
    color: #006400;
    font-size: 15px;
    font-weight: 700;
}

.contact-info p {
    margin: 6px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-info p::before {
    content: '•';
    color: #006400;
    font-weight: bold;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid #e8f5e8;
    box-shadow: 0 2px 8px rgba(0,100,0,0.1);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,100,0,0.15);
}

.product-title {
    color: #006400;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

.product-price {
    color: #228b22;
    font-weight: 600;
    font-size: 14px;
}

.product-features {
    font-size: 13px;
    color: #555;
    margin-top: 8px;
}

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

.typing-progress {
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #006400, #228b22);
    width: 0%;
    transition: width 0.3s ease;
}

/* Follow-up suggestions */
.follow-up-suggestions {
    margin: 10px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 12px;
    border-left: 4px solid #006400;
}

.suggestions-header {
    font-weight: 600;
    color: #006400;
    margin-bottom: 8px;
    font-size: 14px;
}

.suggestion-item {
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.suggestion-item:hover {
    background: #006400;
    color: white;
    transform: translateX(5px);
}

/* Collection flow enhancements */
.collection-prompt {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border-left: 5px solid #ffc107 !important;
    border: 1px solid #ffeaa7 !important;
}

.collection-message {
    animation: gentleGlow 2s ease-in-out;
}

@keyframes gentleGlow {
    0%, 100% { 
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    }
    50% { 
        box-shadow: 0 4px 20px rgba(255,193,7,0.3);
    }
}

@keyframes pulse-gentle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Typing indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e8f5e8;
    border-radius: 22px;
    border-bottom-left-radius: 8px;
    padding: 16px 20px;
    max-width: 85%;
    margin: 0 20px 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.typing-dots {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006400 0%, #228b22 100%);
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #006400;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% { 
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% { 
        opacity: 1;
        transform: scale(1.2);
    }
}


#chatbot-input-container {
    display: flex;
    border-top: 1px solid #e8f5e8;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 20px;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
}

#chatbot-input {
    flex-grow: 1;
    border: 2px solid #e8f5e8;
    border-radius: 25px;
    padding: 14px 20px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
    min-width: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,100,0,0.05);
}

#chatbot-input:focus {
    border-color: #006400;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,100,0,0.1);
}

#chatbot-input::placeholder {
    color: #999;
    font-style: italic;
}

#chatbot-send {
    background: linear-gradient(135deg, #006400 0%, #228b22 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,100,0,0.3);
}

#chatbot-send:hover {
    background: linear-gradient(135deg, #005000 0%, #1e7d1e 100%);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0,100,0,0.4);
}

#chatbot-send:active {
    transform: scale(0.95);
}

#chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Scrollbar styling */
#chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #006400 0%, #228b22 100%);
    border-radius: 4px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #005000 0%, #1e7d1e 100%);
}

/* Voice recording button */
#voice-record-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}

#voice-record-btn:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #e0841b 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

#voice-record-btn.recording {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    animation: recordingPulse 1.5s infinite;
    transform: scale(1.05);
}

#voice-record-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.voice-icon {
    font-size: 20px;
}

/* Voice recording indicator */
.voice-recording-indicator {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
}

.recording-animation {
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(220,53,69,0.4);
    }
    50% { 
        box-shadow: 0 4px 25px rgba(220,53,69,0.8);
    }
}

/* Voice intro message */
.voice-intro {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
}

.voice-intro p {
    margin: 0;
    font-size: 13px;
    color: #1565c0;
}

.voice-intro strong {
    color: #0d47a1;
}

/* Audio player styles */
.audio-message {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
}

.audio-message audio {
    width: 100%;
    height: 40px;
    border-radius: 20px;
}

.audio-message .transcript {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    padding: 8px;
    background: white;
    border-radius: 5px;
    border-left: 3px solid #006400;
}

/* Voice message status */
.voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.voice-status.recording {
    color: #dc3545;
}

.voice-status.processing {
    color: #ffc107;
}

.voice-status.success {
    color: #28a745;
}

/* Update input container for voice button */
#chatbot-input-container {
    display: flex;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    padding: 15px;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

#chatbot-input {
    flex-grow: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 12px 18px;
    font-size: 16px;
    outline: none;
    background-color: #f8f9fa;
    min-width: 0;
    margin: 0;
}

/* Success Messages */
.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border-left: 5px solid #28a745 !important;
    border: 1px solid #c3e6cb !important;
}

/* Error Messages */
.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
    border-left: 5px solid #dc3545 !important;
    border: 1px solid #f5c6cb !important;
}

/* Mobile adjustments for voice features */
@media (max-width: 768px) {
    #voice-record-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .voice-icon {
        font-size: 18px;
    }
    
    .voice-recording-indicator {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    #chatbot-input-container {
        padding: 12px;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    #voice-record-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .voice-icon {
        font-size: 16px;
    }
    
    .voice-recording-indicator {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #chatbot-input-container {
        padding: 10px;
        gap: 5px;
    }
}

/* Dark mode support for voice features */
@media (prefers-color-scheme: dark) {
    .voice-intro {
        background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
        border-color: #4a5568;
        color: #bee3f8;
    }
    
    .audio-message {
        background-color: #3d3d3d;
        border-color: #555;
    }
    
    .audio-message .transcript {
        background-color: #2d2d2d;
        color: #ccc;
        border-left-color: #228b22;
    }
}

/* Accessibility improvements */
#voice-record-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Voice permission prompt */
.voice-permission-prompt {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
}

.voice-permission-prompt p {
    margin: 0;
    font-size: 13px;
    color: #856404;
}

.voice-permission-btn {
    background: #ffc107;
    color: #856404;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin-top: 5px;
    cursor: pointer;
    font-size: 12px;
}

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    #agri-chatbot-container {
        width: 350px;
        height: 550px;
        right: 20px;
        bottom: 90px;
    }

    #chat-toggle-btn {
        right: 16px;
        bottom: 90px;
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    #agri-chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
        right: 20px;
        bottom: 80px;
        border-radius: 20px;
    }

    #chat-toggle-btn {
        right: 20px;
        bottom: 90px;
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    #chat-toggle-btn.active {
        bottom: 20px;
    }

    #chatbot-header {
        padding: 15px;
    }

    #chatbot-header h3 {
        font-size: 16px;
        margin-right: 35px;
    }

    #chatbot-header p {
        font-size: 11px;
    }

    .minimize-btn {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    #chatbot-messages {
        padding: 15px;
        gap: 12px;
    }

    .message {
        max-width: 88%;
        font-size: 14px;
    }

    .bot-message::before {
        left: -25px;
        font-size: 14px;
    }

    .bot-message h4 {
        font-size: 15px;
    }

    #chatbot-input-container {
        padding: 12px;
        gap: 8px;
    }

    #chatbot-input {
        padding: 10px 16px;
        font-size: 16px;
        border-radius: 18px;
    }

    #chatbot-send {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .typing-indicator {
        margin: 0 15px 12px 15px;
        padding: 10px 14px;
        background: #f8f9fa;
        border-radius: 18px;
        align-items: center;
        display: none;
    }
}

/* Small Mobile Styles (max-width: 480px) */
@media (max-width: 480px) {
    #agri-chatbot-container {
        width: calc(70vw - 5px);
        height: calc(75vh - 75px);
        right: 5px;
        bottom: 70px;
        border-radius: 12px;
    }

    #chat-toggle-btn {
        right: 18px;
        bottom: 90px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    #chatbot-header {
        padding: 12px;
    }

    #chatbot-header h3 {
        font-size: 15px;
        margin-right: 30px;
    }

    #chatbot-header p {
        font-size: 10px;
    }

    .minimize-btn {
        top: 10px;
        right: 10px;
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    #chatbot-messages {
        padding: 12px;
        gap: 10px;
    }

    .message {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 16px;
        max-width: 92%;
    }

    .bot-message h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .bot-message ul {
        padding-left: 16px;
    }

    .bot-message li {
        margin: 6px 0;
    }

    .contact-info {
        padding: 10px;
        margin: 8px 0;
    }

    .contact-info h5 {
        font-size: 13px;
    }

    .contact-info p {
        font-size: 12px;
    }

    #chatbot-input-container {
        padding: 10px;
        gap: 6px;
    }

    #chatbot-input {
        padding: 8px 14px;
        font-size: 15px;
        border-radius: 16px;
    }

    #chatbot-send {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .typing-indicator {
        margin: 0 12px 10px 12px;
        padding: 8px 12px;
    }

    .typing-dot {
        width: 5px;
        height: 5px;
    }
}

/* Extra Small Mobile (max-width: 320px) */
@media (max-width: 320px) {
    #agri-chatbot-container {
        width: calc(60vw - 8px);
        height: calc(70vh - 90px);
        right: 4px;
        bottom: 65px;
        border-radius: 10px;
    }

    #chat-toggle-btn {
        right: 20px;
        bottom: 90px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    #chatbot-header {
        padding: 10px;
    }

    #chatbot-header h3 {
        font-size: 14px;
        margin-right: 28px;
    }

    #chatbot-header p {
        font-size: 9px;
    }

    .minimize-btn {
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    #chatbot-messages {
        padding: 10px;
        gap: 8px;
    }

    .message {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 14px;
    }

    .bot-message h4 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    #chatbot-input-container {
        padding: 8px;
        gap: 5px;
    }

    #chatbot-input {
        padding: 6px 12px;
        font-size: 14px;
        border-radius: 14px;
    }

    #chatbot-send {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #agri-chatbot-container {
        height: calc(100vh - 80px);
        bottom: 60px;
    }

    #chat-toggle-btn {
        bottom: 15px;
    }

    #chat-toggle-btn.active {
        bottom: 15px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #chat-toggle-btn {
        box-shadow: 0 2px 10px rgba(0,100,0,0.3);
    }

    #agri-chatbot-container {
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #agri-chatbot-container {
        background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
        color: #ffffff;
    }

    #chatbot-messages {
        background: 
            radial-gradient(circle at 20% 80%, rgba(0,100,0,0.1) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(34,139,34,0.1) 0%, transparent 50%),
            #1a1a1a;
    }

    .bot-message {
        background: linear-gradient(135deg, #3d3d3d 0%, #2d2d2d 100%);
        border-color: #404040;
        color: #ffffff;
    }

    .user-message {
        background: linear-gradient(135deg, #4a6741 0%, #5a7850 100%);
        border-color: #6a8860;
    }

    #chatbot-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }

    #chatbot-input:focus {
        border-color: #228b22;
        background: #3d3d3d;
    }

    #chatbot-input::placeholder {
        color: #aaa;
    }

    .contact-info {
        background-color: #3d3d3d;
        border-left-color: #228b22;
    }

    .chat-restored-indicator {
        background-color: #2d4a2d;
        color: #90c690;
        border-bottom-color: #456745;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .notification-badge {
        animation: none;
    }

    .typing-dot {
        animation: none;
        opacity: 0.6;
    }
}

/* Focus states for accessibility */
#chat-toggle-btn:focus-visible,
.minimize-btn:focus-visible,
#chatbot-send:focus-visible,
#voice-record-btn:focus-visible {
    outline: 3px solid #006400;
    outline-offset: 2px;
}

#chatbot-input:focus-visible {
    outline: 3px solid #006400;
    outline-offset: 1px;
}