/**
 * Classroom Monitor - unified NT console theme
 * Inspired by api.newstargeted.com/credits (dark shell, cyan accent)
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
    --cm-bg: #070b12;
    --cm-bg-elevated: #0d1522;
    --cm-bg-card: #121c2c;
    --cm-bg-hover: #182436;
    --cm-border: rgba(94, 234, 212, 0.14);
    --cm-border-strong: rgba(94, 234, 212, 0.35);
    --cm-text: #e8eef7;
    --cm-text-muted: #93a4bd;
    --cm-accent: #5eead4;
    --cm-accent-2: #38bdf8;
    --cm-success: #34d399;
    --cm-danger: #f87171;
    --cm-warning: #fbbf24;
    --cm-sidebar: #050810;
    --cm-radius: 12px;
    --cm-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --cm-font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --primary: var(--cm-accent);
    --dark: var(--cm-text);
    --gray: var(--cm-text-muted);
    --border: var(--cm-border);
    --success: var(--cm-success);
}

html {
    color-scheme: dark;
}

body,
body.with-sidebar,
body.dashboard-page,
body.landing-page,
.landing-page {
    font-family: var(--cm-font-body) !important;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, 0.12), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(94, 234, 212, 0.10), transparent 50%),
        linear-gradient(180deg, #050810 0%, var(--cm-bg) 40%, #04060c 100%) !important;
    color: var(--cm-text) !important;
    min-height: 100vh;
}

h1, h2, h3, h4, .brand-text, .section-title, .dashboard-header h1 {
    font-family: var(--cm-font-display) !important;
    letter-spacing: -0.02em;
    color: var(--cm-text) !important;
}

p, .section-subtitle, .dashboard-header p {
    color: var(--cm-text-muted) !important;
}

/* Admin / dashboard dark surfaces: light readable text */
.content-card,
.content-card h1,
.content-card h2,
.content-card h3,
.content-card h4,
.content-card p,
.content-card-title,
.empty-state h3,
.data-table td,
.admin-modal,
.admin-modal-content,
.admin-modal h2,
.admin-modal p,
.admin-modal label {
    color: var(--cm-text) !important;
}

.content-card-title,
.admin-modal-header h2 {
    color: #f8fafc !important;
}

.data-table th,
.empty-state,
.empty-state p,
.stat-label,
.admin-modal-note,
.admin-modal-body {
    color: var(--cm-text-muted) !important;
}

/* Plans / modules that still use light cards: dark readable text */
.package-card,
.package-card h1,
.package-card h2,
.package-card h3,
.package-card p,
.package-name,
.package-description,
.module-card,
.module-card h1,
.module-card h2,
.module-card h3,
.module-card p,
.module-name,
.module-description,
.module-billing {
    color: #1f2937 !important;
}

.module-billing {
    color: #4b5563 !important;
}

/* Desktop sidebar: fixed nav; content offset owned by cm-layout.css (.cm-app-shell) */
@media (min-width: 1024px) {
    body.with-sidebar .page-with-sidebar {
        margin-left: 0 !important;
    }

    body.with-sidebar .public-navbar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: var(--cm-sidebar-width, 260px) !important;
        box-sizing: border-box !important;
        z-index: 1100;
    }

    body.with-sidebar.sidebar-collapsed .public-navbar {
        width: var(--cm-sidebar-collapsed-width, 80px) !important;
    }
}

/* Sidebar / navbar */
.public-navbar {
    background: linear-gradient(180deg, var(--cm-sidebar) 0%, #070d18 100%) !important;
    border-right: 1px solid var(--cm-border) !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.brand-link,
.nav-link,
.navbar-links a,
.brand-text {
    color: var(--cm-text) !important;
}

.nav-link:hover,
.nav-link.active,
.navbar-links a:hover,
.navbar-links a.active {
    background: rgba(94, 234, 212, 0.12) !important;
    color: var(--cm-accent) !important;
    box-shadow: inset 0 0 0 1px var(--cm-border-strong);
}

.version-badge {
    background: rgba(94, 234, 212, 0.15) !important;
    color: var(--cm-accent) !important;
    border: 1px solid var(--cm-border);
}

.sidebar-toggle-btn,
.mobile-menu-btn {
    color: var(--cm-text) !important;
    border-color: var(--cm-border) !important;
}

/* Cards / panels */
.dashboard-container,
.page-with-sidebar,
.user-profile-wrapper,
.docs-container,
.login-container,
.plans-container {
    color: var(--cm-text);
}

.dashboard-card,
.profile-card,
.stat-card,
.feature-card,
.pricing-card,
.use-case-card,
.hero-content,
.info-card,
.tab-content,
.cm-card {
    background: var(--cm-bg-card) !important;
    border: 1px solid var(--cm-border) !important;
    border-radius: var(--cm-radius) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
    color: var(--cm-text) !important;
}

.pricing-card {
    overflow: visible !important;
}

.pricing-card.featured,
.pricing-card.popular {
    border-color: var(--cm-accent) !important;
    box-shadow: 0 0 0 1px var(--cm-accent), 0 16px 48px rgba(94, 234, 212, 0.12) !important;
    overflow: visible !important;
    padding-top: 48px !important;
}

.featured-badge {
    position: absolute !important;
    top: -14px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 8 !important;
    background: #22c55e !important;
    color: #022c22 !important;
    font-weight: 800 !important;
    padding: 6px 16px !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.45) !important;
    white-space: nowrap !important;
}

/* Buttons */
.btn,
.btn-primary,
button.btn-primary,
a.btn-primary,
.cta-button,
.download-btn {
    background: linear-gradient(135deg, var(--cm-accent) 0%, var(--cm-accent-2) 100%) !important;
    color: #041018 !important;
    border: none !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-family: var(--cm-font-display) !important;
}

.btn-secondary,
.btn-outline {
    background: transparent !important;
    color: var(--cm-accent) !important;
    border: 1px solid var(--cm-border-strong) !important;
}

.btn-danger {
    background: var(--cm-danger) !important;
    color: #fff !important;
}

.btn-success {
    background: var(--cm-success) !important;
    color: #041018 !important;
}

/* Forms */
input, select, textarea,
.form-control,
.login-form input {
    background: var(--cm-bg-elevated) !important;
    border: 1px solid var(--cm-border) !important;
    color: var(--cm-text) !important;
    border-radius: 10px !important;
}

input:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: var(--cm-accent) !important;
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15) !important;
}

/* Landing overrides (kill purple gradients; force readable dark sections) */
.hero-section,
.landing-hero,
.hero {
    background: transparent !important;
}

.landing-page .pricing-section,
.pricing-section {
    background: linear-gradient(180deg, #0b1220 0%, #070b12 100%) !important;
    color: #e8eef7 !important;
}

.landing-page .features-section,
.features-section,
.landing-page .use-cases-section,
.use-cases-section,
.landing-page .benefits-section,
.benefits-section,
.landing-page .testimonials-section,
.testimonials-section,
.landing-page .downloads-section,
.downloads-section {
    background: linear-gradient(180deg, #070b12 0%, #0b1220 100%) !important;
    color: #e8eef7 !important;
}

.landing-page .section-title,
.section-header .section-title,
.features-section .section-title,
.pricing-section .section-title,
.use-cases-section .section-title {
    color: #f8fafc !important;
}

.landing-page .section-subtitle,
.section-header .section-subtitle,
.features-section .section-subtitle,
.pricing-section .section-subtitle {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

.landing-page .feature-card,
.feature-card {
    background: #121c2c !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: #e8eef7 !important;
}

.landing-page .feature-title,
.feature-title {
    color: #f8fafc !important;
}

.landing-page .feature-description,
.feature-description {
    color: #cbd5e1 !important;
}

.landing-page .pricing-card {
    background: rgba(15, 23, 42, 0.92) !important;
}

/* Download + testimonial cards: never leave light text on white cards */
.landing-page .download-card,
.download-card,
.landing-page .testimonial-card,
.testimonial-card {
    background: #121c2c !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    color: #e8eef7 !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}

.landing-page .download-card h2,
.landing-page .download-card h3,
.landing-page .download-card h4,
.landing-page .download-title,
.download-title,
.landing-page .download-card .download-title,
.landing-page .system-requirements h4,
.system-requirements h4,
.landing-page .testimonial-card h4,
.landing-page .testimonial-info h4,
.testimonial-info h4 {
    color: #f8fafc !important;
}

.landing-page .download-description,
.download-description,
.landing-page .download-card p,
.landing-page .system-requirements li,
.system-requirements li,
.landing-page .testimonial-text,
.testimonial-text,
.landing-page .testimonial-card p,
.landing-page .testimonial-info p,
.testimonial-info p {
    color: #cbd5e1 !important;
}

.landing-page .system-requirements,
.system-requirements {
    border-top-color: rgba(148, 163, 184, 0.25) !important;
}

.landing-page .downloads-section .section-title,
.landing-page .testimonials-section .section-title,
.downloads-section .section-title,
.testimonials-section .section-title {
    color: #f8fafc !important;
}

.landing-page .downloads-section .section-subtitle,
.landing-page .testimonials-section .section-subtitle,
.downloads-section .section-subtitle,
.testimonials-section .section-subtitle {
    color: #cbd5e1 !important;
}

.section-header .section-title {
    color: var(--cm-text) !important;
}

/* Footer */
.classroom-footer {
    background: #04070e !important;
    border-top: 1px solid var(--cm-border) !important;
    width: 100% !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
}

body.with-sidebar > .classroom-footer,
.cm-app-shell > .classroom-footer {
    margin-left: 0 !important;
}

.classroom-footer-section h3,
.classroom-footer-link:hover {
    color: var(--cm-accent) !important;
}

.classroom-footer-stat-value {
    color: var(--cm-accent-2) !important;
}

/* Profile tabs */
.profile-tab {
    color: var(--cm-text-muted) !important;
    border-bottom: 2px solid transparent !important;
}

.profile-tab.active,
.profile-tab:hover {
    color: var(--cm-accent) !important;
    border-bottom-color: var(--cm-accent) !important;
}

.profile-header {
    background: var(--cm-bg-card) !important;
    border: 1px solid var(--cm-border) !important;
    border-radius: var(--cm-radius) !important;
}

.profile-avatar {
    background: linear-gradient(135deg, var(--cm-accent), var(--cm-accent-2)) !important;
    color: #041018 !important;
}

/* Console / terminal */
.console-output,
#consoleOutput,
.terminal {
    background: #02050a !important;
    color: var(--cm-accent) !important;
    border: 1px solid var(--cm-border) !important;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace !important;
}

/* About / credits page: fill content area beside sidebar */
.cm-about-page {
    width: 100%;
    max-width: none;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 2rem clamp(1.25rem, 3vw, 2.5rem) 4rem;
    box-sizing: border-box;
}

.cm-eyebrow {
    color: var(--cm-accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cm-about-lead {
    max-width: 72rem;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.cm-section-title {
    font-size: 1.35rem;
    margin: 2.5rem 0 1rem;
}

.cm-team-grid,
.cm-built-grid {
    display: grid;
    gap: 1rem;
}

.cm-team-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cm-built-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cm-team-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: var(--cm-bg-card);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
}

.cm-team-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cm-accent), var(--cm-accent-2));
    color: #041018;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--cm-font-display);
    flex-shrink: 0;
}

.cm-role {
    color: var(--cm-success);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin: 0.15rem 0 0.5rem;
}

.cm-built-chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    background: var(--cm-bg-card);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    text-decoration: none;
    color: var(--cm-text);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.cm-built-chip:hover {
    border-color: var(--cm-accent);
    transform: translateY(-2px);
    color: var(--cm-text);
    background: var(--cm-bg-hover);
}

.cm-built-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(94, 234, 212, 0.16);
    border: 1px solid rgba(94, 234, 212, 0.4);
}

.cm-built-icon img {
    width: 30px;
    height: 30px;
    display: block;
    /* Force high-contrast light/teal icons on dark cards */
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.cm-built-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.cm-built-chip strong {
    font-family: var(--cm-font-display);
    color: var(--cm-accent);
}

.cm-built-chip span {
    color: var(--cm-text-muted);
    font-size: 0.85rem;
}

.cm-about-stack-card {
    padding: 1.25rem 1.5rem;
}

.cm-about-stack-card p {
    margin: 0;
    color: var(--cm-text-muted) !important;
    line-height: 1.7;
}

/* Sitewide: fill content column beside sidebar, soft max width so pages are not overstretched */
body.with-sidebar .page-with-sidebar,
body.with-sidebar .plans-container,
body.with-sidebar .downloads-container,
body.with-sidebar .docs-container,
body.with-sidebar .dashboard-container,
body.with-sidebar .user-profile-wrapper,
body.with-sidebar .admin-wrapper {
    width: 100% !important;
    max-width: 1400px !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Docs/changelog shells: full content column; inner containers keep their own max-width */
body.with-sidebar .changelog-page,
body.with-sidebar .docs-page {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

body.with-sidebar .user-profile-wrapper > main,
body.with-sidebar .dashboard-container,
body.with-sidebar .plans-container,
body.with-sidebar .admin-wrapper {
    width: 100%;
}

body.with-sidebar .features-container,
body.with-sidebar .use-cases-container,
body.with-sidebar .benefits-container,
body.with-sidebar .downloads-section .downloads-container,
body.with-sidebar .testimonials-container,
body.with-sidebar .stats-container,
body.with-sidebar .pricing-container,
body.with-sidebar .hero-container,
body.with-sidebar .landing-content > section > .features-container,
body.with-sidebar .section-header {
    max-width: 1400px !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

body.with-sidebar .landing-page .landing-content > section,
body.with-sidebar .landing-page .pricing-section,
body.with-sidebar .landing-page .features-section,
body.with-sidebar .landing-page .use-cases-section,
body.with-sidebar .landing-page .benefits-section,
body.with-sidebar .landing-page .downloads-section,
body.with-sidebar .landing-page .testimonials-section,
body.with-sidebar .landing-page .stats-section {
    padding-left: clamp(1.25rem, 3vw, 2.75rem) !important;
    padding-right: clamp(1.25rem, 3vw, 2.75rem) !important;
}

body.with-sidebar .plans-container,
body.with-sidebar .downloads-container,
body.with-sidebar .admin-wrapper,
body.with-sidebar .dashboard-container,
body.with-sidebar .user-profile-wrapper {
    padding-left: clamp(1rem, 2.5vw, 2rem);
    padding-right: clamp(1rem, 2.5vw, 2rem);
}

/* Profile readability on dark cards */
body.with-sidebar .info-value,
body.with-sidebar .profile-card,
body.with-sidebar .profile-card h2,
body.with-sidebar .profile-card p,
body.with-sidebar .profile-card strong {
    color: #e8eef7 !important;
}

body.with-sidebar .info-label {
    color: #94a3b8 !important;
}

body.with-sidebar .profile-card {
    background: #121c2c !important;
    border: 1px solid rgba(94, 234, 212, 0.14);
}

/* Tables / lists on dark */
table {
    color: var(--cm-text);
}

a {
    color: var(--cm-accent-2);
}

/* Cookie banner alignment */
.cookie-consent-banner {
    background: var(--cm-bg-elevated) !important;
    border: 1px solid var(--cm-border) !important;
    color: var(--cm-text) !important;
}
