/* ============================================================
   STAER PLUGINS BUNDLE (global, HEAD) - Public CSS
   ------------------------------------------------------------
   CSS global pe TOATE paginile: CookieConsent + Chat. Per-pagina: staer-{plugin}.css.
   ============================================================ */

/* ===== START: Staer.Plugin.Misc.CookieConsent ===== */
/*
   Suprascrie variabilele CookieConsent v3 ca textul sa fie lizibil pe
   BackgroundColor configurat. Vars dinamice sunt setate pe :root in
   PublicInfo.cshtml (--staer-cc-bg, --staer-cc-accent, --staer-cc-text,
   --staer-cc-text-secondary, ...). Toate au fallback la default dark theme.
*/
#cc-main,
#cc-main :is(.cm, .pm) {
    --cc-bg: var(--staer-cc-bg, #1e2428);
    --cc-primary-color: var(--staer-cc-text, #f5f5f5);
    --cc-secondary-color: var(--staer-cc-text-secondary, #cbd5e0);

    --cc-btn-primary-bg: var(--staer-cc-accent, #0d6efd);
    --cc-btn-primary-color: #ffffff;
    --cc-btn-primary-hover-bg: var(--staer-cc-accent, #0d6efd);
    --cc-btn-primary-hover-color: #ffffff;

    --cc-btn-secondary-bg: var(--staer-cc-btn-secondary-bg, rgba(255,255,255,0.10));
    --cc-btn-secondary-color: var(--staer-cc-text, #f5f5f5);
    --cc-btn-secondary-border-color: transparent;
    --cc-btn-secondary-hover-bg: var(--staer-cc-btn-secondary-hover-bg, rgba(255,255,255,0.18));
    --cc-btn-secondary-hover-color: var(--staer-cc-text, #f5f5f5);
    --cc-btn-secondary-hover-border-color: transparent;

    --cc-cookie-category-block-bg: var(--staer-cc-block-bg, rgba(255,255,255,0.06));
    --cc-cookie-category-block-bg-hover: var(--staer-cc-block-bg-hover, rgba(255,255,255,0.10));
    --cc-cookie-category-block-border: transparent;
    --cc-cookie-category-expanded-block-bg: var(--staer-cc-block-bg, rgba(255,255,255,0.06));
    --cc-cookie-category-expanded-block-hover-bg: var(--staer-cc-block-bg-hover, rgba(255,255,255,0.10));

    --cc-section-border: var(--staer-cc-section-border, rgba(255,255,255,0.12));
    --cc-cookie-table-border: var(--staer-cc-section-border, rgba(255,255,255,0.12));

    --cc-toggle-bg-off: var(--staer-cc-toggle-off, rgba(255,255,255,0.20));
    --cc-toggle-bg-readonly: var(--staer-cc-toggle-off, rgba(255,255,255,0.20));
    --cc-toggle-knob-bg: #ffffff;
    --cc-toggle-knob-icon-color: var(--staer-cc-bg, #1e2428);

    --cc-overlay-bg: var(--staer-cc-overlay-bg, rgba(0,0,0,0.65));
}

/* Linkurile din modal (ex: Politica de confidentialitate) folosesc accent. */
#cc-main a {
    color: var(--staer-cc-accent, #0d6efd);
}

#cc-main a:hover {
    color: var(--staer-cc-accent, #0d6efd);
    filter: brightness(1.15);
}

/* Floating "Cookie settings" trigger â€” buton rotund permanent vizibil jos-stanga. */
#staer-cookie-settings-wrapper {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9000;
}

#staer-cookie-settings-trigger {
    width: 56px;
    height: 56px;
    padding: 10px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: radial-gradient(circle at 30% 30%, #f7c77a, #d29848);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#staer-cookie-settings-trigger:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

#staer-cookie-settings-trigger:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

#staer-cookie-settings-trigger svg {
    width: 32px;
    height: 32px;
}

@media (max-width: 600px) {
    #staer-cookie-settings-wrapper {
        bottom: 16px;
        left: 16px;
    }
    #staer-cookie-settings-trigger {
        width: 48px;
        height: 48px;
    }
}
/* ===== END: Staer.Plugin.Misc.CookieConsent ===== */


/* ===== START: Staer.Plugin.Misc.Chat ===== */
/*
   StaerChat Widget — floating bubble + chatbox overlay. Codul JS care manipuleaza
   acest DOM traieste in staer-plugins.js (section Staer.Plugin.Misc.Chat) si citeste
   data-* attributes de pe `#staer-chat-root` pentru URL-uri si position.
*/

/* StaerChat Widget â€” floating bubble + chatbox overlay */

.staer-chat-bubble {
    position: fixed;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a52a1 0%, #0d3a78 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 82, 161, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

    .staer-chat-bubble:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(26, 82, 161, 0.55);
    }

    .staer-chat-bubble svg {
        width: 28px;
        height: 28px;
        fill: #fff;
    }

    .staer-chat-bubble .staer-chat-unread {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #c8202b;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        border-radius: 10px;
        padding: 0 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.staer-chat-root[data-position="bottom-right"] .staer-chat-bubble { right: 20px; bottom: 20px; }
.staer-chat-root[data-position="bottom-left"]  .staer-chat-bubble { left: 20px;  bottom: 20px; }

.staer-chat-box {
    position: fixed;
    z-index: 9999;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 540px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.staer-chat-root[data-position="bottom-right"] .staer-chat-box { right: 20px; bottom: 90px; }
.staer-chat-root[data-position="bottom-left"]  .staer-chat-box { left: 20px;  bottom: 90px; }

.staer-chat-header {
    background: linear-gradient(135deg, #1a52a1 0%, #0d3a78 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .staer-chat-header .title { font-weight: 700; font-size: 15px; }
    .staer-chat-header .status { font-size: 11px; opacity: 0.85; margin-top: 2px; }
    .staer-chat-header .close-btn {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 22px;
        cursor: pointer;
        line-height: 1;
        padding: 0;
    }

.staer-chat-context {
    background: #f4f8fb;
    border-bottom: 1px solid #e3eaf7;
    padding: 6px 12px;
    font-size: 11px;
    color: #555;
}

.staer-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #fafbfd;
}

.staer-chat-msg {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

    .staer-chat-msg.from-me { align-self: flex-end; align-items: flex-end; margin-left: auto; }
    .staer-chat-msg.from-them { align-self: flex-start; align-items: flex-start; }
    .staer-chat-msg.system { align-self: center; max-width: 100%; }

    .staer-chat-msg .bubble {
        padding: 8px 12px;
        border-radius: 14px;
        font-size: 13px;
        line-height: 1.4;
        word-wrap: break-word;
    }

    .staer-chat-msg.from-me .bubble {
        background: #1a52a1;
        color: #fff;
        border-bottom-right-radius: 4px;
    }

    .staer-chat-msg.from-them .bubble {
        background: #fff;
        border: 1px solid #e3eaf7;
        color: #333;
        border-bottom-left-radius: 4px;
    }

    .staer-chat-msg.system .bubble {
        background: transparent;
        color: #888;
        font-size: 11px;
        font-style: italic;
        text-align: center;
    }

    .staer-chat-msg .meta {
        font-size: 10px;
        color: #999;
        margin-top: 2px;
    }

    /* Badge source canal (WhatsApp / Messenger / Site) â€” afisat in meta pe mesaje timeline multi-canal */
    .staer-chat-src {
        display: inline-block;
        padding: 1px 6px;
        border-radius: 3px;
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #fff;
        margin-right: 4px;
        vertical-align: middle;
    }
        .staer-chat-src.src-wa    { background: #25D366; }
        .staer-chat-src.src-mess  { background: #0084FF; }
        .staer-chat-src.src-web   { background: #6c757d; }
        .staer-chat-src.src-other { background: #888; }

.staer-chat-input-row {
    border-top: 1px solid #e3eaf7;
    padding: 10px;
    display: flex;
    gap: 8px;
    background: #fff;
    align-items: flex-end;
}

    .staer-chat-input-row textarea {
        flex: 1;
        border: 1px solid #ccc;
        border-radius: 18px;
        padding: 8px 14px;
        font-size: 13px;
        resize: none;
        min-height: 36px;
        max-height: 100px;
        outline: none;
        font-family: inherit;
    }

        .staer-chat-input-row textarea:focus {
            border-color: #1a52a1;
        }

    .staer-chat-input-row .send-btn {
        background: #1a52a1;
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .staer-chat-input-row .send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .staer-chat-input-row .send-btn svg {
            width: 16px;
            height: 16px;
            fill: #fff;
        }

    .staer-chat-input-row .attach-btn {
        background: transparent;
        color: #6c757d;
        border: 1px solid transparent;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background 0.15s, color 0.15s;
    }

        .staer-chat-input-row .attach-btn:hover:not(:disabled) {
            background: #f0f3f8;
            color: #1a52a1;
        }

        .staer-chat-input-row .attach-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .staer-chat-input-row .attach-btn svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
        }

/* Preview atasamente in coada (inainte de trimitere) */
.staer-chat-attach-preview {
    border-top: 1px solid #e3eaf7;
    padding: 8px 10px;
    background: #fafbfd;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

    .staer-chat-attach-item {
        position: relative;
        width: 54px;
        height: 54px;
        border-radius: 6px;
        overflow: hidden;
        border: 1px solid #ddd;
        background: #fff;
        flex-shrink: 0;
    }

        .staer-chat-attach-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .staer-chat-attach-item .doc-icon {
            width: 100%;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding-top: 4px;
        }

        .staer-chat-attach-item .doc-icon svg {
            width: 24px;
            height: 24px;
        }

        .staer-chat-attach-item .doc-label {
            font-size: 9px;
            color: #555;
            text-align: center;
            padding: 0 2px;
            line-height: 1.1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 54px;
        }

        .staer-chat-attach-item .remove-x {
            position: absolute;
            top: 0;
            right: 0;
            width: 16px;
            height: 16px;
            background: rgba(0, 0, 0, 0.65);
            color: #fff;
            border: none;
            border-radius: 0 0 0 6px;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .staer-chat-attach-item .remove-x:hover {
                background: #c8202b;
            }

/* Feedback vizual la drag&drop fisier peste chatbox */
.staer-chat-box.staer-chat-dragover {
    outline: 3px dashed #1a52a1;
    outline-offset: -6px;
    background: #f0f6ff;
}

    .staer-chat-box.staer-chat-dragover::after {
        content: 'ElibereazÄƒ pentru a ataÈ™a fiÈ™ierul';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(26, 82, 161, 0.95);
        color: #fff;
        padding: 10px 18px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        pointer-events: none;
        z-index: 20;
    }

/* Toast eroare temporara (fisier prea mare, extensie nepermisa, etc.) */
.staer-chat-error-toast {
    background: #fdecea;
    color: #8b2e2a;
    border-left: 3px solid #c8202b;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.3;
    margin: 0;
}

/* Atasamente randate INTR-UN MESAJ (dupa trimitere â€” imagini inline + linkuri documente) */
.staer-chat-msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    max-width: 100%;
}

    .staer-chat-msg-attachments .msg-attach-img {
        display: block;
        border-radius: 8px;
        overflow: hidden;
        max-width: 180px;
        max-height: 180px;
    }

        .staer-chat-msg-attachments .msg-attach-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            cursor: zoom-in;
        }

    .staer-chat-msg-attachments .msg-attach-doc {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid #e3eaf7;
        border-radius: 8px;
        text-decoration: none;
        color: #333;
        max-width: 220px;
        transition: background 0.15s;
    }

        .staer-chat-msg-attachments .msg-attach-doc:hover {
            background: #fff;
            border-color: #1a52a1;
        }

        .staer-chat-msg-attachments .msg-attach-doc .doc-icon svg {
            width: 24px;
            height: 24px;
            display: block;
        }

        .staer-chat-msg-attachments .msg-attach-doc .doc-info {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .staer-chat-msg-attachments .msg-attach-doc .doc-name {
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 170px;
        }

        .staer-chat-msg-attachments .msg-attach-doc .doc-size {
            font-size: 10px;
            color: #888;
        }

/* Pentru mesaje from-me (operator albastru), doc cards keep alb pentru contrast */
.staer-chat-msg.from-me .msg-attach-doc {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.staer-chat-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    text-align: center;
    z-index: 10;
}

    .staer-chat-overlay button {
        background: #1a52a1;
        color: #fff;
        border: none;
        padding: 10px 20px;
        border-radius: 6px;
        font-weight: 600;
        cursor: pointer;
        margin-top: 12px;
    }

@media (max-width: 480px) {
    .staer-chat-box {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0;
    }
}

.staer-chat-hidden { display: none !important; }

/* ===== END: Staer.Plugin.Misc.Chat ===== */
