/* Loan Comparison Calculator Specific Styles */

/* Input container for form inputs */
.input-container {
    display: flex;
    gap: 8px;
}

/* Input control styling */
.input-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.input-control:hover {
    border-color: #003049;
    box-shadow: 0 0 0 3px rgba(0, 48, 73, 0.1);
}

.input-control:focus {
    outline: none;
    border-color: #003049;
    box-shadow: 0 0 0 3px rgba(0, 48, 73, 0.1);
}

/* Custom select styling */
select.input-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
    background: white url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}

.term-type-select {
    max-width: 120px;
    flex-shrink: 0;
}

/* Error states */
.input-control.error {
    border-color: #dc2626;
    background-color: #fff;
}

.input-control.error:hover {
    border-color: #dc2626;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

.input-control.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-message {
    color: #dc2626;
    font-size: 14px;
    margin-top: 4px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Loans Container */
.loans-container {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

/* Loan Card */
.loan-card {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.loan-card-title {
    color: #003049;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #bae6fd;
}

.loan-card .form-group:last-of-type {
    margin-bottom: 0;
}

/* Comparison Results Grid */
.comparison-grid {
    display: grid;
    gap: 20px;
}

/* Result Card */
.result-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.result-card.best-option {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    position: relative;
}

.result-card.best-option::before {
    content: "Best Option";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.result-card-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.result-card-title {
    color: #003049;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.result-card-body {
    display: grid;
    gap: 12px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: #666;
    font-size: 14px;
}

.result-value {
    color: #003049;
    font-size: 16px;
    font-weight: 600;
}

.result-value.highlight {
    color: #003049;
    font-size: 20px;
}

/* Monthly Payment Highlight */
.monthly-payment-highlight {
    background: linear-gradient(to bottom right, #003049, #00436b);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

.monthly-payment-label {
    color: #bae6fd;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.monthly-payment-value {
    color: white;
    font-size: 28px;
    font-weight: 700;
}

/* Savings Section */
.savings-section {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.savings-title {
    color: #065f46;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.savings-grid {
    display: grid;
    gap: 12px;
}

.savings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 16px;
    border-radius: 6px;
}

.savings-comparison {
    color: #374151;
    font-size: 14px;
}

.savings-amount {
    color: #059669;
    font-size: 16px;
    font-weight: 700;
}

.savings-amount.negative {
    color: #dc2626;
}

/* Button Group */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive Design */
@media (min-width: 768px) {
    .loans-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .loans-container.three-loans {
        grid-template-columns: repeat(3, 1fr);
    }

    .comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-grid.three-loans {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .loans-container,
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .term-type-select {
        max-width: 100%;
    }

    .input-container {
        flex-direction: column;
    }

    .loan-card {
        padding: 16px;
    }

    .monthly-payment-value {
        font-size: 24px;
    }

    .savings-item {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .button-group {
        flex-direction: column;
    }

    .button-group .btn,
    .button-group .share-trigger-btn {
        width: 100%;
    }
}
