@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

#sektor-chat-wrapper {
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui;
    --chatly-ink: #0e1116;
    --chatly-paper: #f5f1ea;
    --chatly-accent: #ff7a00;
    --chatly-accent-2: #ffb35c;
    --chatly-moss: #1d6b4f;
    --chatly-ocean: #1f3a5f;
    --chatly-shadow: rgba(14, 17, 22, 0.18);
    --user-text: #0e1116;
    --bot-bg: #ffffff;
    --bot-text: #1f2937;
    --radius-lg: 26px;
    --radius-md: 14px;
    box-sizing: border-box;
    position: fixed; bottom: 0; right: 0; z-index: 99999;
    pointer-events: none;
}

#sektor-chat-wrapper * { box-sizing: border-box; pointer-events: auto; }

/* Toggle button */
.sektor-toggle-btn {
    position: fixed; bottom: 26px; right: 26px;
    background: linear-gradient(135deg, var(--chatly-accent) 0%, var(--chatly-accent-2) 100%) !important;
    color: var(--chatly-ink) !important; border: none !important;
    border-radius: 999px !important; padding: 14px 22px !important;
    font-size: 14px !important; font-weight: 700 !important; cursor: pointer;
    box-shadow: 0 14px 30px rgba(255, 122, 0, 0.25) !important;
    display: flex; align-items: center; gap: 10px;
    transition: all 0.25s ease;
    z-index: 99999;
}
.sektor-toggle-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(255, 122, 0, 0.32) !important; }
.sektor-toggle-btn i { font-size: 18px; }

/* Widget window */
.sektor-widget {
    position: fixed; bottom: 90px; right: 26px;
    width: 440px; height: 660px; max-height: 82vh;
    background: var(--chatly-paper) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 34px 80px -14px var(--chatly-shadow), 0 0 0 1px rgba(14, 17, 22, 0.06);
    display: none; flex-direction: column; overflow: hidden;
    opacity: 0; transform: translateY(18px) scale(0.98);
    transition: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
.sektor-widget::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 122, 0, 0.10), transparent 46%),
        radial-gradient(circle at 10% 80%, rgba(29, 107, 79, 0.12), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(245,241,234,0.95) 100%);
    pointer-events: none;
}
.sektor-widget.sektor-open { opacity: 1; transform: translateY(0) scale(1); }

@media (max-width: 520px) {
    .sektor-widget { width: calc(100% - 22px); right: 11px; bottom: 82px; height: 72vh; }
}

/* Header */
.sektor-header {
    position: relative;
    padding: 16px 18px; display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, #0e1116 0%, #1a2a43 45%, #1f3a5f 100%);
    color: var(--chatly-paper);
    border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
    z-index: 2;
}
.sektor-title-group { display: flex; align-items: center; gap: 10px; }
.sektor-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.sektor-title { font-weight: 700; font-size: 15.5px; letter-spacing: 0.2px; }
.sektor-subtitle { font-size: 11.5px; color: rgba(255,255,255,0.75); }
.sektor-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #c7f9df;
    margin-top: 2px;
}
.sektor-online-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    animation: sektorOnlinePulse 1.6s infinite;
}
.sektor-actions { display: flex; gap: 6px; }
.sektor-action-btn { color: rgba(255,255,255,0.65); cursor: pointer; padding: 6px; border-radius: 50%; transition: all 0.2s; font-size: 13px; }
.sektor-action-btn:hover { color: var(--chatly-accent); background: rgba(255,255,255,0.08); }

/* Body */
.sektor-body {
    flex: 1; padding: 20px 20px 12px 20px; overflow-y: auto; display: flex; flex-direction: column;
    scroll-behavior: smooth; position: relative; z-index: 1;
    background:
        radial-gradient(circle at 8% 8%, rgba(255, 122, 0, 0.07), transparent 42%),
        radial-gradient(circle at 92% 18%, rgba(31, 58, 95, 0.09), transparent 46%),
        linear-gradient(180deg, #ffffff 0%, #f6f2ea 100%);
}
.sektor-body::-webkit-scrollbar { width: 4px; }
.sektor-body::-webkit-scrollbar-thumb { background: rgba(14, 17, 22, 0.2); border-radius: 10px; }

/* Welcome */
.sektor-welcome { text-align: left; margin-top: 10px; animation: sektorFadeIn 0.5s ease; }
.sektor-logo {
    width: 60px; height: 60px; background: rgba(255, 122, 0, 0.12);
    color: var(--chatly-accent); border-radius: 18px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 14px; box-shadow: 0 14px 28px rgba(255, 122, 0, 0.2);
}
.sektor-greeting h3 { margin: 0 0 6px 0; font-size: 18.5px; color: var(--chatly-ink); font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.sektor-greeting p { color: #4b5563; margin: 0 0 20px 0; font-size: 13.5px; line-height: 1.55; }

/* Quick actions */
.sektor-quick-action {
    display: flex; align-items: center; text-align: left; background: #ffffff; border: 1px solid rgba(14, 17, 22, 0.08);
    padding: 10px 14px; border-radius: 14px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
    color: #3f4754; font-size: 13px; font-weight: 600;
}
.sektor-quick-action:hover { background: #fff8f1; border-color: rgba(255, 122, 0, 0.35); transform: translateX(2px); color: var(--chatly-ink); }
.sektor-quick-action i { margin-right: 10px; font-size: 14px; color: rgba(255, 122, 0, 0.8); transition: color 0.2s; }

/* Messages */
.sektor-message { max-width: 86%; margin-bottom: 18px; line-height: 1.65; position: relative; animation: sektorSlideUp 0.3s ease forwards; word-wrap: break-word; font-size: 13.75px; }
.sektor-message.sektor-user {
    align-self: flex-end; background: linear-gradient(135deg, var(--chatly-accent-2) 0%, var(--chatly-accent) 100%);
    color: var(--chatly-ink); padding: 12px 16px; border-radius: 20px 20px 6px 20px;
    box-shadow: 0 8px 18px rgba(255, 122, 0, 0.2);
}
.sektor-message.sektor-bot { align-self: flex-start; width: 100%; max-width: 100%; }

/* Bot elements */
.sektor-bot-info { display: flex; align-items: center; margin-bottom: 6px; gap: 8px; margin-left: 2px; }
.sektor-bot-avatar {
    width: 26px; height: 26px; background: rgba(14, 17, 22, 0.08);
    color: var(--chatly-ink); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.sektor-bot-name { font-weight: 600; font-size: 12px; color: #6b7280; }
.sektor-bot-bubble {
    background: var(--bot-bg); color: var(--bot-text); padding: 14px 16px;
    border-radius: 8px 18px 18px 18px; display: inline-block; width: fit-content; max-width: 92%;
    border: 1px solid rgba(14, 17, 22, 0.08);
    box-shadow: 0 10px 22px rgba(14, 17, 22, 0.06);
}

.sektor-bot-content { white-space: pre-wrap; }
.sektor-bot-content p { margin: 0 0 8px 0; }
.sektor-bot-content p:last-child { margin: 0; }
.sektor-bot-content a { color: var(--chatly-ocean); text-decoration: none; font-weight: 600; }
.sektor-bot-content ul { padding-left: 18px; margin: 6px 0; }

/* Suggested chips */
.sektor-suggested {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.sektor-chip {
    border: 1px solid rgba(14, 17, 22, 0.12);
    background: #fff5e9;
    color: #1f2937;
    font-size: 12px; font-weight: 600;
    border-radius: 999px; padding: 7px 12px; cursor: pointer;
    transition: all 0.2s ease;
}
.sektor-chip:hover { border-color: rgba(255, 122, 0, 0.4); transform: translateY(-1px); }

/* Loading */
.sektor-message.sektor-loading .sektor-bot-bubble {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: #fff7ed; border: 1px solid rgba(255, 122, 0, 0.3);
    transition: border-color 0.3s;
    animation: sektorPulseBorder 2s infinite;
}

@keyframes sektorPulseBorder {
    0% { border-color: rgba(255, 122, 0, 0.18); }
    50% { border-color: rgba(255, 122, 0, 0.45); }
    100% { border-color: rgba(255, 122, 0, 0.18); }
}

.sektor-loading-dots { display: flex; align-items: center; gap: 4px; }
.sektor-loading-dot {
    width: 5px; height: 5px; background: rgba(14, 17, 22, 0.45); border-radius: 50%;
    animation: sektorTypingPulse 1.4s infinite ease-in-out both;
}
.sektor-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.sektor-loading-dot:nth-child(2) { animation-delay: -0.16s; }

.sektor-loading-text {
    font-size: 12.5px; color: #6b7280; font-style: italic;
    min-width: 60px; transition: opacity 0.3s ease; white-space: nowrap;
}

@keyframes sektorTypingPulse { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* Product cards */
.sektor-product-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; width: 100%; }
.sektor-product-card {
    display: flex; flex-direction: row; background: #ffffff; border: 1px solid rgba(14, 17, 22, 0.08);
    border-radius: 16px; overflow: hidden; box-shadow: 0 3px 10px rgba(14, 17, 22, 0.05);
    transition: all 0.2s ease; text-decoration: none; width: 100%; align-items: center; position: relative;
}
.sektor-product-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(14, 17, 22, 0.12); border-color: rgba(255, 122, 0, 0.45); }
.sektor-pc-img-wrap {
    width: 88px; height: 88px; flex-shrink: 0; background: #fff7ed;
    display: flex; align-items: center; justify-content: center; padding: 6px; border-right: 1px solid rgba(14, 17, 22, 0.05);
}
.sektor-pc-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sektor-pc-content { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; flex-grow: 1; min-width: 0; }
.sektor-pc-badge {
    position: absolute; top: 6px; left: 6px; background: var(--chatly-accent);
    color: #111; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 8px; z-index: 2;
}
.sektor-pc-title { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sektor-pc-price { font-size: 13.5px; font-weight: 700; color: var(--chatly-ocean); margin-bottom: 4px; }
.sektor-pc-cta { font-size: 11px; font-weight: 600; color: #6b7280; display: flex; align-items: center; gap: 4px; margin-top: auto; }
.sektor-product-card:hover .sektor-pc-cta i { transform: translateX(3px); color: var(--chatly-accent); }

/* Rating */
.sektor-rating { display: flex; gap: 12px; margin-top: 6px; margin-left: 2px; opacity: 0; transition: opacity 0.2s; }
.sektor-message.sektor-bot:hover .sektor-rating { opacity: 1; }
.sektor-rating i { cursor: pointer; font-size: 14px; color: #cbd5e1; transition: all 0.2s; }
.sektor-rating i:hover { color: var(--chatly-accent); transform: scale(1.1); }
.sektor-rating i.sektor-active { color: var(--chatly-accent); }

/* Footer */
.sektor-footer { padding: 12px 18px 18px 18px; background: rgba(255, 255, 255, 0.96); border-top: 1px solid rgba(14, 17, 22, 0.08); flex-shrink: 0; position: relative; z-index: 2; }
.sektor-input-wrapper {
    position: relative; border: 1px solid rgba(14, 17, 22, 0.1) !important; border-radius: 999px !important; background: white !important;
    display: flex !important; align-items: center !important; padding: 6px 6px 6px 16px !important; min-height: 46px !important;
    box-shadow: 0 6px 14px rgba(14, 17, 22, 0.06) !important; transition: border-color 0.2s, box-shadow 0.2s;
}
.sektor-input-wrapper:focus-within { border-color: rgba(255, 122, 0, 0.6) !important; box-shadow: 0 8px 16px rgba(255, 122, 0, 0.12) !important; }
.sektor-input-wrapper textarea {
    border: none !important; box-shadow: none !important; background: transparent !important;
    margin: 0 !important; padding: 0 !important; resize: none !important; width: 100% !important;
    outline: none !important; font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 14px !important;
    line-height: 20px !important; color: #111827 !important; max-height: 110px !important;
}
.sektor-send-btn {
    background: linear-gradient(135deg, var(--chatly-accent) 0%, var(--chatly-accent-2) 100%) !important; border: none !important; width: 36px !important; height: 36px !important;
    border-radius: 50% !important; color: var(--chatly-ink) !important; cursor: pointer !important; display: flex !important; align-items: center !important;
    justify-content: center !important; transition: all 0.25s !important; margin-left: 8px !important; flex-shrink: 0 !important;
    opacity: 0.55; pointer-events: none; transform: scale(0.9); box-shadow: 0 6px 12px rgba(255, 122, 0, 0.25);
}
.sektor-send-btn.sektor-active { opacity: 1; pointer-events: all; transform: scale(1); }

/* Powered by */
.sektor-powered {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px;
    font-size: 10px; color: rgba(14, 17, 22, 0.4); font-weight: 600; user-select: none;
}
.sektor-powered-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #0e1116;
    letter-spacing: 0.2px;
}
.sektor-powered-text span {
    color: var(--chatly-accent);
}
.sektor-hidden { display: none !important; }

@keyframes sektorFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sektorSlideUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sektorOnlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Proactive bubble */
.sektor-proactive-bubble {
    position: fixed;
    bottom: 92px; right: 26px;
    width: 290px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(14, 17, 22, 0.16), 0 0 0 1px rgba(14, 17, 22, 0.06);
    padding: 14px;
    z-index: 99998;
    display: none;
    flex-direction: column;
    animation: sektorPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    transform-origin: bottom right;
}

.sektor-proactive-bubble.sektor-visible { display: flex; }

.sektor-proactive-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px; right: 34px;
    width: 12px; height: 12px;
    background: #ffffff;
    transform: rotate(45deg);
    border-bottom: 1px solid rgba(14, 17, 22, 0.06);
    border-right: 1px solid rgba(14, 17, 22, 0.06);
}

.sektor-pb-close {
    position: absolute;
    top: -8px; right: -8px;
    width: 24px; height: 24px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 2px 6px rgba(14, 17, 22, 0.16);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #9aa3af; font-size: 12px;
    transition: all 0.2s; border: 1px solid rgba(14, 17, 22, 0.08);
}
.sektor-pb-close:hover { color: #ef4444; transform: scale(1.08); }

.sektor-pb-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sektor-pb-avatar {
    width: 32px; height: 32px; background: rgba(255, 122, 0, 0.14);
    color: var(--chatly-ink); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.sektor-pb-text { font-size: 13.5px; color: #111827; line-height: 1.4; font-weight: 600; }

.sektor-pb-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sektor-pb-btn {
    background: #fff7ed;
    border: 1px solid rgba(255, 122, 0, 0.25);
    padding: 8px 12px; border-radius: 10px;
    font-size: 12.5px; color: #111827; cursor: pointer; text-align: left;
    transition: all 0.2s; font-weight: 600; display: flex; align-items: center; justify-content: space-between;
}
.sektor-pb-btn:hover { background: #ffefd9; border-color: rgba(255, 122, 0, 0.45); transform: translateX(2px); }
.sektor-pb-btn i { font-size: 10px; opacity: 0.6; }

@keyframes sektorPopIn {
    from { opacity: 0; transform: scale(0.85) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 520px) {
    .sektor-proactive-bubble { width: 250px; right: 16px; bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
