/* TI-Nspire CX CAS Document Preview Styling for MkDocs Material */

.nspire-cas-window {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-family: "Liberation Serif", "Times New Roman", "Cambria Math", serif;
    font-size: 0.84rem;
    margin: 1.0em 0 1.5em 0;
    overflow: hidden;
    color: #111827;
}

.nspire-cas-header {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 4px 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nspire-cas-header .tab-indicator {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    padding: 1px 8px;
    color: #1f2937;
}

.nspire-cas-body {
    padding: 8px 14px 10px 14px;
    background: #ffffff;
    min-height: auto;
    overflow-x: auto;
}

/* Force KaTeX inside CAS window to match compact native TI-Nspire font scale */
.nspire-cas-window .katex {
    font-size: 0.88em !important;
    line-height: 1.25 !important;
}

.nspire-cas-window .katex-display {
    margin: 2px 0 4px 0 !important;
    text-align: right !important;
    display: flex !important;
    justify-content: flex-end !important;
}

.nspire-cas-window .katex .matrix-row {
    height: 1.25em !important;
}

.nspire-cas-window .katex .col-group > .col {
    padding: 0 4px !important;
}

.nspire-cas-window .katex-error {
    font-size: 0.82rem !important;
    font-family: monospace !important;
}

.nspire-entry-line {
    font-size: 0.88rem;
    color: #000000;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    line-height: 1.35;
}

.nspire-entry-line .nspire-cmd {
    font-weight: 700;
    font-style: normal;
    font-family: "Liberation Serif", "Times New Roman", "Cambria Math", serif;
    color: #000000;
    margin-right: 1px;
}

.nspire-entry-line .nspire-args {
    font-family: "Liberation Serif", "Times New Roman", "Cambria Math", serif;
    color: #000000;
}

.nspire-entry-line .cursor {
    display: inline-block;
    width: 2px;
    height: 1.15em;
    background: #ef4444;
    margin-left: 2px;
    vertical-align: baseline;
    align-self: center;
    animation: nspire-blink 1s infinite;
}

@keyframes nspire-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.nspire-divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 6px 0 8px 0;
}

.nspire-output-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.84rem;
    color: #000000;
    width: 100%;
    overflow-x: auto;
}

.nspire-disp-line {
    font-size: 0.83rem;
    color: #0f172a;
    margin: 1px 0;
    text-align: right;
    width: 100%;
    line-height: 1.35;
}

.nspire-done {
    font-style: italic;
    font-family: "Liberation Serif", "Times New Roman", serif;
    font-size: 0.82rem;
    color: #1f2937;
    margin-top: 2px;
    text-align: right;
    width: 100%;
}

/* Exam Question Box Styling */
.exam-question-card {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    padding: 12px 18px;
    margin: 1.2em 0;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .exam-question-card {
    background: #1e293b;
    border-left-color: #60a5fa;
    color: #e2e8f0;
}

.exam-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2563eb;
    margin-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 6px;
}

[data-md-color-scheme="slate"] .exam-question-header {
    color: #93c5fd;
    border-bottom-color: #475569;
}

.exam-question-header .marks {
    font-size: 0.82rem;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 9999px;
}

[data-md-color-scheme="slate"] .exam-question-header .marks {
    background: #1e3a8a;
    color: #bfdbfe;
}

.exam-question-body p {
    margin: 0.4em 0;
    line-height: 1.55;
    font-size: 0.92rem;
}

/* Download Cards & Hero Grid */
.download-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 1.5em 0 2em 0;
}

.download-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.download-card.primary {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}

[data-md-color-scheme="slate"] .download-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-md-color-scheme="slate"] .download-card.primary {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #1e293b 0%, #172554 100%);
}

.download-card h3 {
    margin-top: 0 !important;
    font-size: 1.05rem !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-card .md-button {
    margin: 12px 0 14px 0;
    width: 100%;
    text-align: center;
    font-weight: 600;
}

.download-card ul {
    font-size: 0.84rem;
    margin: 0;
    padding-left: 20px;
    color: #475569;
}

[data-md-color-scheme="slate"] .download-card ul {
    color: #94a3b8;
}
