/* ──────────────────────────────────────────────────────────────
   AI CHAT WIDGET (HILLARY) - GREEN THEME
   Colors: Green #00d30b, Dark Green #197e00, Navy #1e2a4a
   ────────────────────────────────────────────────────────────── */

/* Widget toggle button — fixed bottom-center, always visible */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

.ai-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, #004e04, #197e00);
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 211, 11, 0.45);
    transition: transform .3s ease, box-shadow .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-chat-btn i {
    font-size: 24px;
    color: #fff;
    transition: transform .35s cubic-bezier(.68,-.55,.265,1.55);
}

.ai-chat-btn.open i {
    transform: rotate(90deg);
}

.ai-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(0, 211, 11, 0.55);
}

.ai-chat-btn .ai-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-sm);
    background: rgba(0, 211, 11, 0.35);
    animation: ai-pulse 2.2s infinite;
    z-index: -1;
}

@keyframes ai-pulse {
    0%   { transform: scale(1);   opacity: .65; }
    100% { transform: scale(1.6); opacity: 0;   }
}

/* ── Full-window overlay panel ── */
.ai-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.ai-chat-overlay.open {
    pointer-events: all;
}

/* Backdrop dimmer - using navy with transparency */
.ai-chat-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 42, 74, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .35s ease;
}

.ai-chat-overlay.open .ai-chat-backdrop {
    opacity: 1;
}

/* Chat panel — slides up from bottom, fills full window */
.ai-chat-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    border-radius: 0;
}

.ai-chat-overlay.open .ai-chat-panel {
    transform: translateY(0);
}

/* Header - using green gradient */
.ai-chat-header {
    background: linear-gradient(135deg, #00d30b 0%, #197e00 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.ai-chat-header .ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.2);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ai-chat-header .ai-header-text h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: .01em;
}

.ai-chat-header .ai-header-text p {
    font-size: .78rem;
    opacity: .85;
    margin: 0;
    color: #fff;
}

.ai-chat-header .ai-close-btn {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: background .2s;
    flex-shrink: 0;
}

.ai-chat-header .ai-close-btn:hover {
    background: rgba(255,255,255,.3);
}

/* Messages area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.ai-chat-messages::-webkit-scrollbar { width: 6px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* Message bubbles */
.ai-msg {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: .92rem;
    line-height: 1.6;
    animation: ai-msgIn .3s ease;
    word-wrap: break-word;
}

@keyframes ai-msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #00d30b, #197e00);
    color: #fff;
    border-bottom-right-radius: var(--border-radius-sm);
    box-shadow: 0 2px 10px rgba(0, 211, 11, .3);
}

.ai-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.ai-msg-bot pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: .8rem;
}

.ai-msg-bot code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: .85em;
}

.ai-msg-bot a {
    color: #00d30b;
    text-decoration: none;
}

.ai-msg-bot a:hover {
    text-decoration: underline;
}

.ai-msg-sources {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: .74rem;
    color: #64748b;
}

.ai-msg-sources a { 
    color: #00d30b; 
    text-decoration: none;
}

/* Typing indicator */
.ai-typing {
    display: none;
    align-self: flex-start;
    background: #fff;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    max-width: 860px;
    width: fit-content;
    margin: 0 20px;
}

.ai-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    margin: 0 2px;
    animation: ai-bounce 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes ai-bounce {
    0%, 80%, 100% { transform: scale(.55); opacity: .5; }
    40%            { transform: scale(1);   opacity: 1; }
}

/* Input area */
.ai-chat-input-wrap {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 14px 20px;
    flex-shrink: 0;
}

.ai-chat-input-inner {
    display: flex;
    gap: 10px;
    max-width: 820px;
    margin: 0 auto;
}

.ai-chat-input-inner input {
    flex: 1;
    padding: 11px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    font-size: .92rem;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color .2s, box-shadow .2s;
}

.ai-chat-input-inner input:focus {
    border-color: #00d30b;
    box-shadow: 0 0 0 3px rgba(0, 211, 11, .12);
    background: #fff;
}

.ai-chat-input-inner button {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #00d30b, #197e00);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s, transform .2s;
    flex-shrink: 0;
}

.ai-chat-input-inner button:hover { 
    opacity: .88; 
    transform: scale(1.05); 
}

.ai-chat-input-inner button:disabled { 
    opacity: .4; 
    cursor: not-allowed; 
    transform: none; 
}

/* Contact links row */
.ai-contact-row {
    display: flex;
    gap: 10px;
    padding: 10px 20px 14px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ai-contact-row a {
    font-size: .78rem;
    color: #475569;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-contact-row a:hover {
    background: linear-gradient(135deg, #00d30b, #197e00);
    color: #fff;
    border-color: transparent;
}

/* Mobile tweaks */
@media (max-width: 768px) {
    .ai-chat-widget { bottom: 20px; }
    .ai-chat-btn { width: 50px; height: 50px; }
    .ai-chat-btn i { font-size: 20px; }
    .ai-chat-messages { padding: 14px; }
    .ai-msg { max-width: 88%; font-size: .88rem; }
    .ai-chat-input-wrap { padding: 10px 14px; }
}

/* ── AI CHAT NOTIFICATION SPEECH BUBBLE (GREEN THEME) ── */
.ai-notification {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #00d30b, #197e00);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 4px 20px rgba(0, 211, 11, 0.3);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ai-notification i:first-child {
    font-size: 18px;
    animation: pulseIcon 0.8s infinite;
}

.ai-notification i:last-child {
    font-size: 12px;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.ai-notification:hover i:last-child {
    transform: translateY(3px);
}

.ai-notification::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #197e00;
}

.ai-notification.fade-out {
    opacity: 0;
    visibility: hidden;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mobile adjustment for notification */
@media (max-width: 768px) {
    .ai-notification {
        bottom: 90px;
        padding: 10px 16px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .ai-notification i:first-child {
        font-size: 14px;
    }
}

/* ──────────────────────────────────────────────────────────────
   FLOATING CONTACT CHAT BUTTON (NAVY BLUE + GOLD THEME)
   Colors: Navy #1e2a4a, Gold #C6A43F, Dark Gold #ffd700
   ────────────────────────────────────────────────────────────── */

.floating-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.chat-toggle { display: none; }

.chat-btn {
    width: 65px;
    height: 65px;
    background: #1e2a4a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    border: 2px solid #C6A43F;
    animation: pulseGold 2s infinite;
}

.chat-btn:hover {
    transform: scale(1.1);
    animation: none;
    border-color: #ffd700;
}

.chat-btn i {
    font-size: 28px;
    color: #C6A43F;
    transition: all 0.3s ease;
}

.chat-btn:hover i {
    color: #ffd700;
    transform: scale(1.1);
}

.chat-btn .fa-times {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
}

.chat-toggle:checked + .chat-btn .fa-comment-dots {
    opacity: 0;
    transform: rotate(90deg);
}

.chat-toggle:checked + .chat-btn .fa-times {
    opacity: 1;
    transform: rotate(0);
}

.chat-options {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1;
    border-right: 4px solid #C6A43F;
}

.chat-toggle:checked ~ .chat-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.3s ease;
    gap: 15px;
    font-weight: 600;
}

.chat-option:hover {
    background: #f0f0f0;
    transform: translateX(-8px);
}

.chat-option i { 
    font-size: 22px; 
    width: 25px; 
    text-align: center; 
}

.chat-option span { 
    font-size: 14px; 
    font-weight: 600; 
    color: #333; 
}

.chat-option.whatsapp i { color: #25D366; }
.chat-option.email i { color: #1a237e; }
.chat-option.call i { color: #C6A43F; }

/* Gold pulse animation for contact button */
@keyframes pulseGold {
    0% { box-shadow: 0 0 0 0 rgba(198, 164, 63, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(198, 164, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(198, 164, 63, 0); }
}