@import url('../../../Shared/css/layout-blueprint.css');

/* Feature-specific styles for Skoladmin flytta till V2. */
.tab-content { display: none; }
.tab-content.is-active { display: block; }
.sub-tab-content { display: none; }
.sub-tab-content.is-active { display: block; }
.is-hidden { display: none !important; }

:focus-visible {
    outline: 2px solid var(--vklass-focus, #1976d2);
    outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:focus-visible,
input:focus-visible {
    outline-offset: 2px;
}

.vk-layout[inert] { pointer-events: none; }

.sr-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    color: #26418f;
    background: var(--white, #fff);
}

.skoladmin-page,
.admin-content-container,
.selector-main {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}

.v2-page-header,
.selector-hero,
.admin-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    background: var(--v2-surface, var(--white));
    border: 1px solid var(--v2-border, var(--gray-lighter));
    border-radius: var(--v2-radius-lg, 6px);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.v2-page-header h1,
.selector-hero h1,
.admin-card__title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--v2-text, var(--gray-darker));
}

.v2-page-intro,
.selector-hero p,
.admin-hero p {
    margin: 0;
    color: var(--v2-text-muted, var(--gray-dark));
    max-width: 760px;
}

.v2-breadcrumb {
    margin: 0 0 8px;
    color: var(--v2-text-muted, var(--gray-dark));
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.migration-kpi {
    min-width: 142px;
    border-left: 1px solid var(--v2-border, var(--gray-lighter));
    padding-left: 20px;
    color: var(--v2-text-muted, var(--gray-dark));
}

.migration-kpi strong {
    display: block;
    font-size: 2rem;
    color: var(--v2-primary, var(--cl-hard));
    line-height: 1;
}

.context-strip,
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
}

.v2-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--v2-border, var(--gray-lighter));
    margin: 16px 0;
}

.v2-tab {
    appearance: none;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #4b5563;
    padding: 10px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
}

.v2-tab.is-active,
.v2-tab[aria-selected="true"] {
    color: var(--v2-primary, var(--cl-hard));
    border-bottom-color: var(--v2-primary, var(--cl-hard));
}

.filter-chip {
    border: 1px solid var(--v2-border-strong, var(--gray-light));
    background: var(--v2-surface, var(--white));
    color: var(--v2-text, var(--gray-darker));
    border-radius: 18px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: .875rem;
}

.filter-chip.is-active,
.filter-chip[aria-pressed="true"] {
    background: var(--cl-super-soft, #e8eaf6);
    border-color: var(--cl-soft, #7986cb);
    color: var(--cl-hard, #26418f);
    font-weight: 500;
}

.v2-table-card,
.v2-card,
.role-card {
    background: var(--v2-surface, var(--white));
    border: 1px solid var(--v2-border, var(--gray-lighter));
    border-radius: var(--v2-radius-lg, 6px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.v2-table-card {
    overflow-x: auto;
    margin-bottom: 18px;
}

.v2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.v2-table th,
.v2-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--v2-border, var(--gray-lighter));
    text-align: left;
    vertical-align: top;
}

.v2-table th {
    color: #4b5563;
    font-weight: 500;
    background: var(--v2-surface-subtle, var(--gray-lightest));
    white-space: nowrap;
}

.v2-table tbody tr:hover {
    background: var(--cl-super-soft, #e8eaf6);
}

.v2-card {
    padding: 18px;
    margin-bottom: 16px;
}

.v2-card h2 {
    margin-top: 0;
    font-size: 1.125rem;
    font-weight: 500;
}

.v2-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.v2-note {
    color: var(--v2-text-muted, var(--gray-dark));
    margin-bottom: 14px;
}

.v2-btn,
.mdc-button.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    border-radius: 4px;
    border: 1px solid transparent;
    padding: 7px 14px;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.v2-btn--primary { background: var(--v2-primary, #0b74de); color: #fff; }
.v2-btn--secondary { background: var(--v2-surface, #fff); color: var(--v2-primary, #0b74de); border-color: var(--v2-border-strong, #c5cedb); }
.v2-btn--danger { background: var(--v2-danger, #c53030); color: #fff; }

.vk-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: .75rem;
    font-weight: 500;
    white-space: nowrap;
}

.vk-badge.positive { background: #e6f4ea; color: #137333; }
.vk-badge.pending { background: #fff7e6; color: #9a5b00; }
.vk-badge.negative { background: #fdeaea; color: #a32525; }
.vk-badge.neutral { background: var(--cl-super-soft, #e8eaf6); color: var(--cl-hard, #26418f); }

.selector-toolbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--v2-surface, #fff);
    border-bottom: 1px solid var(--v2-border, #d8dee8);
}

.selector-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.role-card {
    display: block;
    padding: 20px;
    color: inherit;
    text-decoration: none;
}

.role-card:hover,
.role-card:focus-visible {
    border-color: var(--v2-primary, #0b74de);
    box-shadow: 0 4px 14px rgba(11, 116, 222, .15);
}

.role-card .material-icons {
    color: var(--v2-primary, #0b74de);
    font-size: 32px;
}

.role-card h2 {
    margin: 12px 0 8px;
    font-size: 1.125rem;
}

.role-card p {
    margin: 0;
    color: var(--v2-text-muted, #64748b);
}

.mockup-demo {
    margin-bottom: 20px;
}

.mockup-demo__video {
    display: block;
    width: 100%;
    border-radius: var(--v2-radius-lg, 6px);
    border: 1px solid var(--v2-border, var(--gray-lighter));
    background: #000;
}

.mockup-demo__transcript {
    margin-top: 10px;
}

.mockup-demo__transcript pre {
    white-space: pre-wrap;
    background: var(--v2-surface-subtle, var(--gray-lightest));
    border: 1px solid var(--v2-border, var(--gray-lighter));
    border-radius: var(--v2-radius, 4px);
    padding: 12px;
    font-family: inherit;
    font-size: 0.875rem;
}

.admin-card.admin-hero {
    display: block;
}

.admin-submenu-item {
    color: #26418f;
}

html[data-mockup-theme="vklassv2"] .v2-table th,
html[data-mockup-theme="vklassv2"] .v2-table thead th {
    color: #374151 !important;
}

html[data-mockup-theme="vklassv2"] .v2-tab {
    color: #374151 !important;
}

html[data-mockup-theme="vklassv2"] .v2-tab.is-active,
html[data-mockup-theme="vklassv2"] .v2-tab[aria-selected="true"] {
    color: var(--v2-primary, #0b74de) !important;
}

html[data-mockup-theme="vklassv2"] .admin-submenu-item {
    color: #26418f !important;
}

.admin-hero .admin-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.vk-dialog .mdc-dialog__surface {
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.vk-dialog .mdc-dialog__content {
    min-height: 0;
    overflow-y: auto;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.vk-dialog .mdc-dialog__actions {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

body.dark-mode .v2-table tbody tr:hover {
    background: rgba(121, 134, 203, .18);
}

body.dark-mode .role-card:hover,
body.dark-mode .role-card:focus-visible {
    box-shadow: 0 4px 14px rgba(121, 134, 203, .18);
}

@media (max-width: 760px) {
    .v2-page-header,
    .selector-hero,
    .admin-hero .admin-card__header {
        flex-direction: column;
    }
    .migration-kpi {
        border-left: 0;
        border-top: 1px solid var(--v2-border, var(--gray-lighter));
        padding-left: 0;
        padding-top: 12px;
        width: 100%;
    }
    .v2-tabs {
        overflow-x: auto;
    }
}
