/* Operating Margin Calculator Specific Styles */

/* Expense Category Title */
.expense-category-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin: 20px 0 15px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* Detailed Expenses Section */
#detailed-expenses {
    background: rgba(59, 130, 246, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Margin Breakdown Section */
.margin-breakdown {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.margin-breakdown h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    color: var(--text-light);
    font-size: 0.95rem;
}

.breakdown-value {
    font-weight: 600;
    color: var(--text-color);
}

/* Margin Comparison Visual */
.margin-comparison {
    margin: 40px 0;
}

.comparison-visual {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

.margin-level {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.margin-level:hover {
    transform: translateX(5px);
}

.gross-margin-level {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #22c55e;
}

.operating-margin-level {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
}

.net-margin-level {
    background: rgba(168, 85, 247, 0.1);
    border-left: 4px solid #a855f7;
}

.margin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.margin-header h4 {
    margin: 0;
    color: var(--text-color);
}

.margin-formula {
    font-size: 0.85rem;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

/* Industry Benchmarks */
.benchmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.benchmark-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.benchmark-card.excellent {
    border-top: 3px solid #10b981;
}

.benchmark-card.good {
    border-top: 3px solid #3b82f6;
}

.benchmark-card.moderate {
    border-top: 3px solid #f59e0b;
}

.benchmark-card.low {
    border-top: 3px solid #ef4444;
}

.benchmark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.benchmark-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Improvement Strategies */
.improvement-strategies {
    margin: 40px 0;
}

/* Result Value States */
.result-value.excellent {
    color: #10b981;
    font-weight: 700;
}

.result-value.good {
    color: #3b82f6;
    font-weight: 700;
}

.result-value.warning {
    color: #f59e0b;
    font-weight: 700;
}

.result-value.poor {
    color: #ef4444;
    font-weight: 700;
}

/* Industry Comparison Specific */
#industryComparisonResult {
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .margin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .margin-formula {
        margin-top: 5px;
        font-size: 0.8rem;
    }
    
    .benchmark-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-visual {
        padding: 20px 15px;
    }
}

/* Dark Mode Adjustments */
.dark-mode #detailed-expenses {
    background: rgba(59, 130, 246, 0.1);
}

.dark-mode .margin-breakdown {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .benchmark-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.dark-mode .gross-margin-level {
    background: rgba(34, 197, 94, 0.15);
}

.dark-mode .operating-margin-level {
    background: rgba(59, 130, 246, 0.15);
}

.dark-mode .net-margin-level {
    background: rgba(168, 85, 247, 0.15);
}

/* Print Styles */
@media print {
    .margin-level {
        page-break-inside: avoid;
    }
    
    .benchmark-card {
        page-break-inside: avoid;
    }
}
