:root {
    --gs-primary: #3659d9;
    --gs-ink: #18213d;
}

body {
    color: var(--gs-ink);
    min-height: 100vh;
}

.btn-primary {
    --bs-btn-bg: var(--gs-primary);
    --bs-btn-border-color: var(--gs-primary);
}

.hero {
    background:
        radial-gradient(circle at 80% 15%, rgba(54, 89, 217, .18), transparent 34rem),
        linear-gradient(180deg, #fff 0%, #f5f7ff 100%);
}

.overview-card {
    background: linear-gradient(145deg, #18213d, #293665);
    color: #fff;
}

.status-dot {
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
    background: #49d49d;
    box-shadow: 0 0 0 .4rem rgba(73, 212, 157, .16);
}

.metric {
    display: grid;
    gap: .15rem;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1rem;
    padding: 1rem;
}

.metric strong {
    font-size: 1.45rem;
}

.metric span {
    color: rgba(255, 255, 255, .7);
    font-size: .82rem;
}

.module-card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 2rem rgba(24, 33, 61, .08);
}

.module-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .9rem;
    color: var(--gs-primary);
    background: rgba(54, 89, 217, .1);
    font-weight: 700;
}

.login-card {
    max-width: 32rem;
}

.course-hero {
    background: linear-gradient(135deg, #fff, #eef2ff);
}

.course-card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .75rem 2rem rgba(24, 33, 61, .08);
}

.lesson-content {
    max-width: 52rem;
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: normal;
}

.empty-state {
    max-width: 52rem;
    margin-inline: auto;
}

.teacher-nav .nav-link {
    color: var(--gs-ink);
}

.teacher-nav .nav-link:hover,
.teacher-nav .nav-link:focus {
    color: var(--gs-primary);
    background: rgba(54, 89, 217, .08);
}

.review-score {
    width: 5.5rem;
}

.review-feedback {
    min-width: 12rem;
    flex: 1 1 12rem;
}

.resource-link {
    color: var(--gs-ink);
    background: #fff;
    transition: border-color .2s ease, background .2s ease;
}

.resource-link:hover,
.resource-link:focus {
    color: var(--gs-primary);
    border-color: var(--gs-primary) !important;
    background: rgba(54, 89, 217, .04);
}

.course-builder {
    --builder-border: #dfe4f0;
    --builder-muted: #667085;
    min-height: calc(100vh - 4.5rem);
    background: #f4f6fb;
}

.course-builder + footer {
    display: none;
}

.builder-topbar {
    min-height: 5rem;
    padding: .8rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border-bottom: 1px solid var(--builder-border);
}

.builder-save-state {
    color: var(--builder-muted);
    font-size: .82rem;
}

.builder-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 19rem) minmax(32rem, 1fr) minmax(17rem, 21rem);
    height: calc(100vh - 9.5rem);
    min-height: 42rem;
}

.builder-panel {
    min-width: 0;
    background: #fff;
    border-right: 1px solid var(--builder-border);
    overflow: hidden;
}

.builder-panel-heading {
    min-height: 4.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--builder-border);
}

.builder-outline {
    display: flex;
    flex-direction: column;
}

.builder-outline-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
}

.builder-lesson-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .8rem .65rem;
    color: var(--gs-ink);
    background: transparent;
    border: 0;
    border-radius: .65rem;
}

.builder-lesson-item:hover,
.builder-lesson-item.active {
    background: #edf1ff;
    color: #2947b8;
}

.builder-drag-handle {
    color: #98a2b3;
    cursor: grab;
    letter-spacing: -.25rem;
}

.builder-editor-panel {
    display: flex;
    flex-direction: column;
}

.builder-editor-header {
    padding: .8rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--builder-border);
}

.builder-title-input {
    width: 100%;
    padding: 0 0 .65rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gs-ink);
    border: 0;
    outline: 0;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.editor-toolbar button {
    min-width: 2.25rem;
    min-height: 2rem;
    padding: .25rem .5rem;
    color: #344054;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: .4rem;
    font-size: .78rem;
}

.editor-toolbar button:hover,
.editor-toolbar button:focus {
    color: var(--gs-primary);
    border-color: var(--gs-primary);
}

.builder-editor-scroll,
.builder-settings {
    overflow-y: auto;
}

.builder-editor-scroll {
    flex: 1;
    padding: 1.5rem;
    background: #f8f9fc;
}

.tiptap-host {
    max-width: 58rem;
    min-height: 28rem;
    margin: 0 auto;
    padding: 3rem 3.5rem;
    background: #fff;
    border: 1px solid var(--builder-border);
    border-radius: .8rem;
    box-shadow: 0 .5rem 2rem rgba(24, 33, 61, .06);
}

.tiptap-host .tiptap {
    min-height: 22rem;
    outline: none;
    line-height: 1.75;
}

.tiptap-host .is-editor-empty:first-child::before {
    height: 0;
    float: left;
    color: #98a2b3;
    content: attr(data-placeholder);
    pointer-events: none;
}

.tiptap-host img,
.lesson-content img {
    max-width: 100%;
    height: auto;
}

.tiptap-host table,
.lesson-content table {
    width: 100%;
    border-collapse: collapse;
}

.tiptap-host td,
.tiptap-host th,
.lesson-content td,
.lesson-content th {
    padding: .55rem;
    border: 1px solid #d0d5dd;
}

.tiptap-host pre,
.lesson-content pre {
    padding: 1rem;
    color: #f8fafc;
    background: #18213d;
    border-radius: .5rem;
    overflow-x: auto;
}

.builder-learning-tools {
    max-width: 58rem;
    margin: 1.5rem auto 0;
}

.builder-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .8rem;
    color: var(--gs-ink);
    border-bottom: 1px solid #eaecf0;
}

.builder-list-row:last-child {
    border-bottom: 0;
}

.builder-settings {
    border-right: 0;
}

.builder-side-section {
    padding: 1rem;
    border-top: 1px solid var(--builder-border);
}

.revision-row {
    width: 100%;
    display: grid;
    gap: .1rem;
    padding: .55rem 0;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eaecf0;
}

.revision-row small {
    color: var(--builder-muted);
}

.builder-mobile-tabs {
    padding: .5rem;
    display: flex;
    gap: .5rem;
    background: #fff;
    border-bottom: 1px solid var(--builder-border);
}

@media (max-width: 1199.98px) {
    .builder-grid {
        grid-template-columns: 15rem minmax(28rem, 1fr) 17rem;
    }
}

@media (max-width: 991.98px) {
    .builder-topbar {
        align-items: flex-start;
    }

    .builder-grid {
        display: block;
        height: auto;
        min-height: calc(100vh - 12rem);
    }

    .builder-panel {
        display: none;
        min-height: calc(100vh - 12rem);
        border-right: 0;
    }

    .builder-panel.mobile-active {
        display: flex;
    }

    .builder-editor-panel.mobile-active,
    .builder-settings.mobile-active {
        display: flex;
    }

    .builder-editor-panel,
    .builder-settings {
        display: none;
    }

    .tiptap-host {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .builder-topbar {
        padding: .75rem;
        flex-direction: column;
    }

    .builder-editor-scroll {
        padding: .75rem;
    }

    .tiptap-host {
        min-height: 24rem;
        padding: 1rem;
        border-radius: .5rem;
    }
}
