/* Frontend Calculator Styling */
.affiliate-calculator {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: var(--calc-bg-color, #ffffff);
    border-radius: var(--calc-border-radius, 12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    box-sizing: border-box;
}

/* Header */
.calc-header h2 {
    color: var(--calc-primary-color, #3A86FF);
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 50px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--calc-primary-color, #3A86FF), var(--calc-secondary-color, #8338EC));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Controls */
.calc-controls {
    margin-bottom: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.control-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.control-item {
    display: flex;
    flex-direction: column;
}

.control-item label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.control-item input,
.control-item select {
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--calc-border-radius, 8px);
    font-size: 18px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.control-item input:focus,
.control-item select:focus {
    outline: none;
    border-color: var(--calc-primary-color, #3A86FF);
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.1);
    transform: translateY(-2px);
}

/* Results Table */
.calc-results {
    margin-bottom: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.earnings-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: var(--calc-border-radius, 12px);
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.table-heading {
    background: linear-gradient(135deg, var(--calc-primary-color, #3A86FF), var(--calc-secondary-color, #8338EC));
    color: white;
    padding: 30px 20px;
}

.table-heading h3 {
    margin: 0;
    text-align: center;
    font-size: 1.6em;
    font-weight: 700;
}

.performance-headers th {
    background: #f8fafc;
    padding: 25px 15px;
    text-align: center;
    font-weight: 700;
    font-size: 1.2em;
    border-bottom: 2px solid #e2e8f0;
}

.performance-earnings td {
    padding: 40px 15px;
    text-align: center;
    font-size: 2em;
    font-weight: 800;
    color: var(--calc-primary-color, #3A86FF);
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    transition: all 0.3s ease;
}

.performance-earnings td:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.earnings-note {
    padding: 30px 20px;
    text-align: center;
    font-style: italic;
    color: #64748b;
    background: #f8fafc;
    font-size: 1.1em;
    line-height: 1.5;
}

/* Chart */
.chart-container {
    margin-top: 50px;
    padding: 40px;
    background: #ffffff;
    border-radius: var(--calc-border-radius, 12px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 1.5em;
    font-weight: 700;
}

#earnings-chart {
    width: 100% !important;
    height: 400px !important;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1em;
    padding: 8px 16px;
}

.legend-item.poor-perf::before {
    content: "";
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    border-radius: 3px;
}

.legend-item.avg-perf::before {
    content: "";
    width: 16px;
    height: 16px;
    background: #4ecdc4;
    border-radius: 3px;
}

.legend-item.high-perf::before {
    content: "";
    width: 16px;
    height: 16px;
    background: #45b7d1;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 1200px) {
    .control-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .affiliate-calculator {
        padding: 30px 15px;
    }
}

@media (max-width: 768px) {
    .affiliate-calculator {
        padding: 20px 10px;
    }
    
    .control-group {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .performance-earnings td {
        font-size: 1.6em;
        padding: 30px 10px;
    }
    
    .calc-header h2 {
        font-size: 2em;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .chart-container {
        padding: 20px;
    }
    
    #earnings-chart {
        height: 300px !important;
    }
}

@media (max-width: 480px) {
    .affiliate-calculator {
        padding: 15px 5px;
    }
    
    .performance-earnings td {
        font-size: 1.4em;
        padding: 25px 8px;
    }
    
    .control-item input,
    .control-item select {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .calc-header h2 {
        font-size: 1.8em;
    }
}