/* ============================================================
   VINAYAK AI WIDGET — COMPLETE STYLES
   ============================================================ */

* { box-sizing: border-box; }

/* FLOATING BUTTON */
#vyWidgetBtn {
    position: fixed; bottom: 24px; right: 24px;
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border: none; color: #fff; cursor: pointer; z-index: 9998;
    box-shadow: 0 10px 30px rgba(30,64,175,0.5), 0 0 0 0 rgba(59,130,246,0.7);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    animation: vyWidgetPulse 2.5s infinite;
    font-family: 'Inter', sans-serif;
}
#vyWidgetBtn:hover { transform: scale(1.1); box-shadow: 0 15px 40px rgba(30,64,175,0.7); }
#vyWidgetBtn.open { animation: none; transform: rotate(90deg); background: linear-gradient(135deg, #ef4444, #dc2626); }
@keyframes vyWidgetPulse {
    0%,100% { box-shadow: 0 10px 30px rgba(30,64,175,0.5), 0 0 0 0 rgba(59,130,246,0.7); }
    50% { box-shadow: 0 10px 30px rgba(30,64,175,0.5), 0 0 0 15px rgba(59,130,246,0); }
}

/* CART BUTTON */
#vyCartBtn {
    position: fixed; bottom: 100px; right: 24px;
    width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none; color: #fff; cursor: pointer; z-index: 9997;
    box-shadow: 0 8px 20px rgba(16,185,129,0.4);
    display: none; align-items: center; justify-content: center;
    font-size: 20px; transition: all 0.3s;
}
#vyCartBtn.visible { display: flex; }
#vyCartBtn .cart-count {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* MINI CHAT PANEL */
#vyWidgetPanel {
    position: fixed; bottom: 100px; right: 24px;
    width: 400px; max-width: calc(100vw - 48px);
    height: 620px; max-height: calc(100vh - 120px);
    background: #0f172a; border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7); z-index: 9999;
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid #1e293b; opacity: 0;
    transform: translateY(20px) scale(0.95); pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    font-family: 'Inter', sans-serif;
}
#vyWidgetPanel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* HEADER — ALWAYS BLUE */
#vyWidgetPanel .vyw-head {
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
#vyWidgetPanel .vyw-head img { width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 2px; object-fit: cover; }
#vyWidgetPanel .vyw-head-info { flex: 1; min-width: 0; }
#vyWidgetPanel .vyw-head-name { font-size: 15px; font-weight: 800; line-height: 1.2; }
#vyWidgetPanel .vyw-status {
    font-size: 11px; opacity: 0.9; display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
#vyWidgetPanel .vyw-status::before {
    content: ''; width: 7px; height: 7px; background: #10b981;
    border-radius: 50%; animation: vywPulse 2s infinite;
}
@keyframes vywPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
#vyWidgetPanel .vyw-head-btn {
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    color: #fff; width: 32px; height: 32px; border-radius: 8px;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; text-decoration: none;
}
#vyWidgetPanel .vyw-head-btn:hover { background: rgba(255,255,255,0.3); }

/* MESSAGES */
#vyWidgetPanel .vyw-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    background: #0a0f1e; scroll-behavior: smooth;
}
#vyWidgetPanel .vyw-messages::-webkit-scrollbar { width: 5px; }
#vyWidgetPanel .vyw-messages::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.vyw-msg { display: flex; gap: 8px; max-width: 88%; animation: vywFade 0.3s ease; }
@keyframes vywFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.vyw-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.vyw-msg.bot { align-self: flex-start; }

.vyw-msg-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 800; overflow: hidden;
}
.vyw-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vyw-msg.user .vyw-msg-avatar { background: linear-gradient(135deg, #10b981, #059669); }

.vyw-bubble {
    padding: 10px 14px; border-radius: 14px; font-size: 13.5px;
    line-height: 1.55; word-break: break-word; white-space: pre-wrap;
}
.vyw-msg.bot .vyw-bubble { background: #1e293b; color: #e2e8f0; border-bottom-left-radius: 4px; }
.vyw-msg.user .vyw-bubble { background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; border-bottom-right-radius: 4px; }
.vyw-bubble a { color: #60a5fa; text-decoration: underline; }
.vyw-bubble strong { color: #fff; font-weight: 700; }

/* PRODUCT CARDS */
.vyw-product-card {
    background: #0f172a; border: 1px solid #334155;
    border-radius: 12px; overflow: hidden; margin: 0.5rem 0;
}
.vyw-product-image { width: 100%; height: 140px; object-fit: cover; background: #1e293b; }
.vyw-product-body { padding: 12px 14px; }
.vyw-product-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.vyw-product-name { font-size: 15px; font-weight: 800; color: #fff; }
.vyw-product-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 50px; background: #f59e0b; color: #fff; text-transform: uppercase;
}
.vyw-product-badge.new { background: #10b981; }
.vyw-product-desc { font-size: 12.5px; color: #94a3b8; margin-bottom: 10px; line-height: 1.5; }
.vyw-product-price { font-size: 14px; font-weight: 700; color: #10b981; margin-bottom: 8px; }
.vyw-product-price .from { font-size: 11px; color: #64748b; font-weight: 500; }
.vyw-product-rating { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #f59e0b; margin-bottom: 10px; }
.vyw-product-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.vyw-product-btn {
    flex: 1; padding: 8px 12px; border-radius: 8px; font-size: 12px;
    font-weight: 700; cursor: pointer; border: none; text-decoration: none;
    text-align: center; transition: all 0.2s; font-family: inherit;
    white-space: nowrap; display: inline-block;
}
.vyw-product-btn.primary { background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; }
.vyw-product-btn.primary:hover { transform: translateY(-2px); }
.vyw-product-btn.outline { background: transparent; color: #60a5fa; border: 1.5px solid #3b82f6; }
.vyw-product-btn.outline:hover { background: #1e40af; color: #fff; }

/* INLINE BUTTONS */
.vyw-inline-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.vyw-inline-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.9rem; border-radius: 8px; font-size: 0.82rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    text-decoration: none; font-family: inherit;
    border: 1.5px solid transparent; white-space: nowrap;
}
.vyw-inline-btn.primary { background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; }
.vyw-inline-btn.outline { background: #1e293b; color: #60a5fa; border-color: #3b82f6; }
.vyw-inline-btn.outline:hover { background: #1e40af; color: #fff; }
.vyw-inline-btn.success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.vyw-inline-btn.warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.vyw-inline-btn.info { background: #0f172a; color: #60a5fa; border-color: #334155; }

/* FEEDBACK */
.vyw-feedback {
    display: flex; align-items: center; gap: 8px; margin-top: 10px;
    padding: 8px 12px; background: #0f172a; border-radius: 8px;
    font-size: 12px; color: #94a3b8; border: 1px solid #1e293b;
}
.vyw-feedback button {
    background: transparent; border: 1px solid #334155; color: #cbd5e1;
    padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.vyw-feedback button:hover { background: #1e293b; border-color: #3b82f6; }
.vyw-feedback button.active { background: #10b981; border-color: #10b981; color: #fff; }

/* TRACKING */
.vyw-track-result {
    background: #0f172a; border: 1px solid #334155;
    border-radius: 10px; padding: 14px; margin: 10px 0;
}
.vyw-track-result .status {
    display: inline-block; padding: 4px 12px; border-radius: 50px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 8px;
}
.vyw-track-result .status.delivered { background: #10b981; color: #fff; }
.vyw-track-result .status.dispatched { background: #f59e0b; color: #fff; }
.vyw-track-result .status.processing { background: #3b82f6; color: #fff; }
.vyw-track-result .row {
    display: flex; justify-content: space-between; padding: 6px 0;
    border-bottom: 1px solid #1e293b; font-size: 12.5px;
}
.vyw-track-result .row:last-child { border-bottom: none; }
.vyw-track-result .label { color: #94a3b8; }
.vyw-track-result .value { color: #e2e8f0; font-weight: 600; }

/* BULK CALCULATOR */
.vyw-calc {
    background: #0f172a; border: 1px solid #334155;
    border-radius: 10px; padding: 14px; margin: 10px 0;
}
.vyw-calc label {
    display: block; font-size: 11.5px; font-weight: 600;
    color: #94a3b8; margin-bottom: 4px; text-transform: uppercase;
}
.vyw-calc select, .vyw-calc input {
    width: 100%; padding: 9px 12px; background: #1e293b;
    border: 1.5px solid #334155; border-radius: 8px;
    color: #e2e8f0; font-size: 13px; font-family: inherit; margin-bottom: 10px;
}
.vyw-calc .result { background: #1e293b; border-radius: 8px; padding: 12px; margin-top: 10px; }
.vyw-calc .result .line {
    display: flex; justify-content: space-between;
    font-size: 13px; padding: 4px 0; color: #cbd5e1;
}
.vyw-calc .result .line.total {
    border-top: 1.5px solid #334155; margin-top: 6px;
    padding-top: 10px; font-size: 15px; font-weight: 800; color: #10b981;
}

/* SPEAK BUTTON */
.vyw-speak-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; background: #1e293b;
    border: 1px solid #334155; color: #94a3b8;
    border-radius: 50%; cursor: pointer; font-size: 12px;
    transition: all 0.2s; vertical-align: middle;
}
.vyw-speak-btn:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.vyw-speak-btn.speaking { background: #ef4444; color: #fff; border-color: #ef4444; }

/* RATING */
.vyw-rating-stars { display: flex; gap: 6px; font-size: 26px; margin: 4px 0; }
.vyw-rating-stars span {
    color: #475569; cursor: pointer;
    transition: all 0.2s; user-select: none; line-height: 1;
}
.vyw-rating-stars span:hover, .vyw-rating-stars span.active { color: #f59e0b; transform: scale(1.15); }

/* TYPING */
.vyw-typing .vyw-bubble { display: flex; gap: 4px; padding: 12px 16px; align-items: center; }
.vyw-typing .dot {
    width: 6px; height: 6px; background: #60a5fa;
    border-radius: 50%; animation: vywDot 1.4s infinite;
}
.vyw-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.vyw-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vywDot {
    0%,60%,100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* QUICK REPLIES */
#vyWidgetPanel .vyw-quick {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 14px 10px; background: #0a0f1e;
    flex-shrink: 0; max-height: 120px; overflow-y: auto;
}
#vyWidgetPanel .vyw-chip {
    padding: 6px 11px; background: #1e293b;
    border: 1px solid #334155; color: #cbd5e1;
    border-radius: 50px; font-size: 11.5px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    font-family: inherit; animation: vywChipIn 0.3s ease; white-space: nowrap;
}
#vyWidgetPanel .vyw-chip:hover {
    background: #1e40af; color: #fff;
    border-color: #1e40af; transform: translateY(-2px);
}
@keyframes vywChipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* INPUT */
#vyWidgetPanel .vyw-input-wrap {
    padding: 10px 14px 14px; background: #0f172a;
    border-top: 1px solid #1e293b;
    display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
}
#vyWidgetPanel .vyw-input {
    flex: 1; background: #1e293b;
    border: 1.5px solid #334155; color: #e2e8f0;
    padding: 10px 14px; border-radius: 22px;
    font-size: 13.5px; font-family: inherit;
    resize: none; max-height: 80px; min-height: 40px; line-height: 1.4;
}
#vyWidgetPanel .vyw-input:focus { outline: none; border-color: #3b82f6; }
#vyWidgetPanel .vyw-send {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border: none; border-radius: 50%; color: #fff;
    cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
#vyWidgetPanel .vyw-mic-btn {
    width: 40px; height: 40px; background: #1e293b;
    border: 1.5px solid #334155; border-radius: 50%;
    color: #cbd5e1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
#vyWidgetPanel .vyw-mic-btn:hover { background: #1e40af; color: #fff; border-color: #1e40af; }
#vyWidgetPanel .vyw-mic-btn.listening { background: #ef4444; color: #fff; border-color: #ef4444; }

/* FOOTER */
#vyWidgetPanel .vyw-footer {
    padding: 8px 14px; background: #0a0f1e;
    border-top: 1px solid #1e293b;
    display: flex; gap: 6px; flex-shrink: 0;
}
#vyWidgetPanel .vyw-footer-btn {
    flex: 1; padding: 7px 6px; background: #1e293b;
    border: 1px solid #334155; color: #cbd5e1;
    border-radius: 8px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    font-family: inherit; text-align: center; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
#vyWidgetPanel .vyw-footer-btn:hover { background: #1e40af; color: #fff; border-color: #1e40af; }

/* SUMMARIZE */
#vyWidgetPanel .vyw-summarize {
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(30,64,175,0.15), rgba(59,130,246,0.1));
    border-bottom: 1px solid #1e293b;
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: #93c5fd; flex-shrink: 0;
}
#vyWidgetPanel .vyw-summarize button {
    background: #1e40af; color: #fff; border: none;
    padding: 5px 12px; border-radius: 6px; font-size: 11.5px;
    font-weight: 700; cursor: pointer; font-family: inherit; flex-shrink: 0;
}

/* TIME THEMES — DISABLED BY DEFAULT (feature-config me false hai) */
.vyw-theme-morning #vyWidgetPanel .vyw-head { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.vyw-theme-afternoon #vyWidgetPanel .vyw-head { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.vyw-theme-evening #vyWidgetPanel .vyw-head { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.vyw-theme-night #vyWidgetPanel .vyw-head { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.vyw-theme-lateNight #vyWidgetPanel .vyw-head { background: linear-gradient(135deg, #1e40af, #3b82f6); }

/* MOBILE */
@media (max-width: 480px) {
    #vyWidgetBtn { bottom: 16px; right: 16px; width: 56px; height: 56px; font-size: 22px; }
    #vyCartBtn { bottom: 80px; right: 16px; width: 46px; height: 46px; }
    #vyWidgetPanel {
        bottom: 84px; right: 8px; left: 8px;
        width: auto; max-width: none;
        height: 75vh; max-height: calc(100vh - 110px);
    }
}

@media (prefers-reduced-motion: reduce) {
    #vyWidgetBtn, .vyw-msg, .vyw-chip, .vyw-inline-btn, .vyw-typing .dot,
    .vyw-speak-btn, .vyw-mic-btn, .vyw-rating-stars span {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}