/* ===== FINANCIAL FORMULAS SPECIFIC STYLES ===== */
/* Extends guide.css without modifying the shared file */

/* Formula Master Card */
.formula-master-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    margin: 2rem 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.formula-master-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.formula-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.formula-header i {
    color: #3b82f6;
    font-size: 1.5rem;
}

.formula-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.formula-tag {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.formula-tag.popular {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.formula-content {
    padding: 2rem;
}

.formula-equation {
    background: #1f2937;
    color: #e5e7eb;
    padding: 2rem;
    border-radius: 12px;
    font-family: ui-monospace, Menlo, Monaco, "Courier New", monospace;
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid #374151;
    font-weight: 600;
}

.formula-explanation {
    margin-bottom: 2rem;
}

.formula-explanation p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
    font-style: italic;
}

.formula-variables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.variable-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.variable-symbol {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.variable-desc {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

.formula-example {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-top: 1px solid #bfdbfe;
    padding: 1.5rem 2rem;
}

.formula-example h5 {
    margin: 0 0 1rem 0;
    color: #1e40af;
    font-size: 1rem;
    font-weight: 600;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.example-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.example-item span {
    color: #6b7280;
    font-size: 0.9rem;
}

.example-item strong {
    color: #1f2937;
    font-weight: 600;
}

.example-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 0 0;
    margin-top: 1rem;
    border-top: 2px solid #bfdbfe;
}

.result-highlight {
    color: #dc2626 !important;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Compact Formulas Grid */
.formulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.formula-compact-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.formula-compact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.formula-compact-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.formula-compact-header i {
    color: #3b82f6;
    font-size: 1.25rem;
}

.formula-compact-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.formula-compact-equation {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 8px;
    font-family: ui-monospace, Menlo, Monaco, "Courier New", monospace;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
    border: 1px solid #374151;
}

.formula-compact-desc {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Rule of Thumb Grid */
.rule-of-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.rule-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rule-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #10b981;
}

.rule-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.rule-card h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.rule-equation {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem;
    font-family: ui-monospace, Menlo, Monaco, "Courier New", monospace;
    font-size: 0.9rem;
    color: #1e40af;
    font-weight: 600;
    margin-bottom: 1rem;
}

.rule-card p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Formula Complexity Indicators */
.complexity-indicator {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.complexity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
}

.complexity-dot.active {
    background: #3b82f6;
}

/* Interactive Formula Demo */
.formula-demo {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.demo-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.demo-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.demo-input label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.demo-input input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.demo-result {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .formula-header {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .formula-equation {
        font-size: 1rem;
        padding: 1.5rem;
    }
    
    .formula-variables {
        grid-template-columns: 1fr;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
    
    .formulas-grid {
        grid-template-columns: 1fr;
    }
    
    .rule-of-thumb-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-inputs {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .formula-master-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .formula-equation {
        background: #f8f9fa;
        color: #000;
        border: 1px solid #ccc;
    }
}

/* Animation for formula cards */
@keyframes formulaSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.formula-master-card {
    animation: formulaSlideIn 0.6s ease-out;
}