/* Import Google Font - Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* Loan Calculator Styles */
.loan-calculator-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.loan-calculator-container {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* Left Panel */
.loan-calculator-left {
    flex: 1;
    padding: 48px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.calculator-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 32px 0;
    letter-spacing: -0.5px;
}

/* Tabs */
.calculator-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 36px;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-button {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tab-button:hover {
    color: #0A192F;
    background: rgba(10, 25, 47, 0.05);
}

.tab-button.active {
    background: linear-gradient(135deg, #0A192F 0%, #050c17 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(10, 25, 47, 0.3);
}

/* Form Styles */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-control {
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    font-weight: 500;
    color: #333;
}

.form-control:hover {
    border-color: #d0d0d0;
}

.form-control:focus {
    outline: none;
    border-color: #0A192F;
    box-shadow: 0 0 0 4px rgba(10, 25, 47, 0.08);
    transform: translateY(-1px);
}

/* Readonly fields - view only */
.form-control.readonly-field {
    background: linear-gradient(135deg, #f0f2f5 0%, #e6e9ef 100%);
    border-color: #ccd1db;
    color: #0A192F;
    font-weight: 700;
    cursor: default;
    user-select: none;
    pointer-events: none;
}

.form-control.readonly-field:hover,
.form-control.readonly-field:focus {
    border-color: #ccd1db;
    box-shadow: none;
    transform: none;
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix .form-control {
    flex: 1;
    padding-right: 60px;
}

.input-suffix {
    position: absolute;
    right: 18px;
    font-size: 14px;
    font-weight: 600;
    color: #0A192F;
    pointer-events: none;
    background: rgba(10, 25, 47, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .form-control {
    padding-left: 40px;
    padding-right: 70px;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 20px;
    filter: grayscale(0.3);
}

.input-with-icon .input-suffix {
    right: 12px;
}

/* Form Row */
.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half {
    flex: 1;
}

/* Bank Select with Logo */
.bank-select-wrapper {
    position: relative;
}

.bank-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%230A192F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 50px;
    padding-left: 60px !important;
    cursor: pointer;
    font-weight: 600;
}

.bank-logo-display {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.bank-logo-display img {
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    display: block;
}

select.form-control:not(.bank-select) {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%230A192F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 50px;
    cursor: pointer;
}

/* Right Panel - Results */
.loan-calculator-right {
    flex: 1;
    padding: 48px;
    background: linear-gradient(135deg, #0A192F 0%, #0d1e3d 50%, #050c17 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.loan-calculator-right::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.result-box {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.result-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 36px 0;
    letter-spacing: -0.3px;
    opacity: 0.95;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.result-item:hover {
    padding-left: 8px;
}

.result-item.total {
    border-bottom: none;
    padding-top: 24px;
    margin-top: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    padding: 24px 16px;
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 12px;
}

.result-label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.result-item.total .result-value {
    font-size: 24px;
}

/* Buttons */
.result-actions {
    display: flex;
    gap: 14px;
    margin-top: 36px;
}

.btn {
    flex: 1;
    padding: 16px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #fff;
    color: #0A192F;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.result-note {
    margin-top: auto;
    padding-top: 24px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 968px) {
    .loan-calculator-container {
        flex-direction: column;
    }
    
    .loan-calculator-left,
    .loan-calculator-right {
        padding: 30px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .loan-calculator-wrapper {
        padding: 0 10px;
    }
    
    .loan-calculator-left,
    .loan-calculator-right {
        padding: 20px;
    }
    
    .calculator-title {
        font-size: 20px;
    }
    
    .calculator-tabs {
        flex-direction: column;
    }
    
    .result-title {
        font-size: 18px;
    }
}


/* Form Group Focus Effect */
.form-group.focused {
    transform: scale(1.01);
    transition: transform 0.2s ease;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth transitions for all interactive elements */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced shadow on hover for inputs */
.form-control:hover:not(:focus) {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Better mobile touch targets */
@media (max-width: 768px) {
    .form-control,
    .btn,
    .tab-button {
        min-height: 48px;
    }
}

/* Gradient animation for result box */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.loan-calculator-right {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Number animation highlight */
@keyframes numberHighlight {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.result-value {
    display: inline-block;
}

/* Tooltip style for form labels */
.form-group label {
    position: relative;
    display: inline-block;
}

/* Enhanced responsive design */
@media (max-width: 968px) {
    .loan-calculator-left,
    .loan-calculator-right {
        padding: 36px;
    }
    
    .calculator-title {
        font-size: 24px;
    }
    
    .result-title {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .loan-calculator-wrapper {
        padding: 0 12px;
        margin: 20px auto;
    }
    
    .loan-calculator-left,
    .loan-calculator-right {
        padding: 24px;
    }
    
    .calculator-title {
        font-size: 22px;
        margin-bottom: 24px;
    }
    
    .result-title {
        font-size: 18px;
        margin-bottom: 24px;
    }
    
    .calculator-tabs {
        gap: 8px;
        padding: 4px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .result-value {
        font-size: 18px;
    }
    
    .result-item.total .result-value {
        font-size: 22px;
    }
}
