/* =============================================
   xb-builder-v94-fixes.css — v94.0
   
   1. Split panel: sticky header + FAB + overlay
   2. Dofus slots: bigger
   3. Tooltips: bigger text
   4. FM selector modal: gold redesign
   5. FM modal: close on modal-box + item icon strip
   6. Stats panel: Auto button + cost ratio pills
   ============================================= */


/* =============================================
   1. SPLIT PANEL — CLOSE
   ============================================= */

.xb-split-ency-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
}

.xb-split-fab-close {
    display: none;
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 15001;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border: 2px solid rgba(248, 113, 113, 0.5);
    color: #fff;
    font-size: 1.5rem; font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.5);
    transition: all 0.2s ease;
    align-items: center; justify-content: center;
}
.xb-split-fab-close:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(220, 38, 38, 0.7); }
body.xb-split-mode .xb-split-fab-close { display: flex !important; }

.xb-split-overlay {
    display: none; position: absolute; inset: 0; z-index: 50;
    cursor: pointer; background: rgba(0, 0, 0, 0.15); transition: background 0.2s;
}
.xb-split-overlay:hover { background: rgba(0, 0, 0, 0.25); }
.xb-split-container.split-active .xb-split-overlay { display: block !important; }

.xb-split-close-btn {
    padding: 10px 18px !important; font-size: 1rem !important;
    font-weight: 800 !important; border-radius: 10px !important; white-space: nowrap !important;
}
.xb-split-close-btn::after { content: ' (Esc)'; font-size: 0.7em; opacity: 0.5; font-weight: 600; }


/* =============================================
   2. DOFUS SLOTS — BIGGER
   ============================================= */

.xb-dofus-inline .xb-slot-dofus {
    width: 58px !important; height: 58px !important;
    min-width: 58px !important; min-height: 58px !important;
}
.xb-dofus-inline .xb-slot-dofus .xb-slot-label { font-size: 9px !important; opacity: 0.6 !important; color: rgba(212, 175, 55, 0.7) !important; }
.xb-dofus-inline .xb-slot-dofus .xb-remove { top: -6px !important; right: -6px !important; width: 18px !important; height: 18px !important; font-size: 12px !important; }
.xb-dofus-inline { gap: 10px !important; padding: 14px 24px !important; }
.xb-split-container.split-active .xb-dofus-inline .xb-slot-dofus { width: 56px !important; height: 56px !important; min-width: 56px !important; min-height: 56px !important; }


/* =============================================
   3. TOOLTIPS — BIGGER TEXT
   ============================================= */

.xb-slot-tooltip { max-width: 420px !important; min-width: 280px !important; }
.xb-build-tooltip .xb-tip-name, .xb-slot-tooltip .xb-tip-name, .xb-tip-content .xb-tip-name,
#xb-slot-tooltip .xb-tip-name, #xb-build-tip .xb-tip-name, div.xb-tip-name {
    font-size: 1.3rem !important; font-weight: 800 !important; line-height: 1.35 !important;
}
.xb-build-tooltip .xb-tip-lvl, .xb-slot-tooltip .xb-tip-lvl, .xb-tip-content .xb-tip-level, #xb-build-tip .xb-tip-lvl { font-size: 1.05rem !important; }
.xb-build-tooltip .xb-tip-effect, .xb-slot-tooltip .xb-tip-effect, .xb-tip-content .xb-tip-effect { font-size: 1.1rem !important; font-weight: 600 !important; line-height: 1.5 !important; padding: 3px 0 !important; }
.xb-tip-pano, .xb-tip-content .xb-tip-pano { font-size: 1.1rem !important; }
.xb-tip-cond, .xb-tip-content .xb-tip-cond { font-size: 1rem !important; }
.xb-tip-content { padding: 18px 22px !important; }
.xb-tip-effect img, .xb-tip-icon { width: 18px !important; height: 18px !important; }
#xb-pano-tooltip-el .xb-pano-tooltip { font-size: 1.05rem !important; width: 350px !important; }
#xb-pano-tooltip-el .xb-pano-tt-header { font-size: 1.15rem !important; }
#xb-pano-tooltip-el .xb-pano-tt-stat { font-size: 1rem !important; }
.xb-split-stat-line { font-size: 0.95rem !important; }
.xb-split-item-name { font-size: 1.05rem !important; font-weight: 700 !important; }
.xb-split-item-lvl { font-size: 0.9rem !important; font-weight: 700 !important; }


/* =============================================
   4. FM SELECTOR MODAL — GOLD REDESIGN
   ============================================= */

body .xb-fm-selector-overlay { background: rgba(5, 5, 15, 0.85) !important; backdrop-filter: blur(8px) !important; z-index: 15000 !important; }
body .xb-fm-selector {
    max-width: 640px !important; width: 92% !important; padding: 0 !important;
    background: linear-gradient(160deg, #12101f, #0a0814) !important;
    border: 2px solid rgba(212, 175, 55, 0.35) !important; border-radius: 18px !important;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9), inset 0 1px 0 rgba(212,175,55,0.1) !important; overflow: hidden !important;
}
body .xb-fm-selector-header { margin-bottom: 0 !important; padding: 20px 24px 16px !important; border-bottom: 1px solid rgba(212, 175, 55, 0.15) !important; background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(139, 92, 246, 0.04)) !important; }
body .xb-fm-selector-header h3 { font-size: 1.4rem !important; font-weight: 800 !important; color: #f0c850 !important; }
body .xb-fm-selector-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 8px !important; padding: 16px 20px !important; max-height: 60vh !important; overflow-y: auto !important; }
body .xb-fm-selector-item { gap: 14px !important; padding: 12px 16px !important; background: rgba(255,255,255,0.025) !important; border: 1px solid rgba(255,255,255,0.06) !important; border-radius: 12px !important; transition: all 0.2s !important; }
body .xb-fm-selector-item:hover { background: rgba(212,175,55,0.06) !important; border-color: rgba(212,175,55,0.35) !important; transform: translateY(-1px) !important; }
body .xb-fm-selector-item img { width: 56px !important; height: 56px !important; border-radius: 10px !important; background: rgba(0,0,0,0.3) !important; padding: 6px !important; border: 1px solid rgba(212,175,55,0.15) !important; }
body .xb-fm-selector-name { font-size: 1.1rem !important; font-weight: 700 !important; color: #fff !important; }
body .xb-fm-selector-level { font-size: 0.9rem !important; font-weight: 600 !important; color: rgba(212,175,55,0.65) !important; }


/* =============================================
   5. FM MODAL — CLOSE BUTTON ON MODAL-BOX
   ============================================= */

/* The .xfm-close is MOVED via JS to be child of .xb-modal-box */
body #xb-fm-modal .xb-modal-box {
    position: relative !important;
}

body #xb-fm-modal .xfm-close.v94-moved {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 38px !important;
    height: 38px !important;
    background: rgba(239, 68, 68, 0.15) !important;
    border: 2px solid rgba(239, 68, 68, 0.4) !important;
    border-radius: 10px !important;
    color: #f87171 !important;
    font-size: 1.6rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    z-index: 50 !important;
    transition: all 0.2s ease !important;
}
body #xb-fm-modal .xfm-close.v94-moved:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 0.7) !important;
    color: #fff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4) !important;
}

/* Overlay click to close */
body #xb-fm-modal.xb-modal-overlay { cursor: pointer !important; }
body #xb-fm-modal .xb-modal-box { cursor: default !important; }

/* Fixed modal height — stays consistent when switching items */
body #xb-fm-modal .xb-modal-body {
    min-height: 40vh !important;
}

/* Hide native select and old arrows (replaced by icon strip) */
body #xb-fm-modal .xfm-hselect { display: none !important; }

/* Header: right padding for close button */
body #xb-fm-modal .xfm-header { padding-right: 52px !important; }


/* =============================================
   5b. FM ITEM ICON STRIP (between header & tabs)
   ============================================= */

.xfm-icon-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.xfm-icon-strip::-webkit-scrollbar { display: none; }

.xfm-icon-strip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 4px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    background: none;
    min-width: 54px;
}
.xfm-icon-strip-item:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
}
.xfm-icon-strip-item.xfm-strip-active {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.15);
}

.xfm-icon-strip-item img {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.xfm-icon-strip-item.xfm-strip-active img {
    border-color: rgba(212, 175, 55, 0.4);
}

.xfm-icon-strip-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    max-width: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.xfm-icon-strip-item.xfm-strip-active .xfm-icon-strip-label {
    color: rgba(212, 175, 55, 0.8);
}

.xfm-icon-strip-fm {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.55rem;
    background: rgba(245, 158, 11, 0.3);
    border-radius: 3px;
    padding: 0 2px;
    line-height: 1.2;
}
.xfm-icon-strip-item { position: relative; }


/* =============================================
   6. STATS PANEL — COST RATIO PILLS + AUTO BTN
   ============================================= */

/* Hide native select */
.xb-auto-capital-select { display: none !important; }

/* Auto button */
.xb-auto-capital-btn-v94 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(184, 148, 30, 0.1)) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: 8px !important;
    color: #fbbf24 !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
    position: relative !important;
}
.xb-auto-capital-btn-v94:hover {
    border-color: rgba(212, 175, 55, 0.6) !important;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(184, 148, 30, 0.15)) !important;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.2) !important;
}

/* Auto dropdown */
.xb-auto-dropdown {
    display: none; position: absolute; top: calc(100% + 6px); left: 0;
    z-index: 500; background: #12101f; border: 1.5px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    padding: 4px; min-width: 160px;
}
.xb-auto-dropdown.open { display: block; }
.xb-auto-dropdown-item {
    display: flex !important; align-items: center !important; gap: 8px !important;
    padding: 8px 12px !important; border-radius: 7px !important; cursor: pointer !important;
    transition: background 0.15s !important; border: none !important; background: none !important;
    width: 100% !important; text-align: left !important;
    color: #ccc !important; font-size: 0.9rem !important; font-weight: 600 !important;
}
.xb-auto-dropdown-item:hover { background: rgba(212, 175, 55, 0.12) !important; color: #f0c850 !important; }
.xb-auto-dropdown-item img { width: 20px; height: 20px; flex-shrink: 0; }

/* Cost ratio PILLS — big, gold background, unmissable */
.xb-sc-cost-hint {
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 900 !important;
    color: #f0c850 !important;
    background: rgba(212, 175, 55, 0.15) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    border-radius: 4px !important;
    padding: 1px 5px !important;
    line-height: 1.3 !important;
    margin-top: 2px !important;
    letter-spacing: 0.3px !important;
}


/* =============================================
   7. RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
    .xb-split-fab-close { bottom: 16px !important; right: 16px !important; width: 50px !important; height: 50px !important; }
    .xb-dofus-inline .xb-slot-dofus { width: 52px !important; height: 52px !important; min-width: 52px !important; min-height: 52px !important; }
}

@media (max-width: 768px) {
    .xb-split-ency-header { position: sticky !important; top: 0 !important; z-index: 200 !important; }
    .xb-split-container.split-active .xb-split-overlay { display: none !important; }
    .xb-split-fab-close { bottom: 12px !important; right: 12px !important; width: 48px !important; height: 48px !important; }
    .xb-slot-tooltip { max-width: 90vw !important; min-width: unset !important; }
    body .xb-fm-selector-grid { grid-template-columns: 1fr !important; }
    .xb-dofus-inline .xb-slot-dofus { width: 48px !important; height: 48px !important; min-width: 48px !important; min-height: 48px !important; }
    .xb-dofus-inline { gap: 6px !important; padding: 10px 14px !important; }
    .xb-split-close-btn::after { display: none !important; }
    body #xb-fm-modal .xfm-close.v94-moved { width: 42px !important; height: 42px !important; font-size: 1.6rem !important; }
    body #xb-fm-modal .xb-modal-body { min-height: 30vh !important; }
    .xfm-icon-strip-item img { width: 36px; height: 36px; }
    .xfm-icon-strip { gap: 3px; padding: 8px 10px; }
    .xfm-icon-strip-label { font-size: 0.6rem; max-width: 44px; }
    .xb-sc-cost-hint { font-size: 0.7rem !important; padding: 0 3px !important; }
}
