/* Premium EMI Calculator - Complete Fixed Version for All Devices */

.premium-emi-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
}

/* Side by Side Container */
.premium-emi-container {
    display: flex;
    gap: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 40px;
    padding: 30px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

/* Left Side - Calculator */
.calculator-left {
    flex: 0 0 45%;
}

.calculator-card {
    background: white;
    border-radius: 32px;
    padding: 30px;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.calc-header {
    text-align: center;
    margin-bottom: 25px;
}

.calc-header i {
    font-size: 50px;
    color: #667eea;
    background: #f0f3ff;
    padding: 15px;
    border-radius: 20px;
    margin-bottom: 15px;
}

.calc-header h2 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 5px;
    font-weight: 600;
}

.calc-header p {
    color: #6b7280;
    font-size: 15px;
}

/* Form Fields */
.form-field {
    margin-bottom: 22px;
}

.form-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-field label i {
    color: #667eea;
    margin-right: 8px;
}

/* ===== FIXED CURRENCY SELECT - FULL VISIBILITY IN CHROME ===== */
.premium-select {
    width: 100%;
    padding: 16px 20px !important;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 16px !important;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    color: #1f2937;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 55px !important;
    
    /* Use browser default to show symbols */
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    
    /* Remove any custom styling that might hide symbols */
    background-image: none;
}

/* Style options to ensure symbols show clearly */
.premium-select option {
    font-size: 16px !important;
    padding: 12px !important;
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    color: #1f2937;
    background: white;
    min-height: 45px !important;
}

/* Special handling for RTL currencies like AED and SAR */
.premium-select option[value="AED"],
.premium-select option[value="SAR"] {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: ltr;
    unicode-bidi: embed;
}

/* Hover and focus states */
.premium-select:hover {
    border-color: #667eea;
}

.premium-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.premium-select.small {
    width: 130px;
}

/* ===== FIXED CURRENCY BADGE - FULL VISIBILITY ===== */
.currency-badge {
    background: #667eea;
    color: white;
    padding: 16px 20px !important;
    border-radius: 16px;
    font-size: 20px !important;
    font-weight: 700;
    min-width: 75px;
    min-height: 55px !important;
    text-align: center;
    box-shadow: 0 8px 15px rgba(102,126,234,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    line-height: 1.5 !important;
    height: auto !important;
}

/* Amount Field */
.amount-field {
    display: flex;
    gap: 12px;
}

/* ===== FIXED INPUT - FULL VISIBILITY IN CHROME ===== */
.premium-input {
    flex: 1;
    padding: 16px 20px !important;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 16px !important;
    font-weight: 500;
    transition: all 0.3s;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 55px !important;
}

.premium-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

/* Tenure Field */
.tenure-field {
    display: flex;
    gap: 12px;
}

/* Quick Buttons */
.quick-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-btn, .rate-btn, .tenure-btn {
    padding: 10px 18px !important;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 30px;
    font-size: 14px !important;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    line-height: 1.4 !important;
    min-height: 42px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-btn:hover, .rate-btn:hover, .tenure-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102,126,234,0.2);
}

/* Active state for buttons */
.quick-btn.active, .rate-btn.active, .tenure-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Premium Button */
.premium-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 18px 24px !important;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 15px 25px rgba(102,126,234,0.3);
    margin-top: 15px;
    line-height: 1.5 !important;
    min-height: 60px !important;
}

.premium-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 35px rgba(102,126,234,0.4);
}

.premium-btn i {
    transition: transform 0.3s;
}

.premium-btn:hover i {
    transform: translateX(5px);
}

.btn-loader {
    text-align: center;
    color: #667eea;
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
    padding: 10px;
}

/* Right Side - Results */
.results-right {
    flex: 0 0 55%;
}

/* Animation Area */
.animation-area {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 25px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Money Rain Animation */
.money-animation {
    position: relative;
    height: 120px;
}

.money-animation i {
    position: absolute;
    color: rgba(255,255,255,0.9);
    font-size: 32px;
    animation: moneyRain 3s linear infinite;
}

.coin-1 { left: 5%; animation-delay: 0s; }
.coin-2 { left: 15%; animation-delay: 0.3s; }
.coin-3 { left: 25%; animation-delay: 0.6s; }
.coin-4 { left: 35%; animation-delay: 0.9s; }
.coin-5 { left: 45%; animation-delay: 1.2s; }
.coin-6 { left: 55%; animation-delay: 1.5s; }
.coin-7 { left: 65%; animation-delay: 1.8s; }
.coin-8 { left: 75%; animation-delay: 2.1s; }
.coin-9 { left: 85%; animation-delay: 2.4s; }
.coin-10 { left: 95%; animation-delay: 2.7s; }

@keyframes moneyRain {
    0% {
        top: -50px;
        transform: rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 160px;
        transform: rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

.animation-text {
    text-align: center;
    margin-top: 20px;
}

.animation-text .emoji {
    font-size: 40px;
    margin: 0 12px;
    display: inline-block;
    animation: bounce 2s ease infinite;
}

/* Results Card */
.results-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideUp 0.5s ease-out;
}

.results-heading {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-heading i {
    color: #667eea;
    font-size: 26px;
}

/* Main EMI Display */
.emi-display {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    margin-bottom: 25px;
    color: white;
    box-shadow: 0 10px 20px rgba(102,126,234,0.2);
}

.emi-label {
    display: block;
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.emi-number {
    display: block;
    font-size: 44px;
    font-weight: 700;
    margin: 12px 0;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.emi-note {
    display: block;
    font-size: 14px;
    opacity: 0.8;
}

/* Detail Row */
.detail-row {
    margin-bottom: 22px;
}

.detail-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.detail-info i {
    width: 38px;
    height: 38px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 18px;
}

.detail-info div {
    flex: 1;
}

.detail-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 3px;
}

.detail-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

/* Progress Bars */
.detail-bar {
    height: 10px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
    margin-left: 50px;
}

.bar-progress {
    height: 100%;
    background: #667eea;
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.summary-card {
    background: #f9fafb;
    border-radius: 18px;
    padding: 18px 12px;
    text-align: center;
    border: 1px solid #f3f4f6;
    transition: all 0.2s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.summary-card i {
    font-size: 26px;
    color: #667eea;
    margin-bottom: 8px;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

/* Easy Explanation */
.easy-explanation {
    background: #f0f9ff;
    border-radius: 16px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.easy-explanation p {
    margin: 12px 0;
    font-size: 15px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 12px;
}

.easy-explanation i {
    font-size: 18px;
}

.easy-explanation strong {
    color: #1f2937;
    margin-left: 5px;
    font-size: 16px;
}

/* Footer Note */
.calculator-footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    font-size: 14px;
    opacity: 0.9;
    padding: 10px;
}

/* ========== ANIMATIONS ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ========== RESPONSIVE DESIGN - OPTIMIZED FOR MOBILE ========== */

/* Large Desktop */
@media (min-width: 1200px) {
    .premium-emi-container {
        padding: 35px;
    }
}

/* Desktop */
@media (max-width: 1199px) {
    .premium-emi-container {
        padding: 25px;
        gap: 25px;
    }
}

/* Tablet Landscape */
@media (max-width: 991px) {
    .premium-emi-container {
        flex-direction: column;
    }
    
    .calculator-left,
    .results-right {
        flex: 0 0 100%;
    }
    
    .animation-area {
        min-height: 160px;
    }
}

/* ===== MOBILE OPTIMIZED - RESULTS SCROLL FIX ===== */
@media (max-width: 767px) {
    .premium-emi-wrapper {
        padding: 10px;
    }
    
    .premium-emi-container {
        padding: 15px;
        border-radius: 25px;
        gap: 15px;
    }
    
    .calculator-card {
        padding: 20px;
    }
    
    .calc-header h2 {
        font-size: 24px;
    }
    
    .calc-header i {
        font-size: 40px;
        padding: 12px;
    }
    
    /* Adjust heights for mobile */
    .premium-select,
    .premium-input,
    .currency-badge {
        min-height: 50px !important;
        padding: 12px 16px !important;
        font-size: 15px !important;
    }
    
    .quick-btn, .rate-btn, .tenure-btn {
        padding: 8px 14px !important;
        font-size: 13px !important;
        min-height: 38px !important;
    }
    
    .premium-btn {
        padding: 16px !important;
        font-size: 16px;
        min-height: 55px !important;
    }
    
    /* Results Card - Mobile Optimized */
    .results-card {
        padding: 20px;
        margin-top: 10px;
    }
    
    .emi-number {
        font-size: 32px;
        word-break: break-word;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .summary-card {
        min-height: 80px;
        padding: 12px;
    }
    
    .detail-bar {
        margin-left: 0;
    }
    
    .detail-info i {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .detail-value {
        font-size: 18px;
    }
    
    .easy-explanation p {
        font-size: 14px;
        flex-wrap: wrap;
    }
    
    /* Animation area smaller on mobile */
    .animation-area {
        min-height: 120px;
        padding: 15px;
    }
    
    .money-animation {
        height: 80px;
    }
    
    .money-animation i {
        font-size: 24px;
    }
    
    .animation-text .emoji {
        font-size: 30px;
        margin: 0 8px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .amount-field,
    .tenure-field {
        flex-direction: column;
    }
    
    .currency-badge {
        width: 100%;
        min-width: 100%;
    }
    
    .premium-select.small {
        width: 100%;
    }
    
    .quick-buttons {
        justify-content: center;
        gap: 5px;
    }
    
    .quick-btn, .rate-btn, .tenure-btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
    
    .emi-number {
        font-size: 28px;
    }
    
    .emi-label {
        font-size: 13px;
    }
    
    .emi-note {
        font-size: 12px;
    }
    
    .results-heading {
        font-size: 20px;
    }
    
    .detail-label {
        font-size: 12px;
    }
    
    .summary-label {
        font-size: 11px;
    }
    
    .summary-value {
        font-size: 16px;
    }
    
    /* Scroll fix for mobile */
    html {
        scroll-behavior: smooth;
    }
}

/* Extra Small Mobile */
@media (max-width: 375px) {
    .premium-emi-container {
        padding: 12px;
    }
    
    .calculator-card {
        padding: 15px;
    }
    
    .calc-header h2 {
        font-size: 22px;
    }
    
    .calc-header p {
        font-size: 13px;
    }
    
    .premium-select,
    .premium-input,
    .currency-badge {
        min-height: 48px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    .emi-number {
        font-size: 24px;
    }
    
    .emi-display {
        padding: 20px 15px;
    }
    
    .detail-value {
        font-size: 16px;
    }
    
    .easy-explanation {
        padding: 15px;
    }
    
    .easy-explanation p {
        font-size: 13px;
    }
}

/* Very Small Mobile */
@media (max-width: 320px) {
    .premium-emi-wrapper {
        padding: 5px;
    }
    
    .premium-emi-container {
        padding: 10px;
    }
    
    .quick-btn, .rate-btn, .tenure-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    .emi-number {
        font-size: 22px;
    }
    
    .results-card {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .premium-emi-container {
        background: white;
        box-shadow: none;
    }
    
    .animation-area,
    .premium-btn,
    .btn-loader {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .premium-emi-container {
        background: linear-gradient(135deg, #1a237e, #4a148c);
    }
}

/* Chrome Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .premium-select,
    .premium-input,
    .currency-badge,
    .quick-btn,
    .rate-btn,
    .tenure-btn,
    .premium-btn {
        -webkit-appearance: none;
        appearance: none;
    }
    
    .premium-select {
        text-indent: 1px;
        text-overflow: '';
    }
}