/**
 * Common CSS for Loan Calculators Suite
 */

/* Common Calculator Container */
.lcs-calculator {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 24px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border: 1px solid #e5e7eb;
}

.lcs-calculator h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    position: relative;
}

.lcs-calculator h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #0073aa, #005f8b);
    border-radius: 2px;
}

.lcs-calculator h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 500;
    color: #444;
}

/* Calculator Sections */
.lcs-calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.lcs-calculator-section {
    flex: 1;
    min-width: 280px;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.lcs-calculator-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Form Elements */
.lcs-form-group {
    margin-bottom: 18px;
}

.lcs-form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    gap: 6px;
}

.lcs-form-group label::before {
    content: '';
    width: 4px;
    height: 4px;
    background-color: #0073aa;
    border-radius: 50%;
    flex-shrink: 0;
}

.lcs-input-group {
    display: flex;
    align-items: center;
    position: relative;
}

/* Input wrapper for currency and percentage symbols */
.lcs-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.lcs-currency-symbol {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    font-weight: 600;
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.lcs-percentage-symbol {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    font-weight: 600;
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.lcs-unit-label {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

/* Adjust input padding when symbols are present */
.lcs-input-wrapper .lcs-currency-symbol + input {
    padding-left: 40px !important;
}

.lcs-input-wrapper input + .lcs-percentage-symbol,
.lcs-input-wrapper input + .lcs-unit-label {
    right: 16px;
}

.lcs-input-wrapper input:has(+ .lcs-percentage-symbol),
.lcs-input-wrapper input:has(+ .lcs-unit-label) {
    padding-right: 50px !important;
}

.lcs-currency {
    position: absolute;
    left: 16px;
    color: #4b5563;
    z-index: 1;
    font-weight: 600;
    font-size: 16px;
    top: 50% !important;
    transform: translateY(-50%);
}

.lcs-currency-input {
    padding-left: 40px !important;
}

/* Icon support */
.lcs-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.lcs-icon-calculator::before {
    content: '🧮';
    font-size: 16px;
}

.lcs-icon-money::before {
    content: '💰';
    font-size: 16px;
}

.lcs-icon-chart::before {
    content: '📊';
    font-size: 16px;
}

.lcs-icon-time::before {
    content: '⏰';
    font-size: 16px;
}

.lcs-icon-percent::before {
    content: '📈';
    font-size: 16px;
}

.lcs-input-group input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    transition: all 0.2s ease;
    width: 100%;
    min-width: 180px !important;
    max-width: 300px !important;
}

.lcs-input-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background-color: #fafbfc;
}

.lcs-input-group select {
    margin-left: 12px;
    padding: 2px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 140px;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

.lcs-input-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Toggle Buttons */
.lcs-toggle-group {
    display: flex;
    margin-bottom: 10px;
}

.lcs-toggle-btn {
    flex: 1;
    padding: 12px 18px;
    background-color: #fff;
    border: 2px solid #e5e7eb;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 15px;
    position: relative;
    color: blakc !important;
    line-height: 1.2;
}

.lcs-toggle-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.lcs-toggle-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.lcs-toggle-btn.active {
    background: linear-gradient(135deg, #0073aa, #005f8b);
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-1px);
}

/* Number Group */
.lcs-number-group {
    display: flex;
    margin-bottom: 10px;
}

.lcs-number-btn {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e5e7eb;
	    background-color: #fff;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 15px;
    position: relative;
    color: black !important;
    line-height: 1.2;
}

.lcs-number-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.lcs-number-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.lcs-number-btn.active {
    background: linear-gradient(135deg, #0073aa, #005f8b);
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-1px);
}

/* Results Section */
.lcs-results-section {
    padding: 24px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.1);
    margin-bottom: 24px;
    border: 1px solid #bae6fd;
    position: relative;
    overflow: hidden;
}

.lcs-results-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0073aa, #005f8b);
}

.lcs-results-section h3 {
    color: #0073aa;
    margin-top: 0;
}

.lcs-result-value {
    font-size: 28px;
    font-weight: 700;
    color: #0073aa;
    margin: 12px 0;
    text-shadow: 0 1px 2px rgba(0, 115, 170, 0.1);
}

.lcs-result-label {
    font-size: 14px;
    color: #666;
}

/* Chart Container */
.lcs-chart-container {
    margin-top: 24px;
    padding: 24px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.lcs-chart-container h3 {
    margin-top: 0;
    text-align: center;
}

.lcs-chart-wrapper {
    position: relative;
    height: 300px;
}

/* Buttons */
.lcs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0073aa, #005f8b);
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
    position: relative;
    overflow: hidden;
    line-height: 1.2;
}

.lcs-btn:hover {
    background: linear-gradient(135deg, #005f8b, #004a6b);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.3);
}

.lcs-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.lcs-btn-secondary {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: #374151;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lcs-btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.lcs-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* Tables */
.lcs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lcs-table th,
.lcs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.lcs-table th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.lcs-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.lcs-table tr:hover {
    background-color: #f0f9ff;
    transition: background-color 0.2s ease;
}

/* Assumptions Modal */
.lcs-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.lcs-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lcs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.lcs-modal-header h3 {
    margin: 0;
}

.lcs-modal-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

/* Compact mode utilities */
.lcs-compact .lcs-form-group {
    margin-bottom: 12px;
}

.lcs-compact .lcs-calculator-section {
    padding: 16px;
}

.lcs-compact .lcs-input-group input,
.lcs-compact .lcs-input-group select {
    padding: 10px 14px;
    min-width: 160px;
    max-width: 220px;
}

.lcs-compact .lcs-results-section {
    padding: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .lcs-calculator {
        margin: 0 auto 16px;
        padding: 16px;
    }
    
    .lcs-calculator-section {
        min-width: 100%;
        padding: 16px;
    }
    
    .lcs-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .lcs-input-group input {
        max-width: 100%;
        min-width: 100%;
        font-size: 16px;
    }
    
    .lcs-input-group select {
        margin-left: 0;
        margin-top: 12px;
        min-width: 100%;
        font-size: 16px;
    }
    
    .lcs-calculator h2 {
        font-size: 24px;
    }
    
    .lcs-result-value {
        font-size: 24px;
    }
    
    .lcs-btn-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .lcs-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }
    
    /* Currency symbol responsive adjustments */
    .lcs-currency-symbol,
    .lcs-percentage-symbol {
        font-size: 14px;
    }
    
    .lcs-unit-label {
        font-size: 12px;
    }
    
    .lcs-input-wrapper .lcs-currency-symbol + input {
        padding-left: 35px !important;
    }
    
    .lcs-input-wrapper input:has(+ .lcs-percentage-symbol),
    .lcs-input-wrapper input:has(+ .lcs-unit-label) {
        padding-right: 45px !important;
    }
}
