/**
 * ============================================================================
 * VipleSDK.ui — Feuille de style adaptative universelle (Écosystème Viple)
 * ============================================================================
 * Variables CSS universelles requises par tous les packages tiers :
 *   --viple-bg-surface
 *   --viple-text-main
 *   --viple-primary
 *   --viple-radius
 *   --viple-font
 * S'adapte automatiquement au thème visuel de Livria, vipledelivery,
 * viplesupport, viplewingman et viplecontracts.
 */

:root,
[data-viple-site="Livria"] {
    --viple-bg-surface: rgba(255, 255, 255, 0.92);
    --viple-bg-elevated: #fdfbf7;
    --viple-text-main: #1f1b2e;
    --viple-text-muted: #645c79;
    --viple-primary: #6c47ff;
    --viple-primary-hover: #5632e8;
    --viple-primary-soft: rgba(108, 71, 255, 0.12);
    --viple-accent: #f59e0b;
    --viple-border: rgba(108, 71, 255, 0.18);
    --viple-radius: 14px;
    --viple-font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --viple-shadow: 0 8px 24px rgba(31, 27, 46, 0.08);
}

/* Adaptation automatique au thème VipleDelivery (delivery.viplenetwork.com) */
[data-viple-site="vipledelivery"] {
    --viple-bg-surface: #ffffff;
    --viple-bg-elevated: #f4f1fb;
    --viple-text-main: #1d1533;
    --viple-text-muted: #6f6787;
    --viple-primary: #7c4dff;
    --viple-primary-hover: #6535e8;
    --viple-primary-soft: rgba(124, 77, 255, 0.12);
    --viple-accent: #ffb300;
    --viple-border: #cfc7e6;
    --viple-radius: 12px;
    --viple-font: system-ui, 'Segoe UI', sans-serif;
    --viple-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* Adaptation automatique au thème VipleSupport (assistance.viplenetwork.com) */
[data-viple-site="viplesupport"] {
    --viple-bg-surface: #ffffff;
    --viple-bg-elevated: #f8fafc;
    --viple-text-main: #0f172a;
    --viple-text-muted: #475569;
    --viple-primary: #2563eb;
    --viple-primary-hover: #1d4ed8;
    --viple-primary-soft: rgba(37, 99, 235, 0.10);
    --viple-accent: #0ea5e9;
    --viple-border: #e2e8f0;
    --viple-radius: 12px;
    --viple-font: 'Inter', system-ui, -apple-system, sans-serif;
    --viple-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

/* Adaptation automatique au thème VipleWingman (wingman.viple.digital - Dark Mode) */
[data-viple-site="viplewingman"] {
    --viple-bg-surface: rgba(30, 27, 46, 0.92);
    --viple-bg-elevated: rgba(18, 16, 28, 0.95);
    --viple-text-main: #f8fafc;
    --viple-text-muted: #94a3b8;
    --viple-primary: #8b5cf6;
    --viple-primary-hover: #7c3aed;
    --viple-primary-soft: rgba(139, 92, 246, 0.18);
    --viple-accent: #10b981;
    --viple-border: rgba(255, 255, 255, 0.14);
    --viple-radius: 16px;
    --viple-font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --viple-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ============================================================================
 * Composants UI standardisés pour les Packages (Plugins) VipleSDK
 * ============================================================================ */

.viple-sdk-slot {
    font-family: var(--viple-font);
    color: var(--viple-text-main);
    box-sizing: border-box;
}

.viple-pkg-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--viple-bg-surface);
    color: var(--viple-text-main);
    border: 1px solid var(--viple-border);
    border-left: 4px solid var(--viple-primary);
    border-radius: var(--viple-radius);
    padding: 12px 18px;
    margin: 12px auto;
    max-width: 1240px;
    box-shadow: var(--viple-shadow);
    font-family: var(--viple-font);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.viple-pkg-banner:hover {
    transform: translateY(-1px);
}

.viple-pkg-card {
    background: var(--viple-bg-surface);
    color: var(--viple-text-main);
    border: 1px solid var(--viple-border);
    border-radius: var(--viple-radius);
    padding: 16px 20px;
    box-shadow: var(--viple-shadow);
    font-family: var(--viple-font);
}

.viple-pkg-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--viple-primary-soft);
    color: var(--viple-primary);
    font-weight: 700;
    font-size: 0.76rem;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.viple-pkg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--viple-primary);
    color: #ffffff !important;
    border: none;
    border-radius: calc(var(--viple-radius) - 4px);
    padding: 7px 14px;
    font-family: var(--viple-font);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.viple-pkg-btn:hover {
    background: var(--viple-primary-hover);
    transform: translateY(-1px);
}

.viple-pkg-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--viple-text-muted);
    border: 1px solid var(--viple-border);
    border-radius: calc(var(--viple-radius) - 4px);
    padding: 6px 12px;
    font-family: var(--viple-font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================================
 * VipleSDK Floating Dock & Interactive Plugin Drawer (50 Plugins Ecosystem)
 * ============================================================================ */
.viple-sdk-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: var(--viple-font);
    pointer-events: none;
}

.viple-sdk-dock > * {
    pointer-events: auto;
}

.viple-sdk-dock-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(92vw, 560px);
    background: var(--viple-bg-surface);
    border: 1px solid var(--viple-border);
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: var(--viple-shadow);
    backdrop-filter: blur(12px);
}

.viple-sdk-dock-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--viple-bg-elevated);
    color: var(--viple-text-main);
    border: 1px solid var(--viple-border);
    border-radius: 999px;
    padding: 6px 12px;
    font-family: var(--viple-font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.viple-sdk-dock-pill:hover,
.viple-sdk-dock-pill.is-active {
    background: var(--viple-primary);
    color: #ffffff;
    border-color: var(--viple-primary);
    transform: translateY(-1px);
}

.viple-pkg-drawer {
    width: min(94vw, 430px);
    max-height: min(80vh, 620px);
    overflow-y: auto;
    background: var(--viple-bg-surface);
    color: var(--viple-text-main);
    border: 1px solid var(--viple-border);
    border-top: 4px solid var(--viple-primary);
    border-radius: var(--viple-radius);
    padding: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
    font-family: var(--viple-font);
    animation: vipleDrawerIn 0.18s ease-out;
}

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

.viple-pkg-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--viple-border);
}

.viple-pkg-drawer-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--viple-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.viple-pkg-drawer-sub {
    margin: 3px 0 0;
    font-size: 0.78rem;
    color: var(--viple-text-muted);
}

.viple-pkg-input,
.viple-pkg-select,
.viple-pkg-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--viple-bg-elevated);
    color: var(--viple-text-main);
    border: 1px solid var(--viple-border);
    border-radius: calc(var(--viple-radius) - 6px);
    padding: 8px 11px;
    font-family: var(--viple-font);
    font-size: 0.85rem;
    outline: none;
}

.viple-pkg-input:focus,
.viple-pkg-select:focus,
.viple-pkg-textarea:focus {
    border-color: var(--viple-primary);
}

.viple-pkg-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.viple-pkg-stat-box {
    background: var(--viple-bg-elevated);
    border: 1px solid var(--viple-border);
    border-radius: calc(var(--viple-radius) - 4px);
    padding: 10px 12px;
}

.viple-pkg-stat-label {
    font-size: 0.72rem;
    color: var(--viple-text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.viple-pkg-stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--viple-primary);
    margin-top: 2px;
}

