/**
 * Advanced EMI Calculator Styles
 * Provides all styling and mobile responsiveness for the calculator.
 */
#emi-calculator-pro-tool {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e1e1e1;
    margin: 20px auto;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}
#emi-calculator-pro-tool .form-group { margin-bottom: 22px; }
#emi-calculator-pro-tool label {
    display: block; margin-bottom: 8px; font-weight: 600; font-size: 15px; color: #333;
}
#emi-calculator-pro-tool .input-group { display: flex; align-items: center; gap: 15px; }
#emi-calculator-pro-tool .input-container { display: flex; align-items: center; gap: 10px; }
#emi-calculator-pro-tool input[type="number"] {
    width: 140px; padding: 10px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; text-align: center; font-weight: 500;
}
#emi-calculator-pro-tool input[type="range"] {
    flex-grow: 1; -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; background: #e9ecef; border-radius: 5px; outline: none; cursor: pointer;
}
#emi-calculator-pro-tool input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: #1e73be;
    border-radius: 50%; border: 2px solid white; box-shadow: 0 0 5px rgba(0,0,0,0.2); cursor: pointer;
}
#emi-calculator-pro-tool input[type=range]::-moz-range-thumb {
    width: 18px; height: 18px; background: #1e73be; border-radius: 50%; border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.2); cursor: pointer;
}
#emi-calculator-pro-tool #tenureType {
    padding: 10px; border-radius: 6px; border: 1px solid #ccc; background-color: #f9f9f9;
}
#emi-calculator-pro-tool .prepayment-toggle { margin: 20px 0 15px 0; font-size: 14px; }
#emi-calculator-pro-tool #prepaymentSection { display: none; }
#emi-calculator-pro-tool .calculator-actions { display: flex; gap: 10px; margin-top: 25px; flex-wrap: wrap; }
#emi-calculator-pro-tool .calculator-button {
    flex: 1; padding: 12px; border: none; border-radius: 6px; color: white;
    font-size: 16px; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 120px;
}
#emi-calculator-pro-tool .calculator-button:active { transform: scale(0.98); }
#emi-calculator-pro-tool #calculateBtn { background-color: #1e73be; }
#emi-calculator-pro-tool #calculateBtn:hover { background-color: #165a94; }
#emi-calculator-pro-tool #resetBtn { background-color: #6c757d; }
#emi-calculator-pro-tool #resetBtn:hover { background-color: #5a6268; }
#emi-calculator-pro-tool #printBtn, #emi-calculator-pro-tool #exportBtn {
    background-color: #28a745; display: none;
}
#emi-calculator-pro-tool #printBtn:hover, #emi-calculator-pro-tool #exportBtn:hover { background-color: #218838; }
#emi-calculator-pro-tool .error-message {
    color: #d9534f; background-color: #f2dede; border: 1px solid #ebccd1;
    padding: 12px; border-radius: 6px; margin-top: 15px; display: none;
}
#emi-calculator-pro-tool .results-container {
    margin-top: 30px; display: none; animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
#emi-calculator-pro-tool .results-summary { display: grid; grid-template-columns: 250px 1fr; gap: 30px; align-items: center; }
#emi-calculator-pro-tool .chart-container { position: relative; height: 250px; width: 250px; margin: 0 auto; }
#emi-calculator-pro-tool .summary-details { padding: 20px; background-color: #f8f9fa; border-radius: 8px; }
#emi-calculator-pro-tool .summary-details h3 { margin: 0 0 15px 0; font-size: 20px; color: #333; }
#emi-calculator-pro-tool .summary-details p { margin: 10px 0; font-size: 15px; display: flex; justify-content: space-between; }
#emi-calculator-pro-tool .summary-details p span { font-weight: 600; color: #1e73be;}
#emi-calculator-pro-tool .prepayment-info {
    font-size: 14px; background-color: #e9f5ff; padding: 12px; border-radius: 5px; margin-top: 15px; color: #005a9c; border-left: 4px solid #1e73be;
}
#emi-calculator-pro-tool .amortization { margin-top: 30px; }
#emi-calculator-pro-tool table { width: 100%; border-collapse: collapse; margin-top: 15px; }
#emi-calculator-pro-tool th, #emi-calculator-pro-tool td {
    border: 1px solid #ddd; padding: 10px 12px; text-align: right; font-size: 14px;
}
#emi-calculator-pro-tool th { background-color: #f2f2f2; text-align: center; font-weight: 600; }
#emi-calculator-pro-tool td:first-child, #emi-calculator-pro-tool th:first-child { text-align: center; }
@media (max-width: 768px) {
    #emi-calculator-pro-tool { padding: 20px; }
    #emi-calculator-pro-tool .input-group { flex-direction: column; align-items: stretch; }
    #emi-calculator-pro-tool .input-container { width: 100%; }
    #emi-calculator-pro-tool .input-container input[type="number"] { flex-grow: 1; }
    #emi-calculator-pro-tool .input-group input[type="range"] { margin-top: 10px; }
    #emi-calculator-pro-tool .results-summary { grid-template-columns: 1fr; }
    #emi-calculator-pro-tool .chart-container { height: 220px; width: 220px; }
    #emi-calculator-pro-tool .calculator-actions { flex-direction: column; }
    #emi-calculator-pro-tool table, #emi-calculator-pro-tool thead, #emi-calculator-pro-tool tbody, #emi-calculator-pro-tool th, #emi-calculator-pro-tool td, #emi-calculator-pro-tool tr { 
        display: block; 
    }
    #emi-calculator-pro-tool thead tr { 
        position: absolute; top: -9999px; left: -9999px;
    }
    #emi-calculator-pro-tool tr { 
        border: 1px solid #ddd; border-radius: 6px; margin-bottom: 10px; background: #fdfdfd;
    }
    #emi-calculator-pro-tool td {
        border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; text-align: right;
    }
    #emi-calculator-pro-tool td:last-child { border-bottom: none; }
    #emi-calculator-pro-tool td:before {
        position: absolute; top: 50%; transform: translateY(-50%); left: 10px; width: 45%; 
        padding-right: 10px; white-space: nowrap; content: attr(data-label);
        font-weight: 600; text-align: left; color: #555;
    }
}