/* ============================================
   AGRICULTURE NOVEL AI CHATBOT STYLES
   Glassmorphism Design - Sticky Bottom Center
============================================ */

* {
    box-sizing: border-box;
}

/* ============================================
   FLOATING TOGGLE BUTTON - BOTTOM CENTER
============================================ */
.agnc-chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.agnc-chat-toggle-btn:hover {
    transform: translateX(-50%) translateY(-4px);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: rgba(5, 150, 105, 0.95);
}

.agnc-chat-toggle-btn:active {
    transform: translateX(-50%) translateY(-2px);
}

.agnc-chat-toggle-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* ============================================
   CHAT CONTAINER - GLASSMORPHISM
============================================ */
.agnc-chat-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 450px;
    max-width: calc(100vw - 40px);
    height: 650px;
    max-height: calc(100vh - 40px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.agnc-chat-container.active {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.agnc-chat-container.minimized {
    height: 70px;
    overflow: hidden;
}

/* ============================================
   HEADER - GLASSMORPHISM
============================================ */
.agnc-chat-header {
    background: linear-gradient(135deg, 
                rgba(16, 185, 129, 0.95) 0%, 
                rgba(5, 150, 105, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.agnc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agnc-header-icon {
    font-size: 24px;
}

.agnc-header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.agnc-user-info {
    font-size: 12px;
    opacity: 0.95;
    margin-top: 3px;
    font-weight: 400;
}

.agnc-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agnc-google-signin-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #059669;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.agnc-google-signin-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.agnc-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 600;
}

.agnc-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ============================================
   MESSAGES AREA
============================================ */
.agnc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, 
                rgba(249, 250, 251, 0.8) 0%, 
                rgba(243, 244, 246, 0.8) 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.agnc-chat-container.minimized .agnc-chat-messages {
    display: none;
}

/* Custom Scrollbar */
.agnc-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.agnc-chat-messages::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 10px;
}

.agnc-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.6);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.agnc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
    background-clip: padding-box;
}

/* Message Styles */
.agnc-message {
    animation: agnc-fadeInUp 0.4s ease;
}

@keyframes agnc-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agnc-message.user {
    display: flex;
    justify-content: flex-end;
}

.agnc-message.assistant {
    display: flex;
    justify-content: flex-start;
}

.agnc-message-content {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
    position: relative;
}

.agnc-message.user .agnc-message-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.agnc-message.assistant .agnc-message-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    color: #1f2937;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Typing Indicator */
.agnc-typing-indicator {
    display: flex;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.agnc-typing-dot {
    width: 10px;
    height: 10px;
    background: #9ca3af;
    border-radius: 50%;
    animation: agnc-typingBounce 1.4s infinite;
}

.agnc-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.agnc-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes agnc-typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Article Cards */
.agnc-article-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.agnc-article-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.agnc-article-card:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.agnc-article-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.4;
}

.agnc-article-card-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* ============================================
   INPUT AREA - GLASSMORPHISM
============================================ */
.agnc-chat-input-area {
    padding: 16px 20px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(229, 231, 235, 0.6);
    flex-shrink: 0;
}

.agnc-chat-container.minimized .agnc-chat-input-area {
    display: none;
}

/* Suggestions */
.agnc-suggestions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    animation: agnc-fadeIn 0.5s ease;
}

@keyframes agnc-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.agnc-suggestion-chip {
    background: rgba(243, 244, 246, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
    font-weight: 500;
}

.agnc-suggestion-chip:hover {
    background: rgba(220, 252, 231, 0.9);
    border-color: rgba(16, 185, 129, 0.6);
    color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
}

/* Input Wrapper */
.agnc-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.agnc-language-select {
    padding: 11px 12px;
    border: 2px solid rgba(229, 231, 235, 0.8);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    font-weight: 500;
    color: #374151;
}

.agnc-language-select:focus {
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.agnc-input-container {
    flex: 1;
    position: relative;
}

.agnc-chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(229, 231, 235, 0.8);
    border-radius: 14px;
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
    max-height: 120px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    color: #1f2937;
}

.agnc-chat-input:focus {
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.agnc-chat-input::placeholder {
    color: #9ca3af;
}

.agnc-send-btn {
    padding: 12px 22px;
    background: linear-gradient(135deg, 
                rgba(16, 185, 129, 0.95) 0%, 
                rgba(5, 150, 105, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.agnc-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, 
                rgba(5, 150, 105, 0.95) 0%, 
                rgba(4, 120, 87, 0.95) 100%);
}

.agnc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TOAST NOTIFICATIONS
============================================ */
.agnc-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.agnc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

/* ============================================
   MOBILE RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .agnc-chat-toggle-btn {
        bottom: 15px;
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .agnc-chat-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 30px);
        bottom: 15px;
        border-radius: 20px;
    }
    
    .agnc-message-content {
        max-width: 85%;
        font-size: 14px;
    }
    
    .agnc-header-title {
        font-size: 16px;
    }
    
    .agnc-google-signin-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .agnc-suggestion-chip {
        font-size: 12px;
        padding: 8px 14px;
    }
    
    .agnc-article-card {
        padding: 12px;
    }
    
    .agnc-toast {
        bottom: 85px;
        font-size: 13px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .agnc-chat-toggle-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .agnc-header-controls {
        gap: 6px;
    }
    
    .agnc-header-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .agnc-input-wrapper {
        gap: 8px;
    }
    
    .agnc-send-btn {
        padding: 11px 18px;
        font-size: 14px;
    }
}

