/* algebra-specific.css - Algebra-spesifikk styling */

/* Algebra-specifik gradient (lilla/blå for matematikk/vitenskap-tema) */
body {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 25%, #6366f1 75%, #4f46e5 100%);
}

.calculator-card {
    border: 2px solid rgba(139, 92, 246, 0.3);
}

/* Override base input styling */
input[type="number"], input[type="text"], select {
    width: 100% !important;
    padding: 18px 24px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    color: #1a202c !important;
}

input[type="number"]:focus, input[type="text"]:focus, select:focus {
    outline: none !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
    transform: none !important;
}

input[type="text"]::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
}

/* Special styling for equation inputs */
#equation, #function, #expression, #calcFunction {
    font-size: 17px !important;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace !important;
    font-weight: 500 !important;
    background: #fafbff !important;
    border: 2px solid #e5e7eb !important;
    padding: 20px 24px !important;
}

#equation:focus, #function:focus, #expression:focus, #calcFunction:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.06), 0 2px 8px rgba(139, 92, 246, 0.1) !important;
    background: #ffffff !important;
}

/* Mode selector styling with descriptions */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
    background: rgba(139, 92, 246, 0.1);
    padding: 20px;
    border-radius: 12px;
}

.mode-btn {
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: #4c1d95;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mode-desc {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.2;
}

.mode-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.mode-btn.active .mode-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* Help banners */
.help-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 25px;
    border-left: 4px solid #3b82f6;
}

.help-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.help-text {
    font-size: 14px;
    line-height: 1.4;
    color: #1e40af;
}

.help-text code {
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1e40af;
}

.input-help {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    display: block;
    margin-top: 4px;
}

/* Enhanced button styling */
.calculate-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    padding: 18px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.calculate-btn:hover {
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.4);
}

.btn-icon {
    font-size: 18px;
}

/* Results styling */
.results {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left: 5px solid #8b5cf6;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.result-controls {
    display: flex;
    gap: 8px;
}

.copy-btn, .clear-btn {
    padding: 6px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #6d28d9;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.copy-btn:hover, .clear-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

.result-content {
    margin-bottom: 20px;
}

.result-line {
    padding: 12px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    font-family: 'Courier New', monospace;
    color: #4c1d95;
    font-size: 16px;
    font-weight: 500;
}

.result-line:last-child {
    border-bottom: none;
    font-weight: 700;
    color: #6d28d9;
    font-size: 18px;
}

/* Step-by-step solution styling */
.step-solution {
    background: rgba(139, 92, 246, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.step-solution summary {
    padding: 16px;
    cursor: pointer;
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.step-solution summary h4 {
    margin: 0;
    color: #6d28d9;
    font-size: 16px;
}

.solution-steps {
    padding: 16px;
}

.step-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    font-family: 'Courier New', monospace;
    color: #4c1d95;
    line-height: 1.4;
}

.step-item:last-child {
    border-bottom: none;
    font-weight: 600;
}

/* Result explanation */
.result-explanation {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 16px;
    margin-top: 15px;
}

.explanation-header {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
    font-size: 14px;
}

#explanationText {
    color: #78350f;
    font-size: 14px;
    line-height: 1.4;
}

/* Enhanced graph container */
.graph-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.graph-header h3 {
    color: #6d28d9;
    margin: 0;
    font-size: 18px;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Calculator modes */
.calc-mode {
    display: none;
}

.calc-mode.active {
    display: block;
}

/* Info note */
.info-note {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    .mode-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .mode-btn {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .mode-desc {
        font-size: 10px;
    }
    
    .help-banner {
        flex-direction: column;
        gap: 8px;
    }
    
    .result-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .result-controls {
        justify-content: center;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}