/* =============================================
   DevSector Sliding Tabs — Frontend Styles v7
   ============================================= */

/* ============================================================
   MODE A — FLOATING
   ============================================================ */

.dst-position-group {
    position: fixed;
    z-index: 99999;
    display: flex;
    gap: 12px;
}

.dst-pos-bottom-right {
    bottom: 28px;
    right: 28px;
    flex-direction: column-reverse;
    align-items: flex-end;
}

.dst-pos-bottom-left {
    bottom: 28px;
    left: 28px;
    flex-direction: column-reverse;
    align-items: flex-start;
}

.dst-pos-top-right {
    top: 28px;
    right: 28px;
    flex-direction: column;
    align-items: flex-end;
}

.dst-pos-top-left {
    top: 28px;
    left: 28px;
    flex-direction: column;
    align-items: flex-start;
}

.dst-mode-floating {
    position: relative;
    display: flex;
    align-items: center;
}

.dst-pos-bottom-right .dst-mode-floating,
.dst-pos-top-right .dst-mode-floating {
    flex-direction: row-reverse;
}

.dst-pos-bottom-left .dst-mode-floating,
.dst-pos-top-left .dst-mode-floating {
    flex-direction: row;
}

.dst-toggle-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--dst-tab-color, #2563eb);
    color: var(--dst-icon-color, #ffffff);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    transition: box-shadow .15s ease, transform .15s ease;
}

.dst-toggle-btn:hover {
    box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
    transform: translateY(-2px);
}

.dst-toggle-btn:active {
    transform: translateY(0);
}

.dst-toggle-btn:focus-visible {
    outline: 3px solid var(--dst-tab-color, #2563eb);
    outline-offset: 3px;
}

.dst-toggle-btn .dst-icon {
    transition: opacity .12s ease;
}

.dst-toggle-btn .dst-close-icon {
    position: absolute;
    opacity: 0;
    transition: opacity .12s ease;
}

.dst-mode-floating.is-open .dst-toggle-btn .dst-icon {
    opacity: 0;
}

.dst-mode-floating.is-open .dst-toggle-btn .dst-close-icon {
    opacity: 1;
}

.dst-mode-floating .dst-panel {
    background: var(--dst-panel-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .16), 0 2px 8px rgba(0, 0, 0, .08);
    min-width: 240px;
    max-width: 320px;
    width: max-content;
    overflow: hidden;
    margin: 0 12px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: scale(.94);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

.dst-pos-bottom-right .dst-mode-floating .dst-panel,
.dst-pos-top-right .dst-mode-floating .dst-panel {
    transform-origin: right center;
}

.dst-pos-bottom-left .dst-mode-floating .dst-panel,
.dst-pos-top-left .dst-mode-floating .dst-panel {
    transform-origin: left center;
}

.dst-mode-floating.is-open .dst-panel {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    visibility: visible;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
}

/* ============================================================
   MODE B — STICKY EDGE

   Group = fixed column at the screen edge (right:0 / left:0).
   Each tab = [icon-btn][body] (right) or [body][icon-btn] (left).
   The BODY starts at max-width:0 (hidden) and expands to 280px on open.
   The icon-btn is always visible at the edge.
   Each tab slides independently.
   ============================================================ */

.dst-sticky-group {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dst-sticky-group-middle {
    transform: translateY(-50%);
}

.dst-sticky-group-right {
    right: 0;
    align-items: flex-end;
}

.dst-sticky-group-left {
    left: 0;
    align-items: flex-start;
}

/* Individual tab row */
.dst-mode-sticky {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.dst-sticky-right {
    flex-direction: row;
    /* [icon][body→] */
    border-radius: 12px 0 0 12px;
    box-shadow: -3px 3px 24px rgba(0, 0, 0, .22);
}

.dst-sticky-left {
    flex-direction: row;
    /* [←body][icon] */
    border-radius: 0 12px 12px 0;
    box-shadow: 3px 3px 24px rgba(0, 0, 0, .22);
}

/* Icon tab — always visible */
.dst-sticky-tab-btn {
    width: var(--dst-tab-width, 48px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: var(--dst-tab-color, #2563eb);
    color: var(--dst-icon-color, #ffffff);
    font-size: 20px;
    padding: 18px 0;
    transition: filter .15s ease;
}

.dst-sticky-tab-btn:hover {
    filter: brightness(.88);
}

.dst-sticky-tab-btn:focus-visible {
    outline: 3px solid var(--dst-tab-color, #2563eb);
    outline-offset: -3px;
}

/* Body — collapses to 0 width when closed, expands on open */
.dst-sticky-body {
    max-width: 0;
    overflow: hidden;
    background: var(--dst-panel-bg, #ffffff);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: max-width .32s ease;
}

.dst-mode-sticky.is-open .dst-sticky-body {
    max-width: 280px;
}

/* Inner — fixed width so content doesn't collapse */
.dst-sticky-body-inner {
    width: 280px;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   SHARED — panel content only (no header/close)
   ============================================================ */

.dst-panel-content {
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dst-panel-content p {
    margin: 0 0 8px;
}

.dst-panel-content p:last-child {
    margin-bottom: 0;
}

.dst-panel-content a {
    color: var(--dst-tab-color, #2563eb);
}

.dst-panel-content img {
    max-width: 100%;
    border-radius: 8px;
}

/* Floating panel header (kept for floating only if label exists) */
.dst-mode-floating .dst-panel-header {
    background: var(--dst-tab-color, #2563eb);
    color: var(--dst-icon-color, #ffffff);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: .01em;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {

    .dst-toggle-btn,
    .dst-toggle-btn .dst-icon,
    .dst-toggle-btn .dst-close-icon,
    .dst-mode-floating .dst-panel,
    .dst-sticky-body {
        transition: none !important;
    }
}