﻿:root {
    --ib-admin-bg: rgba(15, 23, 42, 0.32);
    --ib-admin-bg-strong: rgba(15, 23, 42, 0.50);
    --ib-admin-bg-hover: rgba(15, 23, 42, 0.96);
    --ib-admin-border: rgba(255, 255, 255, 0.16);
    --ib-admin-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    --ib-admin-text: #ffffff;
    --ib-warning: #f59e0b;
    --ib-warning-2: #d97706;
    --ib-success: #12b76a;
    --ib-success-2: #039855;
    --ib-danger: #f04438;
    --ib-danger-2: #d92d20;
    --ib-info: #2e90fa;
    --ib-info-2: #1570ef;
}

#header,
#left,
#right,
#main,
#bottom {
    position: relative !important;
    box-sizing: border-box;
}

/* Editor / Admin */
#AdminPanel,
.ib-admin-panel {
    position: fixed !important;
    top: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 100000 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: fit-content !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 !important;
    padding: 6px 8px !important;
    background: var(--ib-admin-bg-strong) !important;
    border: 1px solid var(--ib-admin-border) !important;
    border-radius: 999px !important;
    box-shadow: var(--ib-admin-shadow) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0.40;
    transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease !important;
}

    #AdminPanel:hover,
    .ib-admin-panel:hover {
        opacity: 1 !important;
        background: var(--ib-admin-bg-hover) !important;
        transform: translateX(-50%) translateY(1px) !important;
    }

/* Page level source tools only */
#Header_show {
    position: fixed !important;
    top: 50px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: fit-content !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    background: var(--ib-admin-bg) !important;
    border: 1px solid var(--ib-admin-border) !important;
    border-radius: 999px !important;
    box-shadow: var(--ib-admin-shadow) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0.18;
    transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease !important;
}

body.ib-editor-on #Header_show:hover {
    opacity: 1 !important;
    background: var(--ib-admin-bg-hover) !important;
    transform: translateX(-50%) translateY(1px) !important;
}

/* Layer menus: very subtle until layer hover */
#Top_show,
#Left_show,
#Right_show,
#Main_show,
#Bottom_show,
#Script_show,
#CSS_show,
.ib-layer-code-panel {
    position: absolute !important;
    z-index: 9998 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: fit-content !important;
    max-width: calc(100% - 16px) !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    background: var(--ib-admin-bg) !important;
    border: 1px solid var(--ib-admin-border) !important;
    border-radius: 999px !important;
    box-shadow: var(--ib-admin-shadow) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0.10;
    transform-origin: center center;
    transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease !important;
}

/* Position each panel inside its own layer */

/* Core Top / Top: header left top */
#Top_show {
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    transform: scale(0.98) !important;
}

/* Core Main / Main: main center top */
#Main_show {
    top: 8px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) scale(0.98) !important;
}

/* Core Bottom / Bottom: bottom center top */
#Bottom_show {
    top: 8px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) scale(0.98) !important;
}

/* Core Left / Left: left layer top left */
#Left_show {
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    transform: scale(0.98) !important;
}

/* Core Right / Right: right layer top right */
#Right_show {
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    transform: scale(0.98) !important;
}

/* Only clear when that layer is hovered */
body.ib-editor-on #header:hover #Top_show,
body.ib-editor-on #main:hover #Main_show,
body.ib-editor-on #bottom:hover #Bottom_show,
body.ib-editor-on #left:hover #Left_show,
body.ib-editor-on #right:hover #Right_show {
    opacity: 1 !important;
    background: var(--ib-admin-bg-hover) !important;
}

/* Transform per layer */
body.ib-editor-on #header:hover #Top_show,
body.ib-editor-on #left:hover #Left_show,
body.ib-editor-on #right:hover #Right_show {
    transform: scale(1) !important;
}

body.ib-editor-on #main:hover #Main_show,
body.ib-editor-on #bottom:hover #Bottom_show {
    transform: translateX(-50%) scale(1) !important;
}

/* Also clear when directly hovered */
body.ib-editor-on #Top_show:hover,
body.ib-editor-on #Left_show:hover,
body.ib-editor-on #Right_show:hover,
body.ib-editor-on #Main_show:hover,
body.ib-editor-on #Bottom_show:hover,
body.ib-editor-on #Header_show:hover {
    opacity: 1 !important;
    background: var(--ib-admin-bg-hover) !important;
}

/* Direct hover transform */
body.ib-editor-on #Top_show:hover,
body.ib-editor-on #Left_show:hover,
body.ib-editor-on #Right_show:hover {
    transform: scale(1) !important;
}

body.ib-editor-on #Main_show:hover,
body.ib-editor-on #Bottom_show:hover {
    transform: translateX(-50%) scale(1) !important;
}

/* Hidden state */
.ib-layer-code-panel.is-hidden,
#Header_show.is-hidden,
#Top_show.is-hidden,
#Left_show.is-hidden,
#Right_show.is-hidden,
#Main_show.is-hidden,
#Bottom_show.is-hidden,
#Script_show.is-hidden,
#CSS_show.is-hidden {
    display: none !important;
}

/* Buttons */
.iBadge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 26px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    color: var(--ib-admin-text) !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease !important;
}

    .iBadge:hover,
    .iBadge:focus {
        color: #ffffff !important;
        text-decoration: none !important;
        transform: translateY(-1px);
        filter: brightness(1.05);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 14px rgba(0, 0, 0, 0.18) !important;
    }

    .iBadge:active {
        transform: translateY(0);
        filter: brightness(0.96);
    }

    .iBadge i {
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .iBadge span {
        display: inline-block !important;
        line-height: 1 !important;
    }

/* Colors */
.iBadge-warning,
.badge-warning {
    background: linear-gradient(135deg, var(--ib-warning), var(--ib-warning-2)) !important;
}

.iBadge-success {
    background: linear-gradient(135deg, var(--ib-success), var(--ib-success-2)) !important;
}

.iBadge-danger {
    background: linear-gradient(135deg, var(--ib-danger), var(--ib-danger-2)) !important;
}

.iBadge-info {
    background: linear-gradient(135deg, var(--ib-info), var(--ib-info-2)) !important;
}

/* Old colon text hide */
#Top_show,
#Left_show,
#Right_show,
#Main_show,
#Bottom_show {
    color: transparent !important;
}

    #Top_show .iBadge,
    #Left_show .iBadge,
    #Right_show .iBadge,
    #Main_show .iBadge,
    #Bottom_show .iBadge {
        color: #ffffff !important;
    }

/* Mobile */
@media (max-width: 767.98px) {
    #AdminPanel,
    .ib-admin-panel {
        top: 8px !important;
        max-width: calc(100vw - 16px) !important;
        padding: 6px 7px !important;
        opacity: 0.78 !important;
    }

    #Header_show {
        top: 48px !important;
        max-width: calc(100vw - 16px) !important;
        padding: 5px 6px !important;
        opacity: 0.14 !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
    }

    #Top_show,
    #Left_show,
    #Right_show,
    #Main_show,
    #Bottom_show {
        max-width: calc(100% - 12px) !important;
        padding: 5px 6px !important;
        opacity: 0.08 !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
    }

    #Top_show {
        top: 6px !important;
        left: 6px !important;
        right: auto !important;
        transform: scale(0.98) !important;
    }

    #Main_show,
    #Bottom_show {
        left: 50% !important;
        transform: translateX(-50%) scale(0.98) !important;
    }

    body.ib-editor-on #header:hover #Top_show,
    body.ib-editor-on #Top_show:hover {
        transform: scale(1) !important;
    }

    body.ib-editor-on #main:hover #Main_show,
    body.ib-editor-on #bottom:hover #Bottom_show,
    body.ib-editor-on #Main_show:hover,
    body.ib-editor-on #Bottom_show:hover {
        transform: translateX(-50%) scale(1) !important;
    }

    .iBadge {
        min-height: 26px !important;
        padding: 0 9px !important;
        font-size: 10px !important;
        flex: 0 0 auto !important;
    }
}
