/* ══════════════════════════════════════════════════════════════════════════════
   SHAGOON DIAMOND — AI GEMSTONE & ASTROLOGICAL ADVISOR CHATBOT
   Theme: Ice-Cyan Blue (#B9F2FF) & Royal Obsidian Navy (#0f172a)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Circular Floating Launcher Button (Bottom Left Corner) */
.gem-chat-launcher {
    position: fixed !important;
    bottom: 24px !important;
    left: 24px !important;
    right: auto !important;
    z-index: 99998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 54px !important;
    height: 54px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #B9F2FF 0%, #E0F8FF 100%) !important;
    color: #0f172a !important;
    border: 1.5px solid #7dd3fc !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2), 0 0 24px rgba(185, 242, 255, 0.7) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease !important;
}

.gem-chat-launcher.hide-in-hero {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(20px) scale(0.8) !important;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease !important;
}

.gem-chat-launcher:hover {
    transform: translateY(-3px) scale(1.08) !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28), 0 0 35px rgba(185, 242, 255, 0.95) !important;
    background: #CEF6FF !important;
    border-color: #38bdf8 !important;
}

.gem-chat-launcher-icon {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    position: relative !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.gem-bot-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.22)) !important;
    display: block !important;
    transform: scale(1.1) !important;
}

.gem-chat-launcher:hover .gem-chat-launcher-icon {
    transform: translateY(-2px) rotate(8deg) scale(1.1) !important;
}

.gem-chat-launcher-pulse {
    position: absolute !important;
    top: -4px !important;
    left: -4px !important;
    right: -4px !important;
    bottom: -4px !important;
    border-radius: 50% !important;
    border: 2px solid #38bdf8 !important;
    animation: gemPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite !important;
    pointer-events: none !important;
}

/* Floating Launcher Hover Tooltip ("Hello, can I help you? I am a chatbot") */
.gem-chat-launcher-tooltip {
    position: absolute !important;
    left: calc(100% + 14px) !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) translateX(-8px) !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding: 8px 16px !important;
    border-radius: 999px !important;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    z-index: 99999 !important;
}

.gem-chat-launcher-tooltip span {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.gem-chat-launcher-tooltip::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    right: 100% !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    border-width: 6px !important;
    border-style: solid !important;
    border-color: transparent #ffffff transparent transparent !important;
}

.gem-chat-launcher:hover .gem-chat-launcher-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) translateX(0) !important;
    animation: none !important;
}

@keyframes tooltipIntro {
    0% { opacity: 0; transform: translateY(-50%) translateX(-8px) scale(0.92); }
    15% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
    85% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) translateX(-4px) scale(0.96); }
}

.gem-chat-launcher-tooltip.show-intro {
    animation: tooltipIntro 6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    visibility: visible !important;
}

@keyframes gemPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Chat Container Modal */
.gem-chat-container {
    position: fixed !important;
    bottom: 24px !important;
    left: 24px !important;
    right: auto !important;
    width: 400px !important;
    max-width: calc(100vw - 36px) !important;
    height: 620px !important;
    max-height: calc(100vh - 40px) !important;
    background: #ffffff !important;
    border-radius: 28px !important;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22), 0 0 45px rgba(185, 242, 255, 0.45) !important;
    border: 1.5px solid #7dd3fc !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(20px) scale(0.95) !important;
    pointer-events: none !important;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease !important;
}

.gem-chat-container.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
}

body.gem-chat-open .gem-chat-launcher {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Chat Header in Ice-Cyan Theme */
.gem-chat-header {
    background: linear-gradient(135deg, #B9F2FF 0%, #E6FAFF 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid #7dd3fc;
    box-shadow: 0 2px 10px rgba(185, 242, 255, 0.4);
}

.gem-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Cute Bot Avatar in Chat Header */
.gem-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    position: relative;
    overflow: visible;
    padding: 3px;
}

.gem-header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
    display: block;
}

.gem-chat-online-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    background: #10b981;
    border: 2px solid #B9F2FF;
    border-radius: 50%;
}

.gem-chat-title {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.gem-chat-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.gem-chat-close-btn {
    background: #ffffff;
    border: 1px solid #7dd3fc;
    color: #0f172a;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.gem-chat-close-btn:hover {
    background: #0f172a;
    color: #B9F2FF;
    border-color: #0f172a;
    transform: scale(1.05);
}

/* Chat Messages Area */
.gem-chat-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.gem-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.gem-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Message Bubbles */
.gem-msg {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    animation: gemMsgFade 0.3s ease-out;
}

@keyframes gemMsgFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.gem-msg.bot {
    align-self: flex-start;
}

.gem-msg.user {
    align-self: flex-end;
}

.gem-msg-bubble {
    padding: 13px 16px;
    border-radius: 18px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.88rem;
    line-height: 1.58;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gem-msg.bot .gem-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
}

.gem-msg.user .gem-msg-bubble {
    background: #B9F2FF;
    color: #0f172a;
    border: 1px solid #7dd3fc;
    border-top-right-radius: 4px;
    font-weight: 600;
}

/* Quick Action Chips */
.gem-chat-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.gem-chip-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.gem-chip-btn:hover {
    background: #B9F2FF;
    border-color: #7dd3fc;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(185, 242, 255, 0.5);
}

/* In-Chat Form Box */
.gem-chat-form-box {
    background: #ffffff;
    border: 1.5px solid #7dd3fc;
    border-radius: 18px;
    padding: 16px;
    margin-top: 10px;
    box-shadow: 0 4px 16px rgba(185, 242, 255, 0.35);
}

.gem-form-group {
    margin-bottom: 12px;
}

.gem-form-label {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    margin-bottom: 4px;
}

.gem-form-input, .gem-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.88rem;
    color: #0f172a;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.gem-form-input:focus, .gem-form-select:focus {
    outline: none;
    border-color: #38bdf8;
    background: #ffffff;
}

.gem-form-toggle-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gem-toggle-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.gem-toggle-btn.active {
    background: #0f172a;
    color: #B9F2FF;
    border-color: #0f172a;
}

.gem-form-submit-btn {
    width: 100%;
    background: #B9F2FF;
    color: #0f172a;
    border: 1.5px solid #7dd3fc;
    padding: 11px 16px;
    border-radius: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(185, 242, 255, 0.45);
    transition: all 0.25s ease;
}

.gem-form-submit-btn:hover {
    background: #0f172a;
    color: #B9F2FF;
    border-color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3);
}

/* Astrological Result Card */
.gem-result-card {
    background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
    border: 1.5px solid #7dd3fc;
    border-radius: 20px;
    padding: 18px;
    margin-top: 12px;
    box-shadow: 0 8px 25px rgba(185, 242, 255, 0.35);
}

.gem-result-badge {
    display: inline-block;
    background: #0f172a;
    color: #B9F2FF;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.gem-result-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
}

.gem-result-stone-highlight {
    background: rgba(185, 242, 255, 0.6);
    border-left: 3px solid #0284c7;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #0c4a6e;
    font-weight: 800;
}

.gem-result-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.78rem;
}

.gem-result-meta-item {
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.gem-result-meta-label {
    display: block;
    color: #64748b;
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
}

.gem-result-meta-val {
    color: #0f172a;
    font-weight: 700;
}

/* Review & Rating Card inside Chat */
.gem-review-card {
    background: #ffffff;
    border: 1.5px solid #7dd3fc;
    border-radius: 18px;
    padding: 16px;
    margin-top: 14px;
    box-shadow: 0 6px 20px rgba(185, 242, 255, 0.4);
}

.gem-review-title {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gem-review-stars-row {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    font-size: 1.35rem;
    cursor: pointer;
    color: #cbd5e1;
}

.gem-review-star.active {
    color: #f59e0b;
}

.gem-review-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.82rem;
    resize: none;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.gem-review-textarea:focus {
    outline: none;
    border-color: #38bdf8;
}

.gem-review-submit-btn {
    width: 100%;
    background: #0f172a;
    color: #B9F2FF;
    border: 1px solid #7dd3fc;
    padding: 9px 14px;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gem-review-submit-btn:hover {
    background: #B9F2FF;
    color: #0f172a;
    border-color: #38bdf8;
}

/* Products in-chat row */
.gem-chat-products-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-top: 10px;
    scrollbar-width: none;
}
.gem-chat-products-row::-webkit-scrollbar { display: none; }

.gem-chat-prod-card {
    flex: 0 0 130px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gem-chat-prod-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.gem-chat-prod-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.gem-chat-prod-info {
    padding: 6px 8px;
}

.gem-chat-prod-name {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 2px 0;
}

.gem-chat-prod-meta {
    font-size: 0.65rem;
    color: #c59b27;
    font-weight: 700;
}

/* Typing Indicator */
.gem-typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    width: fit-content;
}

.gem-typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: gemTyping 1.2s infinite ease-in-out;
}

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

@keyframes gemTyping {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Footer / Input Row */
.gem-chat-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.gem-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.gem-chat-input:focus {
    border-color: #38bdf8;
}

.gem-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #B9F2FF;
    color: #0f172a;
    border: 1px solid #7dd3fc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.gem-chat-send-btn:hover {
    background: #0f172a;
    color: #B9F2FF;
    transform: scale(1.06);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .gem-chat-launcher {
        bottom: 20px;
        left: 20px;
        padding: 9px 14px;
        font-size: 0.7rem;
    }

    .gem-chat-container {
        bottom: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
}
