
.wp-block-skylearner-tab-content,
.sltk-tab-content {
    --sltk-tab-selected-bg: #213368;
    --sltk-tab-selected-text: #ffffff;
    --sltk-tab-unselected-bg: #f8fafc;
    --sltk-tab-unselected-text: #0f172a;
    --sltk-tab-read: #16a34a;
    --sltk-tab-unread: #cbd5e1;
    --sltk-tab-sticky-top: 100px;
    --sltk-tab-radius: 12px;
    --sltk-tab-panel-radius: 18px;
    --sltk-tab-border: rgba(15, 23, 42, 0.1);
    --sltk-tab-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --sltk-tab-speed: 180ms;
    margin: 1.25rem 0 2rem;
}

.sltk-tab-content {
    position: relative;
    display: grid;
    gap: 1rem;
}

.sltk-tab-content--vertical {
    grid-template-columns: clamp(168px, 17vw, 208px) minmax(0, 1fr);
    align-items: start;
}

.sltk-tab-content--vertical > .sltk-tab-content__sticky {
    grid-column: 1;
}

.sltk-tab-content--vertical > .sltk-tab-content__content {
    grid-column: 2;
}

.sltk-tab-content__sticky {
    position: sticky;
    top: var(--sltk-tab-sticky-top);
    z-index: 8;
    align-self: start;
    height: fit-content;
}

.sltk-tab-content--js-sticky .sltk-tab-content__sticky.is-fixed {
    position: fixed;
    top: var(--sltk-tab-sticky-top);
    z-index: 30;
}

.sltk-tab-content--js-sticky .sltk-tab-content__sticky.is-at-end {
    position: absolute;
    top: auto;
    bottom: 0;
}

.sltk-tab-content--vertical > .sltk-tab-content__sticky,
.sltk-tab-content--vertical > .sltk-tab-content__content {
    min-width: 0;
}

.sltk-tab-content--horizontal {
    grid-template-columns: minmax(0, 1fr);
}

.sltk-tab-content--horizontal > .sltk-tab-content__sticky,
.sltk-tab-content--horizontal > .sltk-tab-content__content {
    grid-column: 1;
    min-width: 0;
}

.sltk-tab-content--js-horizontal-sticky .sltk-tab-content__sticky {
    width: 100%;
}

.sltk-tab-content--js-horizontal-sticky .sltk-tab-content__content {
    min-width: 0;
}

.sltk-tab-content--horizontal .sltk-tab-content__nav {
    align-items: stretch;
}

.sltk-tab-content--horizontal .sltk-tab-content__tab {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
}

.sltk-tab-content__nav {
    display: flex;
    gap: 0.55rem;
    overflow: auto;
    padding: 0.25rem;
    scrollbar-width: thin;
}

.sltk-tab-content--vertical .sltk-tab-content__nav {
    flex-direction: column;
    max-height: calc(100vh - var(--sltk-tab-sticky-top) - 1rem);
    width: 100%;
}

.sltk-tab-content__tab,
.sltk-tab-content-editor__tab-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 52px;
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--sltk-tab-border);
    border-radius: var(--sltk-tab-radius);
    background: var(--sltk-tab-unselected-bg);
    color: var(--sltk-tab-unselected-text);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: background var(--sltk-tab-speed) ease, color var(--sltk-tab-speed) ease, border-color var(--sltk-tab-speed) ease, box-shadow var(--sltk-tab-speed) ease, transform var(--sltk-tab-speed) ease;
}

.sltk-tab-content__tab:hover,
.sltk-tab-content__tab:focus-visible,
.sltk-tab-content-editor__tab-preview:hover,
.sltk-tab-content-editor__tab-preview:focus-visible {
    border-color: rgba(33, 51, 104, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    outline: none;
}

.sltk-tab-content__tab.is-active,
.sltk-tab-content-editor__tab-preview.is-active {
    background: var(--sltk-tab-selected-bg);
    color: var(--sltk-tab-selected-text);
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(33, 51, 104, 0.18);
}

.sltk-tab-content__tab-indicator,
.sltk-tab-content-editor__tab-indicator {
    width: 4px;
    align-self: stretch;
    border-radius: 999px;
    background: var(--sltk-tab-unread);
    transition: background var(--sltk-tab-speed) ease;
    flex: 0 0 4px;
}

.sltk-tab-content__tab.is-read .sltk-tab-content__tab-indicator {
    background: var(--sltk-tab-read);
}

.sltk-tab-content__tab-label,
.sltk-tab-content-editor__tab-title {
    min-width: 0;
    flex: 1 1 auto;
}

.sltk-tab-content__content {
    min-width: 0;
}

.sltk-tab-content__panel {
    border: 1px solid var(--sltk-tab-border);
    border-radius: var(--sltk-tab-panel-radius);
    background: #ffffff;
    box-shadow: var(--sltk-tab-shadow);
    overflow: clip;
    animation: sltkTabFade var(--sltk-tab-speed) ease;
}

.sltk-tab-content__panel-inner {
    padding: 1.25rem 1.25rem 0.5rem;
}

.sltk-tab-content__panel-footer {
    display: flex;
    justify-content: center;
    padding: 0.4rem 1.25rem 1.25rem;
}

.sltk-tab-content__jump-top {
    border: 0;
    background: transparent;
    color: #213368;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color var(--sltk-tab-speed) ease, opacity var(--sltk-tab-speed) ease;
}

.sltk-tab-content__jump-top:hover,
.sltk-tab-content__jump-top:focus-visible {
    color: #213368;
    opacity: 0.88;
    outline: none;
}

.sltk-tab-content--editor .sltk-tab-content__sticky {
    position: static;
}

.sltk-tab-content--editor,
.sltk-tab-content--editor.sltk-tab-content--vertical,
.sltk-tab-content--editor.sltk-tab-content--horizontal {
    display: block;
    grid-template-columns: none;
}

.sltk-tab-content--editor .block-editor-inner-blocks,
.sltk-tab-content--editor .block-editor-block-list__layout,
.sltk-tab-content--editor .block-editor-block-list__block {
    max-width: 100%;
}

.sltk-tab-content--editor .sltk-tab-content-editor__inner > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-skylearner-tab-pane {
    display: none;
}

.sltk-tab-content--editor .sltk-tab-content-editor__inner > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-skylearner-tab-pane.is-selected,
.sltk-tab-content--editor .sltk-tab-content-editor__inner > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-skylearner-tab-pane.has-child-selected,
.sltk-tab-content--editor .sltk-tab-content-editor__inner > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-skylearner-tab-pane.is-multi-selected,
.sltk-tab-content--editor .sltk-tab-content-editor__inner > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-skylearner-tab-pane.is-reusable {
    display: block;
}

.sltk-tab-content--editor {
    border: 1px solid rgba(33, 51, 104, 0.14);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.sltk-tab-content-editor__shell {
    display: grid;
    min-height: 320px;
}

.sltk-tab-content-editor__shell--vertical {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.sltk-tab-content-editor__shell--horizontal {
    grid-template-columns: 1fr;
}

.sltk-tab-content-editor__sidebar {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.9rem;
}

.sltk-tab-content-editor__shell--horizontal .sltk-tab-content-editor__sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.sltk-tab-content-editor__nav-preview {
    display: flex;
    gap: 0.55rem;
}

.sltk-tab-content-editor__nav-preview--vertical {
    flex-direction: column;
}

.sltk-tab-content-editor__nav-preview--horizontal {
    flex-wrap: wrap;
}

.sltk-tab-content-editor__tab-preview {
    align-items: stretch;
    padding-right: 0.5rem;
}

.sltk-tab-content-editor__tab-title {
    display: block;
    padding: 0.15rem 0;
    white-space: normal;
}

.sltk-tab-content-editor__tab-title[contenteditable="true"]:focus {
    outline: none;
    box-shadow: none;
}

.sltk-tab-content-editor__tab-actions {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}

.sltk-tab-content-editor__icon-button.components-button {
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    color: inherit;
}

.sltk-tab-content-editor__icon-button.components-button.is-destructive {
    color: #b91c1c;
}

.sltk-tab-content-editor__tab-preview.is-active .sltk-tab-content-editor__icon-button.components-button {
    color: inherit;
}

.sltk-tab-content-editor__tab-preview.is-active .sltk-tab-content-editor__icon-button.components-button.is-destructive {
    color: #fecaca;
}

.sltk-tab-content-editor__add-tab {
    min-height: 48px;
    border-radius: 12px;
    justify-content: center;
}

.sltk-tab-content-editor__content-wrap {
    min-width: 0;
    background: #ffffff;
}

.sltk-tab-content-editor__content-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.sltk-tab-content-editor__content-heading strong {
    font-size: 1rem;
}

.sltk-tab-content-editor__content-heading span {
    color: #475569;
    font-size: 0.92rem;
}

.sltk-tab-content-editor__inner {
    padding: 0 1rem 1rem;
}

.sltk-tab-pane-editor {
    margin-top: 1rem;
    border: 1px solid var(--sltk-tab-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.sltk-tab-pane-editor__header {
    padding: 0.95rem 1rem 0.45rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.sltk-tab-pane-editor__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.sltk-tab-pane-editor__body {
    padding: 1rem;
}

.sltk-tab-content-editor__colors {
    display: grid;
    gap: 0.75rem;
}

.sltk-tab-content-editor__color-label {
    margin: 0 0 0.4rem;
    font-weight: 600;
}

@keyframes sltkTabFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
    .sltk-tab-content,
    .sltk-tab-content--vertical,
    .sltk-tab-content--horizontal,
    .sltk-tab-content-editor__shell,
    .sltk-tab-content-editor__shell--vertical,
    .sltk-tab-content-editor__shell--horizontal {
        grid-template-columns: 1fr;
    }

    .sltk-tab-content--vertical > .sltk-tab-content__sticky,
    .sltk-tab-content--vertical > .sltk-tab-content__content,
    .sltk-tab-content--horizontal > .sltk-tab-content__sticky,
    .sltk-tab-content--horizontal > .sltk-tab-content__content {
        grid-column: 1 / -1;
    }

    .sltk-tab-content__sticky,
    .sltk-tab-content__content {
        width: 100%;
        max-width: 100%;
    }

    .sltk-tab-content__sticky {
        position: sticky;
        left: 0 !important;
    }

    .sltk-tab-content--js-sticky .sltk-tab-content__sticky.is-fixed,
    .sltk-tab-content--js-sticky .sltk-tab-content__sticky.is-at-end {
        left: 0 !important;
        right: auto;
    }

    .sltk-tab-content__nav,
    .sltk-tab-content--vertical .sltk-tab-content__nav,
    .sltk-tab-content--horizontal .sltk-tab-content__nav {
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: none;
        white-space: normal;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
    }

    .sltk-tab-content__tab,
    .sltk-tab-content--horizontal .sltk-tab-content__tab,
    .sltk-tab-content-editor__tab-preview {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sltk-tab-content-editor__nav-preview,
    .sltk-tab-content-editor__nav-preview--vertical,
    .sltk-tab-content-editor__nav-preview--horizontal {
        flex-direction: row;
        flex-wrap: nowrap;
        max-height: none;
        white-space: nowrap;
        overflow-x: auto;
        padding-bottom: 0.4rem;
    }

    .sltk-tab-content-editor__tab-preview {
        min-width: min(78vw, 320px);
    }

    .sltk-tab-content-editor__sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    }

    .sltk-tab-content-editor__content-heading {
        flex-direction: column;
        align-items: flex-start;
    }
}


@media (max-width: 1024px) and ((orientation: portrait) or (max-height: 820px)) {
    .sltk-tab-content__nav,
    .sltk-tab-content--vertical .sltk-tab-content__nav,
    .sltk-tab-content--horizontal .sltk-tab-content__nav {
        align-items: flex-start;
    }

    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed.sltk-tab-content--horizontal .sltk-tab-content__tab {
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        overflow: hidden;
        white-space: nowrap;
        transition: width var(--sltk-tab-speed) ease, max-width var(--sltk-tab-speed) ease, background var(--sltk-tab-speed) ease, color var(--sltk-tab-speed) ease, border-color var(--sltk-tab-speed) ease, box-shadow var(--sltk-tab-speed) ease, transform var(--sltk-tab-speed) ease;
    }

    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab-label {
        width: 0;
        opacity: 0;
        overflow: hidden;
        white-space: nowrap;
        transition: opacity var(--sltk-tab-speed) ease, width var(--sltk-tab-speed) ease;
    }

    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab.is-peek-expanded,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab:hover,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab:focus-visible,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab:focus {
        width: min(78vw, 280px);
        max-width: min(78vw, 280px);
        z-index: 2;
    }

    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab.is-peek-expanded .sltk-tab-content__tab-label,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab:hover .sltk-tab-content__tab-label,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab:focus-visible .sltk-tab-content__tab-label,
    .sltk-tab-content.sltk-tab-content--narrow-sticky-collapsed .sltk-tab-content__tab:focus .sltk-tab-content__tab-label {
        width: auto;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sltk-tab-content__tab,
    .sltk-tab-content__panel,
    .sltk-tab-content__jump-top,
    .sltk-tab-content-editor__tab-preview {
        transition: none;
        animation: none;
    }

    html:focus-within {
        scroll-behavior: auto;
    }
}
