/* ========== SHARED LAYOUT - TeachComplete ========== */
/* Common styles used across all app pages (sidebar, top banner, page layout) */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    zoom: 0.75;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
}

/* ========== TOP BANNER ========== */

.top-banner {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 48px;
}

/* Left Section - Logo */
.logo-section {
    flex: 0 0 auto;
}

/* TeachComplete Logo Styles */
.tc-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.tc-logo-icon {
    flex-shrink: 0;
}

.tc-logo-wordmark {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #0C1B33;
    white-space: nowrap;
}

.tc-logo-wordmark .tc-accent {
    color: #059669;
}

/* Size variants */
.tc-logo.tc-sm { gap: 8px; }
.tc-logo.tc-sm .tc-logo-wordmark { font-size: 18px; }

.tc-logo.tc-md { gap: 12px; }
.tc-logo.tc-md .tc-logo-wordmark { font-size: 24px; }

/* Middle Section - Navigation */
.nav-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.nav-item {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background-color: #f0f0f0;
    color: #007bff;
}

/* Right Section - Profile */
.profile-section {
    flex: 0 0 auto;
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.profile-icon:hover {
    background-color: #ccc;
}

.profile-icon svg {
    width: 24px;
    height: 24px;
    fill: #666;
}

/* ========== PAGE LAYOUT ========== */

.page-container {
    display: flex;
    height: calc(100vh - 48px);
    margin-top: 48px;
    position: relative;
    overflow: hidden;
}

/* Sidebar Background (extends to bottom) */
.sidebar-background {
    position: fixed;
    left: 0;
    top: 48px;
    bottom: 0;
    width: 240px;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    z-index: 1;
}

/* Left Sidebar — flex column, not absolute-positioned chunks */
.left-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: fixed;
    left: 0;
    top: 48px;
    bottom: 0;
    z-index: 2;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Middle area: flex column. My Classes fills the top (its list scrolls
   internally); the three bottom sections are pinned at the bottom. */
.tc-sidebar-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* My Classes: heading pinned, class list scrolls inside. */
.my-classes-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 8px 0;
}
.my-classes-container .tc-sec-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 6px 8px;
}
/* Collapsed: heading stays, body hides — frees vertical space so
   Shared Classes can grow when expanded. */
.my-classes-container.tc-mc-collapsed { flex: 0 0 auto; }
.my-classes-container.tc-mc-collapsed .tc-sec-body { display: none; }
.my-classes-container.tc-mc-collapsed .tc-sec-head .tc-sec-title::after {
    content: ' ▸';
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
}
.my-classes-container .tc-sec-body::-webkit-scrollbar { width: 6px; }
.my-classes-container .tc-sec-body::-webkit-scrollbar-track { background: transparent; }
.my-classes-container .tc-sec-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }

/* Bottom sections: pinned at the bottom by default. When Shared Classes
   is expanded, its content grows in-flow below its heading. bottom-sections
   grows upward (its top edge moves up), my-classes shrinks so only its
   heading remains visible. */
.tc-bottom-sections {
    flex: 0 0 auto;
    margin-top: auto; /* push to the bottom of .tc-sidebar-main */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-top: 1px solid #eef0f2;
}
.tc-bottom-sections .sidebar-section {
    flex: 0 0 auto;
    padding: 4px 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.tc-bottom-sections .sidebar-section + .sidebar-section {
    border-top: 1px solid #f3f4f6;
}

/* Expanded section's content grows in-flow beneath its heading; height is
   set via JS on expand (so it takes exactly the former class-list area). */
.tc-bottom-sections .section-content {
    flex: 0 0 auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}
.tc-bottom-sections .sidebar-section.expanded .section-content {
    overflow-y: auto;
}
/* Highlight the open section's heading so it's clear which panel is up. */
.tc-bottom-sections .sidebar-section.expanded .sidebar-heading,
.tc-bottom-sections .sidebar-section.expanded .tc-sec-head {
    color: #059669;
    background: #ecfdf5;
    border-radius: 6px;
}
/* SHARED CLASSES is intentionally NOT highlighted green when expanded —
   linked-teacher rows should feel like a normal subdued list section,
   not an alert. */
.tc-bottom-sections .sidebar-section[data-sec="sharedClasses"].expanded .sidebar-heading,
.tc-bottom-sections .sidebar-section[data-sec="sharedClasses"].expanded .tc-sec-head {
    color: #9ca3af;
    background: transparent;
}

/* Legacy-layout fallback for pages that still use the old structure
   (student-notebook.html): make .my-classes-container and
   .other-sections-container stack in a flex column naturally. */
.left-sidebar > .my-classes-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0 4px;
}
.left-sidebar > .other-sections-container {
    flex: 0 0 auto;
    padding: 4px 0 64px;
    border-top: 1px solid #eef0f2;
}

/* ========== SIDEBAR: SECTIONS ========== */

.tc-sec {
    padding: 10px 8px 4px;
}

.tc-sec + .tc-sec {
    margin-top: 2px;
}

/* Minimalist section heading — matches the top-nav tone.
   Bumped 2026-05-05 to match student .ss-sec-head visual scale under teacher zoom. */
.tc-sec-head,
.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 8px 14px;
    font-size: 14px;
    font-weight: 800;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
    user-select: none;
}
.tc-sec-head:hover,
.sidebar-heading:hover {
    color: #4b5563;
    background: transparent;
}

/* "My Classes" heading has no toggle behavior — cursor stays default */
.my-classes-container .tc-sec-head,
.my-classes-container .sidebar-heading {
    cursor: default;
}

.tc-sec-title {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 800;
    color: inherit;
    letter-spacing: 0.6px;
}

.tc-sec-body {
    padding: 4px 8px 6px;
}

.tc-sec-empty,
.empty-placeholder {
    padding: 14px 14px 10px;
    font-size: 15px;
    color: #9ca3af;
    text-align: left;
}

/* ========== SIDEBAR: ADD / DROPDOWNS ========== */

.tc-sec-add {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #9ca3af;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.tc-sec-add:hover {
    background: #f3f4f6;
    color: #059669;
}
.tc-sec-add svg { width: 14px; height: 14px; }

/* Legacy hook kept for add-class-dropdown positioning */
.add-class-btn {
    position: absolute;
    right: 12px;
    font-size: 16px;
    color: #9ca3af;
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background-color 0.15s, color 0.15s;
}
.add-class-btn:hover {
    background: #f3f4f6;
    color: #059669;
}

.add-class-dropdown {
    position: absolute;
    top: 100%;
    right: 8px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    min-width: 170px;
    padding: 4px;
}

.add-class-dropdown.open {
    display: block;
}

.add-dropdown-item {
    padding: 9px 12px;
    font-size: 13px;
    color: #111;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    border-radius: 6px;
}

.add-dropdown-item:hover {
    background-color: #f3f4f6;
    color: #059669;
}

/* My Classes Content */
#myClassesContent {
    background-color: transparent;
}

/* Other sections - collapsible (legacy student-notebook layout only —
   the new teacher layout uses the JS-driven accordion in
   .tc-bottom-sections instead). */
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-in-out;
    background-color: transparent;
}

.left-sidebar > .other-sections-container .section-content.active {
    max-height: 320px;
    overflow-y: auto;
}

/* ========== SIDEBAR: CLASS LIST (minimalist) ========== */

.class-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.class-item-wrapper {
    margin: 0;
}

.class-item {
    padding: 11px 12px 11px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    border-radius: 9px;
    transition: background-color 0.15s;
    position: relative;
    box-shadow: none;
}
.class-item:hover {
    background-color: #f3f4f6;
}
.class-item.active {
    background-color: #f0fdf4;
}

/* Dynamic class headers keep the same minimalist row — no full color fill.
   Active background uses the class's own pastel tint (set via --cls-light). */
.dynamic-class .class-item {
    border-radius: 8px;
    background-color: transparent;
}
.dynamic-class .class-item:hover {
    background-color: #f3f4f6;
    filter: none;
}
.dynamic-class .class-item.active {
    background-color: var(--cls-light, #f0fdf4);
}
/* Colored pill on the left — the minimal class identity marker */
.tc-class-pill {
    flex: 0 0 auto;
    width: 4px;
    align-self: stretch;
    min-height: 36px;
    border-radius: 999px;
    background-color: #6366f1;
}

.tc-class-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.class-name {
    font-size: 17px;
    color: #111;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-class-meta {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-settings {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.15s, color 0.15s, opacity 0.15s;
    opacity: 0;
    position: relative;
}
.class-settings svg { width: 14px; height: 14px; }
.class-item:hover .class-settings,
.class-item.active .class-settings {
    opacity: 1;
}
.class-settings:hover {
    background: #e5e7eb;
    color: #111;
}
.dynamic-class .class-settings:hover {
    color: #111;
}

/* Settings Dropdown Menu */
.class-settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    min-width: 160px;
    padding: 4px;
    margin-top: 4px;
}

.class-settings-dropdown.open {
    display: block;
}

.settings-dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #111;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
    white-space: nowrap;
    border-radius: 6px;
    font-weight: 500;
}

.settings-dropdown-item:hover {
    background-color: #f3f4f6;
    color: #059669;
}

/* Class Dropdown Menu — subtle indented list with left guide line */
.class-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background-color: transparent;
    border: none;
    position: relative;
    margin-left: 14px;
    padding-left: 10px;
}

.class-dropdown.open {
    max-height: 400px;
    border: none;
    margin-top: 4px;
}

/* Vertical guide line under an expanded class */
.class-dropdown.open::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: #e5e7eb;
}

.dropdown-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
    border: none;
    background-color: transparent;
    text-decoration: none;
    display: block;
    border-radius: 6px;
    font-weight: 500;
    position: relative;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #111;
}

.dropdown-item.active {
    font-weight: 600;
    color: var(--cls-color, #059669) !important;
    background-color: var(--cls-light, #ecfdf5) !important;
}
.dropdown-item.active::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--cls-color, #059669);
    border-radius: 2px;
}

/* ========== MAIN CONTENT AREA ========== */

.main-content {
    position: fixed;
    top: 48px;
    left: 240px;
    right: 0;
    bottom: 0;
    background-color: #f5f5f5;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-items: center;
    transition: left 0.3s ease;
}

/* ========== SIDEBAR COLLAPSE — rail-mode (matches student-side pattern) ==========
   Pre-2026-05-05 the sidebar slid off-screen via translateX(-240px), which
   trapped users (no visible expand handle once gone). Replaced with a
   56px rail showing icons only; the top-anchored toggle next to the sidebar
   stays visible in both states. Mirrors shared/student-sidebar.css. */

.left-sidebar,
.sidebar-background {
    transition: width 0.18s ease, flex-basis 0.18s ease;
}

body.sidebar-collapsed .left-sidebar,
body.sidebar-collapsed .sidebar-background {
    width: 56px;
}

/* Hide nav labels, section headings + bodies in collapsed mode (icons stay) */
body.sidebar-collapsed .tc-nav-label,
body.sidebar-collapsed .tc-nav-badge,
body.sidebar-collapsed .tc-sec-head,
body.sidebar-collapsed .sidebar-heading,
body.sidebar-collapsed .tc-sec-body,
body.sidebar-collapsed .my-classes-container,
body.sidebar-collapsed .tc-bottom-sections,
body.sidebar-collapsed .section-content {
    display: none !important;
}
body.sidebar-collapsed .tc-nav-item {
    justify-content: center;
    padding: 9px 0;
}

body.sidebar-collapsed .main-content {
    left: 56px !important;
}

/* Floating sidebar collapse toggle — sits in the gutter to the right of the
   sidebar with a comfortable gap so it reads as a standalone control in both
   the expanded (240px) and collapsed (56px) states, never crowding the
   sidebar content. */
.sidebar-toggle-btn {
    position: fixed;
    top: 68px;
    left: 252px;
    z-index: 15;
    width: 28px;
    height: 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.18s ease, color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    color: #9ca3af;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    opacity: 0.85;
}

.sidebar-toggle-btn::after {
    content: '\2039';
    font-size: 16px;
    line-height: 1;
}

.sidebar-toggle-btn:hover {
    color: #059669;
    border-color: #a7f3d0;
    background: #f0fdf4;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.08), 0 6px 16px rgba(5, 150, 105, 0.06);
    opacity: 1;
}

body.sidebar-collapsed .sidebar-toggle-btn {
    left: 68px;
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-toggle-btn:hover {
    background: #f0fdf4;
    color: #059669;
    border-color: #a7f3d0;
}

/* ========== NEW TOP BAR ========== */

.top-banner {
    padding: 0 16px;
    gap: 16px;
}

.tc-topbar-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.tc-topbar-search {
    flex: 1 1 auto;
    max-width: 560px;
    position: relative;
    display: flex;
    align-items: center;
}

.tc-topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
    display: flex;
}
.tc-topbar-search-icon svg {
    width: 16px;
    height: 16px;
}

.tc-topbar-search-input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 13px;
    color: #111;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.tc-topbar-search-input:focus {
    background: #fff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.tc-topbar-search-results {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1500;
    padding: 6px 0;
}

.tc-search-group {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tc-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #111;
    font-size: 13px;
    transition: background-color 0.12s;
}
.tc-search-row:hover {
    background-color: #f3f4f6;
}
.tc-search-row-main {
    flex: 1 1 auto;
    font-weight: 500;
}
.tc-search-row-sub {
    flex: 0 0 auto;
    color: #6b7280;
    font-size: 12px;
}
.tc-search-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tc-search-empty {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}
.tc-search-loading-hint {
    padding: 8px 14px;
    text-align: left;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}

.tc-topbar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-topbar-tokens {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #047857;
    cursor: default;
}
.tc-topbar-tokens-icon {
    width: 14px;
    height: 14px;
    display: flex;
}
.tc-topbar-tokens-icon svg {
    width: 14px;
    height: 14px;
}

.tc-topbar-plan {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    transition: background-color 0.15s;
}
.tc-topbar-plan:hover {
    background: #dbeafe;
}
.tc-topbar-plan-icon {
    width: 14px;
    height: 14px;
    display: flex;
}
.tc-topbar-plan-icon svg {
    width: 14px;
    height: 14px;
}

.tc-topbar-bell-wrap {
    position: relative;
}
.tc-topbar-bell {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #4b5563;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s, border-color 0.15s;
}
.tc-topbar-bell:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.tc-topbar-bell svg {
    width: 18px;
    height: 18px;
}
.tc-topbar-bell-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.tc-topbar-bell-panel {
    position: absolute;
    top: 44px;
    right: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    z-index: 1500;
}
.tc-bell-header {
    padding: 4px 14px 8px;
    font-size: 13px;
    font-weight: 700;
    color: #111;
}
.tc-bell-empty {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* ========== NEW LEFT-SIDEBAR TOP NAV ========== */

.tc-topnav {
    flex: 0 0 auto;
    padding: 12px 10px 12px;
    background-color: #ffffff;
    border-bottom: 1px solid #eef0f2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Sizes pre-2026-05-05 were 14px font / 20px icon / 9px 12px padding. Under
   body's zoom: 0.75 those rendered ~10.5px / 15px effective — too small
   next to the un-zoomed student sidebar. Bumped so teacher feels like
   student under the 0.75 zoom. */
.tc-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 9px;
    color: #374151;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    position: relative;
    cursor: pointer;
}
.tc-nav-item:hover {
    background-color: #f3f4f6;
    color: #111;
}
.tc-nav-item.active {
    background-color: #ecfdf5;
    color: #059669;
    font-weight: 600;
}
.tc-nav-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-nav-icon svg {
    width: 26px;
    height: 26px;
}
.tc-nav-label {
    flex: 1 1 auto;
}
.tc-nav-badge {
    flex: 0 0 auto;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.tc-nav-item.active .tc-nav-badge {
    background: #d1fae5;
    color: #047857;
}

/* ========== MODAL OVERLAY (base for all modals) ========== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background-color: white;
    border-radius: 8px;
    width: 1100px;
    height: 750px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 20px 32px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.3px;
}

.modal-header-subtitle {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
    font-weight: 400;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    padding: 0 32px;
    gap: 8px;
    flex-shrink: 0;
}

.modal-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    position: relative;
    top: 1px;
}

.modal-tab:hover {
    color: #333;
    background-color: #f0f0f0;
}

.modal-tab.active {
    color: #059669;
    font-weight: 600;
    border-bottom-color: #059669;
    background-color: white;
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

.modal-tab-content {
    display: none;
    padding: 28px 32px;
}

.modal-tab-content.active {
    display: block;
}

/* ========== ARCHIVED CLASSES MODAL ========== */
.arc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.arc-overlay.active {
    display: flex;
}
.arc-container {
    background: #fff;
    border-radius: 12px;
    width: 560px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.arc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}
.arc-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}
.arc-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.arc-close:hover { color: #333; }
.arc-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.arc-info {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}
.arc-empty {
    text-align: center;
    padding: 40px 20px;
}
.arc-empty-icon { font-size: 40px; margin-bottom: 12px; }
.arc-empty-title { font-size: 16px; font-weight: 700; color: #666; margin-bottom: 8px; }
.arc-empty-desc { font-size: 13px; color: #999; line-height: 1.6; max-width: 320px; margin: 0 auto; }
.arc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.arc-card:last-child { border-bottom: none; }
.arc-card-color {
    width: 6px;
    height: 40px;
    border-radius: 3px;
    flex-shrink: 0;
}
.arc-card-info { flex: 1; min-width: 0; }
.arc-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.arc-card-meta {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}
.arc-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.arc-restore-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.arc-restore-btn:hover { background: #dcfce7; }
.arc-delete-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.arc-delete-btn:hover { background: #fee2e2; }
.arc-section-header {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.arc-section-header-deleted {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}
.arc-section-icon { font-size: 16px; }
.arc-section-sub {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    margin-top: -6px;
}
.arc-section-empty {
    font-size: 13px;
    color: #999;
    padding: 16px 0;
    text-align: center;
}
.arc-keep-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.arc-keep-btn:hover { background: #dbeafe; }

/* ===== Shared info-icon (ⓘ with hover popover) =====
   Drop-in element for compact UIs: a small "i" badge with a custom
   dark-bubble popover that pops above on hover/focus. No JS needed —
   pure CSS uses the data-tip attribute as content. Used across every
   AI-launcher surface (lesson/unit/batch/assessment/library) to hide
   secondary copy until the teacher explicitly hovers. */
.tc-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #b8c6bc;
    color: #ffffff;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    cursor: help;
    position: relative;
    margin-left: 5px;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
    user-select: none;
    vertical-align: middle;
}
.tc-info-icon::before { content: 'i'; display: block; }
.tc-info-icon:hover, .tc-info-icon:focus { background: #2a8b4d; outline: none; }
.tc-info-icon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: -4px;
    left: auto;
    transform: translateY(4px);
    background: #1f2a30;
    color: #ffffff;
    padding: 8px 11px;
    border-radius: 6px;
    font-size: 11.5px;
    font-style: normal;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: left;
    box-shadow: 0 6px 18px rgba(15, 25, 35, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
    z-index: 99999;
}
.tc-info-icon:hover::after,
.tc-info-icon:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s;
}

/* Summary variant — used by all 4 launchers (lesson plan / lesson
   activities / unit plan / batch lesson). The CSS ::after popover is
   suppressed in favor of a JS body-mounted overlay (shared/sidebar.js)
   so the tooltip escapes any overflow:hidden ancestor and always
   renders on top — the launcher chat panels would otherwise clip it. */
.tc-info-icon-summary::after { display: none !important; }
.tc-info-icon-summary {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    font-size: 11px;
}

/* Let the tooltip escape any ancestor with overflow:hidden by
   lifting clipping on the tile + grid containers that wrap info
   icons. The launcher card itself stays clipped; tiles don't. */
.ld-launcher-tile,
.ld-launcher-grid,
.tcBAP-tile,
.tcBAP-grid,
.ld-launcher-brainstorm,
.ld-launcher-link-composer {
    overflow: visible;
}

/* ===== Shared launcher-header gear =====
   Sits at the right edge of each launcher's title row. Opens the AI
   Models pane scoped to the relevant sub-pill (lesson/unit/batch/etc).
   Same visual everywhere so users learn one icon. */
.tc-launcher-gear {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7a72;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    flex-shrink: 0;
}
.tc-launcher-gear:hover {
    background: #eef4ef;
    color: #2a5d3a;
    border-color: #d7e6d7;
}
.tc-launcher-gear svg { display: block; }
