/* classroom product shell: shared tokens, chrome, controls, dark mode, and performance defaults. */

:root {
    --page-bg: #f2f6fb;
    --surface: #ffffff;
    --surface-2: #edf3fa;
    --surface-3: #dfeaf5;
    --text: #152033;
    --muted: #5a6d85;
    --muted-2: #7d8fa3;
    --border: #cfdcec;
    --border-strong: #a8bdd3;
    --blue: #1a6dff;
    --blue-dark: #1252c4;
    --blue-soft: #e8f1ff;
    --green: #0a9f72;
    --green-soft: #e7f7f1;
    --amber: #b46e11;
    --amber-soft: #fff2d6;
    --red: #d14343;
    --red-soft: #fff0ef;
    --violet: #7164cf;
    --pink: #d95f76;
    --pink-soft: #fff0f3;
    --ink-soft: #25324a;
    --radius: 8px;
    --radius-sm: 6px;
    --page-x: clamp(0.5rem, 1.2vw, 1rem);
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
    --shadow: none;
    --shadow-soft: none;
}

html[data-theme="dark"] {
    --page-bg: #071018;
    --surface: #09121a;
    --surface-2: #0d1d29;
    --surface-3: #112b3d;
    --text: #f5fbff;
    --muted: #b7c8d9;
    --muted-2: #8fa6b8;
    /* Use dark-mode optimized blue and border tokens */
    --border: #1b2a3a;
    --border-strong: #263e58;
    --blue: #2f81f7;
    --blue-dark: #1f6feb;
    --blue-soft: rgba(47, 129, 247, 0.15);
    --green: #70efbd;
    --green-soft: rgba(112, 239, 189, 0.12);
    --amber: #ffd866;
    --amber-soft: rgba(255, 216, 102, 0.12);
    --red: #ff987a;
    --red-soft: rgba(255, 152, 122, 0.12);
    --violet: #b8a8ff;
    --pink: #ff9fc4;
    --pink-soft: rgba(255, 159, 196, 0.12);
    --ink-soft: #f5fbff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    letter-spacing: 0 !important;
}

html {
    color-scheme: light dark;
    background: var(--page-bg);
}

body {
    margin: 0;
    background: var(--page-bg) !important;
    color: var(--text);
    font-family: var(--font-sans);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ui-shell {
    min-height: 100vh;
    background: var(--page-bg);
}

.hidden {
    display: none !important;
}

.workspace-page,
.landing-page {
    min-height: 100vh;
    background: var(--page-bg) !important;
    background-image: none !important;
    color: var(--text);
}

.classroom-logo {
    position: relative;
    display: inline-grid;
    gap: 0.16rem;
    width: max-content;
    color: var(--text) !important;
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 440 !important;
    line-height: 1;
    text-decoration: none;
    text-transform: lowercase;
}

.classroom-logo::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--blue);
}

.workspace-header,
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 3.15rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, var(--page-bg)) !important;
    background-image: none !important;
    box-shadow: none !important;
    padding: 0.38rem var(--page-x);
}

html[data-theme="dark"] .workspace-header,
html[data-theme="dark"] .site-nav {
    border-bottom-color: var(--border);
    background: rgba(7, 16, 24, 0.74) !important;
    backdrop-filter: blur(18px);
}

.workspace-header h1,
.dashboard-header-title h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-brand-cluster,
.dashboard-header-title,
.header-actions,
.nav-actions {
    min-width: 0;
}

.workspace-brand-cluster,
.header-actions,
.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.workspace-brand-cluster {
    align-items: baseline;
}

.workspace-brand-cluster > span,
.dashboard-header-title > span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 820;
    text-transform: uppercase;
}

.dashboard-header-title {
    display: grid;
    justify-items: center;
    line-height: 1.08;
}

.btn-primary,
.btn-secondary,
.text-button,
.icon-button,
.course-action-btn,
.panel-icon-button,
.calendar-complete,
.resume-course-btn,
.catalog-enroll-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-height: 2.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    background-image: none !important;
    color: var(--text) !important;
    box-shadow: none !important;
    padding: 0.46rem 0.68rem;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}

.btn-primary,
.course-action-btn.primary,
.resume-course-btn,
.calendar-complete,
.catalog-enroll-btn:not(.secondary) {
    border-color: var(--blue) !important;
    background: var(--blue) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .course-action-btn.primary,
html[data-theme="dark"] .resume-course-btn,
html[data-theme="dark"] .calendar-complete,
html[data-theme="dark"] .catalog-enroll-btn:not(.secondary) {
    color: #06111b !important;
}

.btn-secondary:hover,
.text-button:hover,
.icon-button:hover,
.course-action-btn:hover,
.panel-icon-button:hover,
.catalog-enroll-btn.secondary:hover {
    border-color: color-mix(in srgb, var(--blue) 58%, var(--border)) !important;
    background: var(--blue-soft) !important;
    color: var(--blue-dark) !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .course-action-btn,
html[data-theme="dark"] .panel-icon-button,
html[data-theme="dark"] .catalog-enroll-btn.secondary,
html[data-theme="dark"] .icon-button {
    border-color: var(--border-strong) !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .text-button:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .course-action-btn:hover,
html[data-theme="dark"] .panel-icon-button:hover,
html[data-theme="dark"] .catalog-enroll-btn.secondary:hover {
    border-color: color-mix(in srgb, var(--blue) 68%, var(--border-strong)) !important;
    background: color-mix(in srgb, var(--blue-soft) 72%, var(--surface-2)) !important;
    color: var(--blue-dark) !important;
}

.btn-primary:hover,
.course-action-btn.primary:hover,
.resume-course-btn:hover,
.calendar-complete:hover,
.catalog-enroll-btn:not(.secondary):hover {
    border-color: var(--blue-dark) !important;
    background: var(--blue-dark) !important;
}

.text-button {
    border-color: transparent !important;
    background: transparent !important;
    color: var(--blue) !important;
    padding-inline: 0.25rem;
}

.icon-button,
.panel-icon-button {
    width: 2.1rem;
    padding: 0 !important;
}

.input-field,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    min-height: 2.35rem;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    background-image: none !important;
    color: var(--text) !important;
    box-shadow: none !important;
    padding: 0.52rem 0.62rem;
    outline: none;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-2);
}

.input-field:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue) !important;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

html[data-theme="dark"] :focus-visible {
    outline-color: var(--blue-dark);
}

.surface-panel,
.portal-hero-card,
.side-panel,
.empty-state,
.active-course-card,
.portal-course-card,
.catalog-hero-panel,
.catalog-card,
.catalog-empty,
.creator-main-panel,
.creator-side-panel > section,
.studio-rail-card,
.course-command,
.product-preview,
.feature-band article,
.sample-course-card,
.auth-dialog {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .surface-panel,
html[data-theme="dark"] .portal-hero-card,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .active-course-card,
html[data-theme="dark"] .portal-course-card,
html[data-theme="dark"] .catalog-hero-panel,
html[data-theme="dark"] .catalog-card,
html[data-theme="dark"] .catalog-empty,
html[data-theme="dark"] .creator-main-panel,
html[data-theme="dark"] .creator-side-panel > section,
html[data-theme="dark"] .studio-rail-card,
html[data-theme="dark"] .course-command,
html[data-theme="dark"] .product-preview,
html[data-theme="dark"] .feature-band article,
html[data-theme="dark"] .sample-course-card,
html[data-theme="dark"] .auth-dialog {
    border-color: var(--border) !important;
    background: color-mix(in srgb, var(--surface) 94%, #000000) !important;
}

.kicker,
.course-kicker,
.catalog-kicker,
.eyebrow,
.control-label {
    color: var(--blue) !important;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.streak-pill,
.progress-pill,
.section-title-row span,
.status-pill,
.soft-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    padding: 0 0.55rem;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.muted-list {
    color: var(--muted);
    font-size: 0.86rem;
}

.smart-empty-state,
.empty-state,
.catalog-empty {
    border-style: dashed !important;
    border-color: var(--border-strong) !important;
    background: var(--surface-2) !important;
    text-align: center;
}

.loader-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
}

.theme-changing * {
    transition: none !important;
}

.perf-ready .surface-panel,
.perf-ready .portal-course-card,
.perf-ready .catalog-card,
.perf-ready .course-panel,
.perf-ready .rendered-graph {
    backface-visibility: hidden;
}

@media (max-width: 720px) {
    .workspace-header,
    .site-nav {
        flex-wrap: wrap;
        align-items: center;
    }

    .header-actions,
    .nav-actions {
        overflow-x: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Keep utility visibility stronger than component display declarations. */
.hidden,
[hidden] {
    display: none !important;
}

/* Product density layer: compact by default, still readable. */
.workspace-header,
.site-nav {
    min-height: 2.7rem;
    padding-block: 0.28rem;
}

.btn-primary,
.btn-secondary,
.text-button,
.icon-button,
.course-action-btn,
.panel-icon-button,
.calendar-complete,
.resume-course-btn,
.catalog-enroll-btn {
    min-height: 1.9rem;
    padding: 0.36rem 0.56rem;
    font-size: 0.76rem;
}

.icon-button,
.panel-icon-button {
    width: 1.95rem;
}

.input-field,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    min-height: 2.12rem;
    padding: 0.42rem 0.54rem;
}

.streak-pill,
.progress-pill,
.section-title-row span,
.status-pill,
.soft-pill {
    min-height: 1.7rem;
    padding-inline: 0.45rem;
    font-size: 0.72rem;
}

/* Soft control finish: rounded, compact, and still cheap to render. */
:root {
    --radius: 14px;
    --radius-sm: 10px;
    --control-radius: 999px;
}

.btn-primary,
.btn-secondary,
.text-button,
.icon-button,
.course-action-btn,
.panel-icon-button,
.calendar-complete,
.resume-course-btn,
.catalog-enroll-btn {
    min-height: 2.05rem;
    border-radius: var(--control-radius) !important;
    padding: 0.42rem 0.72rem;
    font-size: 0.78rem;
}

.btn-secondary,
.course-action-btn,
.panel-icon-button,
.catalog-enroll-btn.secondary {
    background: var(--surface-2) !important;
}

.icon-button,
.panel-icon-button,
.delete-course-btn {
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px !important;
}

.input-field,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    min-height: 2.18rem;
    border-radius: 12px !important;
}

.surface-panel,
.portal-hero-card,
.side-panel,
.empty-state,
.active-course-card,
.portal-course-card,
.catalog-hero-panel,
.catalog-card,
.catalog-empty,
.creator-main-panel,
.creator-side-panel > section,
.studio-rail-card,
.course-command,
.product-preview,
.feature-band article,
.sample-course-card,
.auth-dialog {
    border-radius: var(--radius) !important;
}

.streak-pill,
.progress-pill,
.section-title-row span,
.status-pill,
.soft-pill {
    border-radius: 999px !important;
}

/* Premium app backdrop: subtle structure without heavy effects. */
.workspace-page,
.landing-page {
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    background-color: var(--page-bg) !important;
    background-image:
        linear-gradient(90deg, color-mix(in srgb, var(--blue) 10%, transparent) 1px, transparent 1px),
        linear-gradient(0deg, color-mix(in srgb, var(--green) 8%, transparent) 1px, transparent 1px),
        linear-gradient(135deg, color-mix(in srgb, var(--blue-soft) 72%, transparent) 0 18rem, transparent 18rem 100%) !important;
    background-position: center top, center top, left top;
    background-size: 42px 42px, 42px 42px, 100% 24rem;
}

.workspace-page::before,
.landing-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 8%, color-mix(in srgb, var(--blue-soft) 88%, transparent) 8% 17%, transparent 17% 100%),
        linear-gradient(155deg, transparent 0 62%, color-mix(in srgb, var(--green-soft) 78%, transparent) 62% 76%, transparent 76% 100%),
        linear-gradient(35deg, transparent 0 74%, color-mix(in srgb, var(--amber-soft) 64%, transparent) 74% 84%, transparent 84% 100%);
}

.workspace-page > *,
.landing-page > * {
    position: relative;
    z-index: 1;
}

html[data-theme="dark"] .workspace-page,
html[data-theme="dark"] .landing-page {
    background-color: var(--page-bg) !important;
    background-image:
        linear-gradient(90deg, rgba(125, 211, 252, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(134, 239, 172, 0.04) 1px, transparent 1px),
        linear-gradient(135deg, rgba(21, 50, 74, 0.58) 0 18rem, transparent 18rem 100%) !important;
}

html[data-theme="dark"] .workspace-page::before,
html[data-theme="dark"] .landing-page::before {
    background:
        linear-gradient(115deg, transparent 0 9%, rgba(125, 211, 252, 0.055) 9% 16%, transparent 16% 100%),
        linear-gradient(155deg, transparent 0 68%, rgba(134, 239, 172, 0.04) 68% 79%, transparent 79% 100%);
}

/* Dark-mode button contrast: cyan fills need dark ink, not white. */
html[data-theme="dark"] :is(.btn-primary, .course-action-btn.primary, .resume-course-btn, .calendar-complete, .catalog-enroll-btn:not(.secondary)),
html[data-theme="dark"] :is(.btn-primary, .course-action-btn.primary, .resume-course-btn, .calendar-complete, .catalog-enroll-btn:not(.secondary)):hover,
html[data-theme="dark"] :is(.btn-primary, .course-action-btn.primary, .resume-course-btn, .calendar-complete, .catalog-enroll-btn:not(.secondary)):focus-visible {
    border-color: color-mix(in srgb, var(--blue) 54%, var(--border)) !important;
    background: var(--blue) !important;
    color: #06111b !important;
}

html[data-theme="dark"] :is(.btn-primary, .course-action-btn.primary, .resume-course-btn, .calendar-complete, .catalog-enroll-btn:not(.secondary)) :is(span, strong, em, svg) {
    color: #06111b !important;
}

/* Source material UI: compact in sidebars, full enough in creator/dashboard. */
.muted-list,
.materials-compact-list {
    display: grid;
    gap: 0.46rem;
}

.material-row {
    display: grid !important;
    grid-template-columns: 2.35rem minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.55rem !important;
    min-width: 0;
    min-height: 3.7rem;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
    padding: 0.52rem !important;
}

.material-row-compact {
    grid-template-columns: 2.1rem minmax(0, 1fr) auto !important;
    min-height: 3.35rem;
    padding: 0.45rem !important;
}

.material-file-icon {
    display: inline-grid;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 42%, var(--border));
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
}

.material-row-copy {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
}

.material-row-copy strong,
.material-row-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-row-copy strong {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 820;
    line-height: 1.15;
}

.material-row-copy span {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.2;
}

.material-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.material-study,
.material-delete {
    width: 2rem !important;
    height: 2rem !important;
    min-height: 2rem !important;
    border-radius: 999px !important;
    padding: 0 !important;
}

.material-delete {
    border-color: color-mix(in srgb, var(--red) 32%, var(--border)) !important;
    background: var(--red-soft) !important;
    color: var(--red) !important;
}

.materials-empty-state,
.materials-empty-preview {
    display: grid;
    gap: 0.36rem;
    min-width: 0;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--muted);
    padding: 0.76rem;
}

.materials-empty-preview {
    min-height: 8.4rem;
    align-content: center;
}

.materials-empty-state span,
.materials-empty-preview span {
    color: var(--blue);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.materials-empty-state strong,
.materials-empty-preview strong {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.18;
}

.materials-empty-state p,
.materials-empty-preview p {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.materials-empty-preview .text-button {
    justify-self: start;
    min-height: auto;
    padding-block: 0.12rem;
}

.material-panel-focus {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

html[data-theme="dark"] .material-row,
html[data-theme="dark"] .materials-empty-state,
html[data-theme="dark"] .materials-empty-preview {
    border-color: var(--border);
    background: var(--surface-2) !important;
}

html[data-theme="dark"] .material-file-icon {
    color: var(--blue-dark);
}
