body, div, input, li, p, span, td, textarea {
    font-family: arial, helvetica, sans-serif;
    font-size: 16px;
}

.calculator-container {
    background-color: white;
    width: 80%;
    max-width: 450px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 5px #ccc;
}

.input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.input-container label {
    width: 50%;
    text-align: right;
    margin-right: 4%;
}

.input-container input {
    width: 46%;
    padding: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    border: 1px solid #cfd1d8;
    border-radius: 3px;
    outline: none;
    margin-right: 5%;
}

.input-container input::placeholder {
    font-size: 0.8em;
}

#button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#button-container button {
    padding: 10px 20px;
    border: 0;
    color: #fff;
    font-size: 16px;
    background: #084288;
    border-radius: 3px;
    margin: 0 10px;
    cursor: pointer;
}

#button-container button:hover {
    background-color: #434c6d;
}

#result {
    margin-top: 20px;
}

#result h3 {
    text-align: center;
    color: #084288;
    margin-bottom: 15px;
}

.cpa-display {
    background: linear-gradient(135deg, #084288, #434c6d);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 15px;
}

.cpa-display .cpa-value {
    font-size: 3em;
    font-weight: bold;
}

.cpa-display .cpa-label {
    font-size: 1.1em;
    opacity: 0.9;
}

.result-summary {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.result-summary p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.result-summary strong {
    color: #084288;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.metric-card {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.metric-card.revenue {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.metric-card.profit {
    background: #e8f5e9;
    border: 1px solid #4caf50;
}

.metric-card.roi {
    background: #fff3e0;
    border: 1px solid #ff9800;
}

.metric-card.efficiency {
    background: #f3e5f5;
    border: 1px solid #9c27b0;
}

.metric-card .label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.metric-card .value {
    font-size: 1.4em;
    font-weight: bold;
}

.metric-card.revenue .value { color: #1565c0; }
.metric-card.profit .value { color: #2e7d32; }
.metric-card.roi .value { color: #e65100; }
.metric-card.efficiency .value { color: #7b1fa2; }

.target-comparison {
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
}

.target-comparison.under-target {
    background: #e8f5e9;
    border: 1px solid #4caf50;
}

.target-comparison.over-target {
    background: #ffebee;
    border: 1px solid #f44336;
}

.target-comparison h4 {
    margin: 0 0 10px 0;
}

.target-comparison.under-target h4 {
    color: #2e7d32;
}

.target-comparison.over-target h4 {
    color: #c62828;
}

.profitability-alert {
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
}

.profitability-alert.profitable {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.profitability-alert.unprofitable {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.error-message {
    color: red;
    text-align: center;
    margin-bottom: 10px;
}

@media (max-width: 400px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
