:root {
    --primary-green: #28a745;
    --neon-green: #39FF14;
    --bg-dark: rgba(13, 22, 15, 0.95);
    --panel-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-main: #e0e0e0;
}



/* Futuristic Chat Bubbles */
.ai-bubble, .bg-success {
    background: linear-gradient(135deg, #1e4d2b 0%, #14331d 100%) !important;
    border: 1px solid rgba(57, 255, 20, 0.2) !important;
    border-radius: 15px 15px 15px 2px !important;
}

.bg-dark {
    background: var(--panel-glass) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 15px 15px 2px 15px !important;
}



.listening-ring {
    border: 3px solid var(--neon-green);
    border-radius: 50%;
    padding: 20px;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(57, 255, 20, 0); }
    100% { transform: scale(0.8); }
}

/* Fixed Typing Position */
#typingIndicator {
    order: 9999; /* Ensures it stays at the very bottom of the flex container */
    background: var(--panel-glass);
    border: 1px solid var(--border-glass);
    margin-top: 10px;
}





/* Background Blur/Overlay */
.modal-overlay {
    position: fixed;
    /* Use inset for full coverage */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Use dvh (Dynamic Viewport Height) for modern mobile browsers */
    inset: 0; 
    width: 100vw;
    background: var(--bg-dark);
    z-index: 99999; /* Ensure it's above everything */
    display: none; 
    flex-direction: column;
    backdrop-filter: blur(15px);
    background: radial-gradient(circle at center, rgba(40, 167, 69, 0.15) 0%, var(--bg-dark) 100%);
}

/* Modal Content Container */
.modal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
     min-height: 0;   /* 🔥 VERY IMPORTANT */
    position: relative;
    
}

/* Header Styles */
.modal-header {
     background: var(--panel-glass);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title span {
     color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    font-weight: bold;
}

.exit-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.exit-btn:hover { color: #ef4444; }

/* Body Styles */
.modal-body {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;   /* 🔥 Prevents overflow pushing footer */
}

.ai-bubble {
    background: var(--panel-dark);
    padding: 1rem;
    border-radius: 10px;
    max-width: 80%;
    border: 1px solid var(--border-color);
    color: var(--text-white);
}

/* Footer / Input Area */
.modal-footer {
    position: relative;
    z-index: 100; /* Higher than voice overlay */
    padding: 1rem;
    background: #82b440;
    border-top: 1px solid var(--border-color);
    /* Keeps input visible above keyboard on some mobile browsers */
    padding-bottom: env(safe-area-inset-bottom);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;          /* ✅ IMPORTANT */
}

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    background: #82b440;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: white !important;
}

#sbform {
    display: flex;
    width: 100%;
}

.icon-btn,
.send-btn {
    flex-shrink: 0;   /* prevents buttons from shrinking */
}

.message-content p {
    color: white !important;
}

.send-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 5px;
    cursor: pointer;
}

/* Voice Overlay */
.hidden { display: none !important; }
.voice-overlay {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85) !important;
}

.chat-content-text p {
    margin-bottom: 8px;
}
.chat-content-text p:last-child {
    margin-bottom: 0;
}
.chat-content-text ul, .chat-content-text ol {
    padding-left: 20px;
    margin-bottom: 8px;
}
.chat-content-text strong {
    color: #60a5fa; /* Light blue for bold text to make it pop */
}

.voice-overlay {
    position: absolute;
    bottom: 0; /* Align to bottom of container */
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(11, 17, 32, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50; /* Lower than footer */
    overflow: hidden;
}

.voice-overlay.active {
    height: calc(100% - 70px); /* Fill page but leave header/footer visible */
    bottom: 70px; /* Offset by footer height */
}

.btn-danger {
    background: #ef4444 !important;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Pulse animation for mic */
.wave-animation {
    width: 80px;
    height: 80px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.typing {
    display: inline-flex;
    gap: 6px;
    padding: 10px 14px;
    background: #f1f1f1;
    border-radius: 20px;
    width: fit-content;
    margin: 10px 0;
}

.typing span {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    animation: breathe 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: 0s; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes breathe {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.hidden {
    display: none;
}

.floating-ai-btn {
    position: fixed;
    left: 20px;
    bottom: 40px; /* change to top if you prefer */
    
    width: 70px;
    height: 70px;
    border-radius: 50%;
    
    background-color: #28a745; /* nice green */
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    z-index: 9999;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Floating AI Label */
.ai-chat-label {
    position: fixed;
    left: 100px; /* distance from button */
    bottom: 55px; /* align with button */
    
    background: rgba(13, 22, 15, 0.95);
    backdrop-filter: blur(10px);
    
    color: var(--neon-green);
    font-size: 0.9rem;
    padding: 5px 16px;
    border-radius: 30px;
    
    border: 1px solid var(--border-glass);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
    
    white-space: nowrap;
    z-index: 9998;

    animation: floatLabel 3s ease-in-out infinite;
}

/* Subtle floating animation */
@keyframes floatLabel {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

.floating-ai-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

/* GIF separation layer */
.gif-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 50%;

    background: white; /* separation contrast */
    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.gif-wrapper img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.floating-ai-btn {
    animation: pulse 2s infinite;
}

.fly-to-modal {
    position: fixed;
    z-index: 10100;
    transition: all 0.6s ease-in-out;
    pointer-events: none;
}


/* ========================= */
/* MODAL SCROLLBAR DESIGN   */
/* ========================= */

.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--primary-green),
        var(--neon-green)
    );
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
    transition: all 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 1);
}

/* Firefox Support */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) rgba(255, 255, 255, 0.05);
}
.fly-to-modal{
z-index: 99999; /* Ensure it's above everything */
}