/* ============================================================================
   MTH114 Platform - Main Styles
   ============================================================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --white-pure: #FFFFFF;
    --white-warm: #FAFAF9;
    --white-soft: #F5F5F4;
    
    /* Primary theme - BLACK */
    --primary: #000000;
    --primary-dark: #000000;
    --secondary: #333333;
    --accent: #666666;
    
    --success: #28a745;
    --warning: #ffc107;
    --error: #dc3545;
    --info: #17a2b8;
    
    --bg-main: var(--white-soft);
    --bg-card: var(--white-pure);
    --bg-secondary: var(--white-warm);
    --bg-placeholder: #F0F0EF;
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    
    --border: #E8E8E7;
    --border-light: #F0F0EF;
    --shadow: rgba(0, 0, 0, 0.08);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--white-soft);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================================================
   App Container
   ============================================================================ */

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--white-pure);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
}

/* ============================================================================
   Header - BLACK THEME
   ============================================================================ */

.app-header {
    background: #000000;
    color: #FFFFFF;
    padding: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px var(--shadow);
}

.header-content h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
    color: #FFFFFF;
}

.header-content .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #FFFFFF;
}

.mode-selector {
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.mode-selector label {
    font-weight: 600;
    color: #FFFFFF;
}

.mode-selector select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

#mode-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF;
}

/* ============================================================================
   Tab Navigation
   ============================================================================ */

.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    background: var(--white-warm);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--spacing-lg);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-btn:hover {
    background: var(--white-pure);
    color: #000000;
}

.tab-btn.active {
    color: #000000;
    border-bottom-color: #000000;
    background: var(--white-pure);
}

.tab-icon {
    font-size: 1.5rem;
}

/* ============================================================================
   Tab Contents
   ============================================================================ */

.tab-content-container {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Module Intro - BLACK THEME */
.module-intro {
    background: #000000;
    color: #FFFFFF;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.module-intro h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    color: #FFFFFF;
}

.module-intro p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #FFFFFF;
}

/* ============================================================================
   Content Sections
   ============================================================================ */

.content-section {
    margin-bottom: var(--spacing-xl);
    background: var(--white-pure);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.content-section h3 {
    color: #000000;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.content-section h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
}

/* ============================================================================
   Cards & Grids
   ============================================================================ */

.applications-grid,
.demos-grid,
.methods-grid,
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.application-card,
.demo-card,
.method-card,
.tool-card {
    background: var(--white-pure);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.application-card:hover,
.demo-card:hover,
.method-card:hover,
.tool-card:hover {
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.card-header h4,
.card-header h5 {
    margin: 0;
    color: #000000;
}

.card-content p {
    margin: var(--spacing-sm) 0;
    color: var(--text-secondary);
}

/* ============================================================================
   Placeholders
   ============================================================================ */

.placeholder {
    position: relative;
    opacity: 0.85;
}

.placeholder-text {
    background: var(--bg-placeholder);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--warning);
    font-style: italic;
    color: var(--text-secondary);
}

.placeholder-text strong {
    color: var(--warning);
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* ============================================================================
   Badges
   ============================================================================ */

.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.coming-soon {
    background: var(--warning);
    color: white;
}

.badge.active {
    background: var(--success);
    color: white;
}

.badge.inactive {
    background: var(--text-muted);
    color: white;
}

/* ============================================================================
   Definition Boxes
   ============================================================================ */

.definition-box {
    background: var(--white-pure);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.definition-header {
    background: var(--white-warm);
    padding: var(--spacing-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    border-bottom: 1px solid var(--border-light);
}

.definition-header:hover {
    background: var(--white-soft);
}

.definition-header h4 {
    margin: 0;
    color: #000000;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.definition-header.expanded .toggle-icon {
    transform: rotate(180deg);
}

.definition-content {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
    max-height: 1000px;
    transition: max-height 0.3s, padding 0.3s;
}

.definition-content.collapsed {
    max-height: 0;
    padding: 0 var(--spacing-md);
    overflow: hidden;
}

/* ============================================================================
   Method Categories
   ============================================================================ */

.method-category {
    margin-bottom: var(--spacing-xl);
}

.method-category h4 {
    color: #000000;
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-main);
    border-left: 4px solid #000000;
    border-radius: var(--radius-sm);
}

/* ============================================================================
   Equation Input - LARGER FONTS
   ============================================================================ */

.equation-input-box {
    background: var(--white-pure);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.equation-input-box p {
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

/* All equation input fields - LARGER FONT SIZE */
#solver-interface input[type="text"],
.input-form input[type="text"],
.step-container input[type="text"] {
    font-size: 1.5rem !important;
    padding: 16px !important;
    font-family: 'Courier New', Consolas, monospace !important;
    line-height: 1.4 !important;
}

/* ============================================================================
   Buttons - BLACK THEME
   ============================================================================ */

.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: #000000;
    color: #FFFFFF;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #222222;
}

.btn-secondary {
    background: #666666;
    color: white;
}

.btn-secondary:hover {
    background: #555555;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle buttons */
.btn-toggle {
    background: transparent;
    color: #666666;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-toggle.active {
    background: #000000;
    color: #FFFFFF;
}

/* ============================================================================
   Status Messages
   ============================================================================ */

.status {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    font-weight: 600;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ============================================================================
   Math Display
   ============================================================================ */

.math-display {
    background: var(--white-warm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    text-align: center;
    font-size: 1.2rem;
    border: 1px solid var(--border-light);
}

/* ============================================================================
   Footer
   ============================================================================ */

.app-footer {
    background: var(--white-warm);
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.app-footer .version {
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

/* ============================================================================
   Utilities
   ============================================================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .tab-navigation {
        overflow-x: auto;
    }
    
    .tab-btn {
        flex-shrink: 0;
    }
    
    .applications-grid,
    .demos-grid,
    .methods-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .module-intro h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tab-icon {
        display: none;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   Modal Styles
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
}

/* Application card active state */
.application-card:not(.placeholder) {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.application-card:not(.placeholder):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Slide Deck Modal
   ======================================== */
.slide-deck-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.slide-deck-modal.active {
    display: flex;
}

.slide-deck-container {
    background: white;
    border-radius: 12px;
    max-width: 95vw;
    width: 95%;
    height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.slide-deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    flex-shrink: 0;
}

.slide-deck-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.slide-deck-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0 8px;
    opacity: 0.8;
}

.slide-deck-close:hover {
    opacity: 1;
}

.slide-deck-content {
    flex: 1;
    padding: 25px 35px;
    overflow-y: auto;
    font-size: 1.1em;
    line-height: 1.7;
    min-height: 0; /* Important for flex children */
}

.slide-deck-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.slide-deck-content .math-display {
    margin: 25px 0;
    font-size: 1.2em;
}

.slide-deck-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.slide-indicator {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.slide-nav-btn {
    padding: 10px 25px;
    border: 2px solid #667eea;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    transition: all 0.2s;
    font-size: 0.95em;
}

.slide-nav-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.slide-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* PDF Page Navigation */
.pdf-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
}

.pdf-page-container canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
    color: white;
}

.slide-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Method info button */
.method-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.method-info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.method-info-btn svg {
    width: 18px;
    height: 18px;
}

/* Instructor interface styles */
.instructor-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.instructor-toggle {
    padding: 8px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.instructor-toggle:hover {
    background: #5a6268;
}

.instructor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    justify-content: center;
    align-items: center;
}

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

.instructor-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
}

.slide-editor {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.slide-editor textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.example-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.example-card {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

/* ============================================
   Higher Order ODE Interface Styles
   ============================================ */

/* Input Tabs */
.input-tab {
    padding: 12px 24px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.2s;
}

.input-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.input-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 6px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1565c0;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: #bbdefb;
    border-color: #1976d2;
}

/* Large button */
.btn-lg {
    padding: 15px 35px;
    font-size: 1.1em;
}

/* Method Cards - Selectable */
.method-card.selectable {
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.method-card.selectable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.method-card.selectable.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.method-card.selectable.selected::after {
    content: "✓ Selected";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

/* Step Container Styling */
.step-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.step-container.hidden {
    display: none;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
}

.step-title {
    font-size: 1.15em;
    font-weight: 600;
    color: #333;
}

.step-content {
    padding: 20px;
}

/* Feedback Styling */
.feedback-correct {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.feedback-hint {
    color: #e65100;
    background: #fff3e0;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.feedback-error {
    color: #c62828;
    background: #ffebee;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

/* Badge styles */
.badge.active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.badge.coming-soon {
    background: #e0e0e0;
    color: #757575;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ============================================
   Equation Type Panels (Higher Order)
   ============================================ */

.eq-type-panel {
    margin-top: 10px;
}

/* Variable mode panel */
.var-mode-panel {
    transition: all 0.3s;
}

/* Input mode selector (nested tabs) */
.input-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-mode-selector .input-tab {
    padding: 10px 20px;
    font-size: 0.9em;
}

/* ============================================================================
   Server Mode vs Browser Mode Visibility
   ============================================================================ */

/* Hide lecture slide buttons by default (before JS runs) */
.lecture-slide-btn {
    display: none !important;
}

/* Show lecture slide buttons only in server mode */
body.server-mode .lecture-slide-btn {
    display: inline-block !important;
}

/* ============================================================================
   Picard Iteration Scrollable Math Boxes
   ============================================================================ */

.picard-math-scroll {
    position: relative;
    overflow-x: auto;
    max-width: 100%;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #9c27b0 #f0f0f0;
    border-radius: 8px;
    background: linear-gradient(to right, transparent 95%, rgba(156, 39, 176, 0.1) 100%);
}

.picard-math-scroll::-webkit-scrollbar {
    height: 8px;
}

.picard-math-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.picard-math-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #9c27b0, #e91e63);
    border-radius: 4px;
}

.picard-math-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #7b1fa2, #c2185b);
}

/* Fade indicator for scrollable content */
.picard-math-scroll::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 8px;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.picard-math-scroll:hover::after {
    opacity: 1;
}

/* Ensure number inputs have consistent height with text inputs */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
