/* --- CUSTOM ORANGE THEME --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700&display=swap');

:root {
    --gemini-accent: #ff7700;
    --gemini-accent-light: #ffb347;
    --gemini-bg: #fff3e0;
    --gemini-font: 'Nunito Sans', sans-serif;
    --gemini-text-dark: #4e342e;
}

/* --- CHAT CONTAINER --- */
#gemini-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--gemini-font);
}

/* --- TOGGLE BUTTON --- */
#gemini-chat-toggle-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--gemini-accent), var(--gemini-accent-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    color: white;
    font-size: 24px;
    transition: transform 0.2s ease-out;
}
#gemini-chat-toggle-button:hover { transform: scale(1.1); }

/* --- CHAT WINDOW --- */
#gemini-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 500px;
    max-width: 100vw;
    height: 700px;
    max-height: 80vh;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#gemini-chat-window.open { transform: scale(1); }

/* --- HEADER --- */
.gemini-chat-header {
    padding: 15px 20px;
    background: var(--gemini-accent);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1em;
    flex-shrink: 0;
    max-height:60px;
}

#gemini-chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
#gemini-chat-close-btn:hover { opacity: 1; }

/* --- MESSAGES --- */
#gemini-chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: white;
}

@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.gemini-chat-bubble {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    margin-bottom: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    color: var(--gemini-text-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: slideUpFadeIn 0.4s ease-out;
}
.gemini-chat-bubble.ai { background-color: #ffe0b2; border-bottom-left-radius: 5px; }
.gemini-chat-bubble.user { background-color: var(--gemini-accent); color: white; border-bottom-right-radius: 5px; margin-left: auto; }
.gemini-chat-bubble p { margin: 0; }

/* --- INPUT AREA --- */
.gemini-chat-input-area {
    position: relative;
    padding: 15px 20px;
    border-top: 1px solid #ffcc80;
    background-color: #fff3e0;
    display: flex;
    align-items: center;
}

#gemini-chat-input {
    flex-grow: 1;
    border: 1px solid #ffcc80;
    border-radius: 20px;
    padding: 10px 40px 10px 18px; /* room for arrow inside */
    font-family: var(--gemini-font);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-right: 10%;
}

#gemini-chat-input:focus {
    outline: none;
    border-color: var(--gemini-accent);
    box-shadow: 0 0 0 3px rgba(255,119,0,0.3);
}
#gemini-chat-send-btn {
    position: absolute;          /* position inside input area */
    right: 10px;                 /* distance from input right edge */
    top: 50%;                    /* center vertically */
    transform: translateY(-50%);
    width: 36px;                 /* make circle slightly bigger for comfort */
    height: 36px;
    background-color: var(--gemini-accent);
    border: none;
    border-radius: 50%;          /* perfect circle */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;             /* arrow icon size */
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    box-sizing: border-box;      /* ensures no overflow */
}

#gemini-chat-send-btn:hover {
    background-color: var(--gemini-accent-light);
    transform: translateY(-50%) scale(1.05);
}


/* --- TYPING INDICATOR --- */
#gemini-typing-indicator {
    position: absolute;
    bottom: 80px;
    left: 20px;
    background: #fff3e0;
    padding: 10px 15px;
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    gap: 4px;
}
#gemini-typing-indicator.hidden { display: none; }

#gemini-typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #ff7700;
    border-radius: 50%;
    display: inline-block;
    transform: scale(0.4);
    opacity: 0.3;
    animation: typingPulse 1.4s infinite ease-in-out;
}

#gemini-typing-indicator.hidden span {
    animation: none !important;
    opacity: 0 !important;
}

#gemini-typing-indicator span:nth-child(1) { animation-delay: 0s; }
#gemini-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
#gemini-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 60%, 100% { transform: scale(0.4); opacity: 0.3; }
    30% { transform: scale(1); opacity: 1; }
}

/* --- PRODUCT IMAGES --- */
.ai-product-image-link {
    display: inline-block;
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease-in-out;
}

.ai-product-image-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #c0c0c0;
}

.ai-product-image-link img {
    max-width: 150px;
    height: auto;
    display: block;
}

/* --- AI BUTTONS --- */
/* --- AI BUTTON STYLES --- */
.ai-button, button.ai-button {
    display: inline-block;
    padding: 10px 18px;
    margin: 8px 0;
    background: linear-gradient(to right, #ffb347, #ff7700);
    color: #ffffff !important;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out, transform 0.1s ease;
    margin-left: auto;
    margin-right: auto;
}

.ai-button:hover, button.ai-button:hover {
    background: linear-gradient(to right, #ffcc70, #ff6600);
    transform: translateY(-2px);
}

.ai-button:active, button.ai-button:active {
    transform: translateY(0);
}

/* --- PRODUCT IMAGE STYLES --- */
.ai-product-image-link {
    display: inline-block;
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease-in-out;
    width: 150px; /* ensures image fits */
    height: auto;
}

.ai-product-image-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ff7700;
}

.ai-product-image-link img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
}


/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 600px) {
    #gemini-chat-window {
        width: 90vw;
        height: 60vh;
        bottom: 70px;
        right: 5vw;
    }
    #gemini-chat-messages { padding: 10px; }
    .gemini-chat-bubble { max-width: 95%; padding: 10px 14px; }
    .gemini-chat-input-area { padding: 10px 14px; }
    #gemini-chat-input { font-size: 13px; padding: 8px 12px 8px 12px; }
    #gemini-chat-send-btn { width: 28px; height: 28px; font-size: 14px; right: 8px; }
}
/* --- AI BUTTON STYLES --- */
.ai-button {
    display: inline-block;
    padding: 10px 18px;
    margin: 8px 0;
    background: linear-gradient(to right, #ffb347, #ff7700); /* light orange → orange */
    color: #ffffff !important;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px; /* slightly more rounded */
    text-align: center;
    transition: background 0.3s ease-in-out, transform 0.1s ease;
    margin-left: auto;
    margin-right: auto;
}


/* --- PRODUCT IMAGE STYLES --- */
.ai-product-image-link {
    display: inline-block;
    margin: 8px 0;
    border-radius: 12px; /* nice rounded corners */
    overflow: hidden; /* ensures image respects border-radius */
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease-in-out;
}

.ai-product-image-link:hover {
    transform: scale(1.05); /* subtle zoom */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ff7700; /* orange border on hover */
}

.ai-product-image-link img {
    max-width: 150px; /* fixed width */
    height: auto;
    display: block; /* removes extra space below image */
    border-radius: inherit; /* inherit the parent border-radius */
}
