/* Integral Calculator - Styles */

/* Action Buttons Grid */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}


/* Integration Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    padding: 0.75rem;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
}

.mode-btn:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.mode-btn i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* Input Group Styles */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.input-group .error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.input-group .form-input.error + .error-message {
    display: block;
}

/* Limits Input Group (side-by-side) */
.limits-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Function Syntax Helper */
.syntax-helper {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.syntax-helper code {
    background: #e0f2fe;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #0c4a6e;
}

/* Results Display */
.result-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.result-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.result-exact {
    font-size: 1rem;
    color: #475569;
    margin-top: 0.5rem;
}

/* KaTeX Formula Display */
.formula-display {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    overflow-x: auto;
}

.formula-display .katex {
    font-size: 1.2rem;
}

/* Step-by-Step Solution */
.steps-container {
    margin-top: 1rem;
}

.calculation-step {
    background: white;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.step-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

.step-description {
    display: inline-block;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.5rem;
}

.step-formula {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 4px;
    text-align: center;
}

.step-result {
    margin-top: 0.5rem;
    font-weight: 600;
    color: #667eea;
}

/* Toggle Steps Button */
.toggle-steps {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-steps:hover {
    background: #f0f4ff;
}

.toggle-steps i {
    transition: transform 0.3s ease;
}

.toggle-steps.active i {
    transform: rotate(180deg);
}

/* Numerical Integration Table */
.integration-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.integration-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.integration-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.integration-table tr:last-child td {
    border-bottom: none;
}

.integration-table tr:nth-child(even) {
    background: #f8fafc;
}

/* Comparison Display */
.comparison-display {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-label {
    font-weight: 500;
    color: #64748b;
}

.comparison-value {
    font-weight: 700;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.comparison-value.error {
    color: #ef4444;
    font-size: 0.875rem;
}

.comparison-value.success {
    color: #10b981;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

/* Method Info Box */
.method-info {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.method-info h4 {
    color: #92400e;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.method-info p {
    color: #78350f;
    margin: 0;
    font-size: 0.875rem;
}

/* Tooltips */
.tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #94a3b8;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 0.75rem;
    cursor: help;
    margin-left: 0.25rem;
}

.tooltip-icon:hover {
    background: #667eea;
}


.example-box {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.example-box h4 {
    color: #667eea;
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .limits-group {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .action-buttons-grid {
        grid-template-columns: 1fr;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 250px;
    }

    .formula-display .katex {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .action-buttons-grid,
    .toggle-steps,
    .btn-add-function {
        display: none;
    }

    .glass-card {
        break-inside: avoid;
    }

    .steps-container {
        display: block !important;
    }
}
