﻿/* --- Global & Variables (Fintech Theme) --- */
:root {
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --brand-blue: #002970;     /* Paytm-like deep blue */
    --brand-light: #e0f2fe;
    --accent-blue: #0ea5e9;
    --success: #10b981;
    --danger: #ef4444;
    --border-color: #e5e7eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-body); color: var(--text-primary); }

/* --- CSS Grid Layout (The Brains of Adaptability) --- */
.fintech-layout {
    display: grid;
    /* Mobile First: 1 single column */
    grid-template-columns: 1fr;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav on mobile */
}

/* --- Center Dashboard --- */
.center-dashboard { padding: 20px; }

.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.store-name { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.greeting-box h1 { font-size: 1.5rem; color: var(--brand-blue); font-weight: 700; margin-top: 2px; }

.trust-score { padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Hero Money Card (Glass/Gradient effect) */
.money-card-glass {
    position: relative;
    background: linear-gradient(135deg, #002970 0%, #0047ba 100%);
    border-radius: 20px;
    padding: 25px;
    color: white;
    box-shadow: 0 15px 30px rgba(0, 41, 112, 0.2);
    overflow: hidden;
    margin-bottom: 30px;
}
.card-bg-graphics {
    position: absolute; right: -20px; top: -20px; width: 150px; height: 150px;
    background: rgba(255,255,255,0.05); border-radius: 50%;
}
.due-info p { font-size: 0.9rem; color: rgba(255,255,255,0.8); font-weight: 500; }
.amount { font-size: 2.8rem; font-weight: 800; margin: 5px 0 15px; }
.amount span { font-size: 1.5rem; opacity: 0.8; font-weight: 500; }
.credit-limit { display: inline-block; background: rgba(0,0,0,0.2); padding: 5px 10px; border-radius: 6px; font-size: 0.8rem; }
.btn-pay-upi {
    margin-top: 15px; width: 100%; background: #ffffff; color: var(--brand-blue);
    border: none; padding: 14px; border-radius: 12px; font-size: 1rem; font-weight: 700;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    transition: transform 0.2s;
}
.btn-pay-upi:active { transform: scale(0.98); }

/* Services Grid */
.services-section h3 { font-size: 1.1rem; margin-bottom: 15px; color: var(--text-primary); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.service-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.icon-wrap { width: 50px; height: 50px; border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 1.4rem; background: var(--bg-surface); box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.icon-wrap.blue { color: #3b82f6; } .icon-wrap.red { color: #ef4444; } .icon-wrap.orange { color: #f59e0b; } .icon-wrap.green { color: #10b981; }
.service-box span { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }

/* Right Panel (Mobile View) */
.right-panel { padding: 0 20px 20px 20px; }
.promo-banner { background: linear-gradient(to right, #0ea5e9, #3b82f6); border-radius: 16px; padding: 20px; color: white; display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.promo-text h3 { font-size: 1.1rem; margin-bottom: 5px; }
.promo-text p { font-size: 0.8rem; margin-bottom: 10px; opacity: 0.9; }
.promo-text button { background: white; color: #0ea5e9; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.promo-banner img { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; }

.catalog-section h3 { font-size: 1.1rem; margin-bottom: 15px; }
.desktop-catalog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.catalog-card { background: var(--bg-surface); border-radius: 12px; padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.catalog-card img { width: 100%; height: 90px; border-radius: 8px; object-fit: cover; margin-bottom: 10px; }
.card-body h4 { font-size: 0.85rem; margin-bottom: 5px; }
.card-body .price { font-weight: 700; color: var(--brand-blue); margin-bottom: 8px; }
.add-btn { width: 100%; border: 1px solid var(--brand-blue); background: transparent; color: var(--brand-blue); border-radius: 6px; padding: 5px; font-weight: 600; cursor: pointer; }

/* Desktop Elements hidden on mobile */
.desktop-only { display: none; }

/* =========================================
   ðŸ’» DESKTOP & TABLET MEDIA QUERIES
   ========================================= */
@media (min-width: 992px) {
    body { background-color: #eaeff5; /* Slightly darker desktop bg for contrast */ }
    
    .desktop-only { display: block; }
    
    /* The 2-Column Magic Grid (Sidebar is fixed outside via theme.css) */
    .fintech-layout {
        grid-template-columns: 1fr 340px; /* Main | Promo Panel */
        max-width: 1100px;
        margin: 0 auto;
        padding: 20px;
        gap: 25px;
        padding-bottom: 20px; /* Remove mobile bottom padding */
    }

    /* Center Content Adjustments */
    .center-dashboard { padding: 0; }
    .money-card-glass {
        display: flex; justify-content: space-between; align-items: center; padding: 35px;
    }
    .card-content { display: flex; width: 100%; justify-content: space-between; align-items: center; }
    .pay-action { width: 200px; }
    .btn-pay-upi { margin-top: 0; }

    /* Mini Passbook Layout */
    .section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
    .section-title-row a { color: var(--accent-blue); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
    .history-item { display: flex; align-items: center; background: var(--bg-surface); padding: 15px; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
    .history-item .icon-wrap { width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; margin-right: 15px; }
    .history-item .item-details { flex-grow: 1; }
    .history-item .title { font-weight: 600; font-size: 0.9rem; }
    .history-item .date { font-size: 0.75rem; color: var(--text-secondary); }
    .history-item .amount { font-weight: 700; font-size: 1rem; }
    .text-danger { color: var(--danger); }
    .text-success { color: var(--success); }

    /* Right Panel Adjustments */
    .right-panel { padding: 0; position: sticky; top: 20px; height: calc(100vh - 40px); overflow-y: auto; }
    .right-panel::-webkit-scrollbar { display: none; }
}

/* ===========================================
   âœ¨ PRODUCTION ADDITIONS
   =========================================== */

/* â”€â”€ Pending Alert Banner â”€â”€ */
.pending-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1100;
}
.pending-alert i { font-size: 1rem; color: #ef4444; flex-shrink: 0; }
.pending-alert a { color: #dc2626; font-weight: 700; margin-left: 4px; }

/* â”€â”€ Credit Utilization Progress Bar â”€â”€ */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 99px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: #10b981;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.4s ease;
}

/* â”€â”€ Trust Score Variants â”€â”€ */
.trust-score.excellent { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.trust-score.good      { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.trust-score.poor      { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* â”€â”€ Pay Button disabled state â”€â”€ */
.btn-pay-upi:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* â”€â”€ Multi-Store Switcher â”€â”€ */
.store-switcher-wrap { margin-bottom: 6px; }
.store-select-dropdown {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--brand-blue);
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--brand-blue);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
}

/* â”€â”€ Service Box as Link â”€â”€ */
.service-box {
    text-decoration: none;
    transition: transform 0.15s ease;
}
.service-box:hover { transform: translateY(-3px); }
.service-box:active { transform: scale(0.97); }

/* â”€â”€ Right Panel Link Cards â”€â”€ */
.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}
.link-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.link-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--brand-blue);
    flex-shrink: 0;
}
.link-card .card-body h4 { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.link-card .card-body .price { font-size: 0.72rem; color: var(--text-secondary); font-weight: 400; }

/* â”€â”€ History â”€â”€ */
.recent-history { margin-top: 20px; }
.history-item { display: flex; align-items: center; background: var(--bg-surface); padding: 14px; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.history-item .icon-wrap { width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; margin-right: 14px; flex-shrink: 0; }
.history-item .item-details { flex-grow: 1; }
.history-item .title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.history-item .date { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.history-item .amount { font-weight: 700; font-size: 0.95rem; flex-shrink: 0; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title-row h3 { font-size: 1.05rem; font-weight: 700; }
.section-title-row a { color: var(--accent-blue); text-decoration: none; font-size: 0.85rem; font-weight: 600; }

/* â”€â”€ Icon bg variants â”€â”€ */
.icon-wrap.bg-light-red   { background: #fef2f2; color: #ef4444; }
.icon-wrap.bg-light-green { background: #ecfdf5; color: #10b981; }

/* â”€â”€ History empty / error state â”€â”€ */
.history-empty {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-secondary);
}
.history-empty i { font-size: 2.5rem; margin-bottom: 10px; display: block; opacity: 0.4; }
.history-empty p { font-size: 0.9rem; font-weight: 500; }
.history-empty small { font-size: 0.75rem; opacity: 0.7; }

/* â”€â”€ Skeleton Loader â”€â”€ */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
}
@keyframes skeleton-shimmer { to { background-position-x: -200%; } }
