/* Car Loan Calculator Styles with Enhanced Features - FIXED CHART POSITIONING */
.clc-calculator-wrapper {
    max-width: 700px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.clc-calculator-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.clc-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.clc-form {
    display: grid;
    gap: 20px;
}

.clc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

.clc-form-group input,
.clc-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.clc-form-group input:focus,
.clc-form-group select:focus {
    border-color: #3498db;
    outline: none;
}

.clc-form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.clc-calculate-btn,
.clc-reset-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-grow: 1;
}

.clc-calculate-btn {
    background: #3498db;
    color: white;
}

.clc-calculate-btn:hover {
    background: #2980b9;
}

.clc-reset-btn {
    background: #95a5a6;
    color: white;
}

.clc-reset-btn:hover {
    background: #7f8c8d;
}

.clc-results {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.clc-results h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

/* FIXED: Better grid layout for results */
.clc-results-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: start;
}

.clc-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.clc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #3498db;
}

.clc-result-item .clc-label {
    font-weight: 500;
    color: #34495e;
}

.clc-result-item .clc-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
}

.clc-monthly-payment-item {
    border-left-color: #e74c3c;
    background-color: #fef5f3;
}

.clc-monthly-payment-item .clc-monthly-payment-label {
    color: #c0392b;
    font-size: 16px;
    font-weight: 600;
}

.clc-monthly-payment-item .clc-monthly-payment-value {
    color: #c0392b;
    font-size: 18px;
    font-weight: 700;
}

/* FIXED: Chart container positioning and sizing */
.clc-chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    height: fit-content; /* CHANGED: Remove min-height and use fit-content */
    max-width: 280px; /* ADDED: Constrain max width */
    justify-self: center; /* ADDED: Center in grid */
}

.clc-chart-container h5 {
    margin: 0 0 15px 0; /* FIXED: Remove top margin */
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

/* FIXED: Chart canvas sizing */
#clc-pie-chart {
    max-width: 240px !important; /* ADDED: Constrain chart size */
    max-height: 240px !important;
    margin: 0 auto;
    display: block;
}

.clc-special-rates-section {
    margin-top: 20px;
    text-align: center;
}

.clc-apply-special-rates-btn {
    background: #e74c3c;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.clc-apply-special-rates-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.clc-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.clc-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: clc-modal-fade-in 0.4s ease;
}

@keyframes clc-modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clc-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.clc-close:hover,
.clc-close:focus {
    color: #000;
}

.clc-modal h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 22px;
}

/* UPDATED: Contact form specific styling with pill-shaped borders */
.clc-modal .clc-form-group input,
.clc-modal .clc-form-group select {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 50px; /* CHANGED: Pill-shaped border radius */
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.clc-modal .clc-form-group input:focus,
.clc-modal .clc-form-group select:focus {
    border-color: #3498db;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clc-modal .clc-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* UPDATED: Better button positioning and styling */
.clc-modal .clc-form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.clc-submit-contact-btn {
    background: #d60107 !important; /* UPDATED: New red color as requested */
    color: #ffffff !important; /* UPDATED: White text as requested */
    padding: 14px 30px;
    border: none;
    border-radius: 50px; /* CHANGED: Pill-shaped button */
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(214, 1, 7, 0.3);
    min-width: 160px;
}

.clc-submit-contact-btn:hover {
    background: #b8010c !important; /* UPDATED: Darker shade for hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 1, 7, 0.4);
}

.clc-submit-contact-btn:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clc-cancel-btn {
    background: #6c757d;
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 50px; /* CHANGED: Pill-shaped button */
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.clc-cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* IMPROVED: Modal form styling */
.clc-modal .clc-form {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.clc-modal .clc-form-group {
    position: relative;
}

/* IMPROVED: Input placeholder styling */
.clc-modal .clc-form-group input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* IMPROVED: Read-only field styling */
.clc-modal .clc-form-group input[readonly] {
    background: #e9ecef;
    color: #495057;
    cursor: not-allowed;
    border-color: #ced4da;
}

/* IMPROVED: Mobile responsive design */
@media (max-width: 768px) {
    .clc-calculator-wrapper {
        margin: 10px;
    }
    .clc-calculator-container {
        padding: 20px;
    }
    /* FIXED: Stack layout on mobile with proper ordering */
    .clc-results-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .clc-chart-container {
        order: 2; /* CHANGED: Chart comes after results on mobile */
        max-width: 100%;
        margin: 0 auto;
    }
    #clc-pie-chart {
        max-width: 200px !important;
        max-height: 200px !important;
    }
    .clc-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 25px;
    }
    
    /* UPDATED: Mobile button styling */
    .clc-modal .clc-form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .clc-submit-contact-btn,
    .clc-cancel-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .clc-apply-special-rates-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    .clc-form-actions {
        flex-direction: column;
    }
    #clc-pie-chart {
        max-width: 180px !important;
        max-height: 180px !important;
    }
    
    .clc-modal-content {
        padding: 20px;
    }
    
    .clc-modal .clc-form-group input,
    .clc-modal .clc-form-group select {
        padding: 12px 18px;
    }
}