/* assets/css/style.css - Mobile-First Lightweight, Compact & Modern UI */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-dark: #059669;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --dark: #0f172a;
    --dark-surface: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-700: #334155;
    
    /* Bank Colors */
    --cbe-color: #6A1B9A;
    --cbe-light: #f3e5f5;
    --telebirr-color: #7cb342;
    --telebirr-light: #f1f8e9;
    --cbebirr-color: #8e24aa;
    --cbebirr-light: #f3e5f5;
    --awash-color: #0d47a1;
    --awash-light: #e3f2fd;
    --dashen-color: #003366;
    --dashen-light: #e8f0fe;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 3px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 6px 16px rgba(0,0,0,0.08);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6fb;
    color: #1e293b;
    font-size: 0.84rem;
    line-height: 1.45;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px; /* Compact for mobile bottom navbar */
}

@media (min-width: 992px) {
    body {
        padding-bottom: 16px;
    }
}

/* Typography Scale for Compact View */
h1, .h1 { font-size: 1.4rem; }
h2, .h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.12rem; }
h4, .h4 { font-size: 1.02rem; }
h5, .h5 { font-size: 0.92rem; }
h6, .h6 { font-size: 0.82rem; }

.small, small {
    font-size: 0.74rem;
}

/* Glassmorphism Card Elements */
.glass-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

/* Navbar */
.app-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.brand-badge {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
}

/* Horizontally Scrollable Bank Selector */
.bank-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
    padding: 2px 0 6px;
    margin: 0 -2px;
}

.bank-scroll-container::-webkit-scrollbar {
    height: 3px;
}

.bank-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 4px;
}

.bank-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1px 0 2px;
}

.bank-scroll-container::-webkit-scrollbar {
    display: none;
}

.bank-scroll-track {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
    padding: 1px;
}

.bank-card-option {
    flex: 1 1 0px;
    min-width: 54px;
    max-width: 90px;
    position: relative;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 5px 2px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.bank-card-option:hover {
    border-color: #94a3b8;
}

.bank-card-option.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.25);
}

.bank-card-option .bank-icon-wrap {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 3px;
    font-size: 0.8rem;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.bank-card-option .bank-title {
    font-size: 0.67rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.bank-card-option.bank-cbe .bank-icon-wrap { background: linear-gradient(135deg, #6A1B9A, #8E24AA); }
.bank-card-option.bank-telebirr .bank-icon-wrap { background: linear-gradient(135deg, #7CB342, #8DC63F); }
.bank-card-option.bank-cbebirr .bank-icon-wrap { background: linear-gradient(135deg, #8E24AA, #AB47BC); }
.bank-card-option.bank-awash .bank-icon-wrap { background: linear-gradient(135deg, #0D47A1, #1976D2); }
.bank-card-option.bank-dashen .bank-icon-wrap { background: linear-gradient(135deg, #003366, #0A4F8C); }

/* QR Scanner Box - Compact & Hardware Optimized */
.scanner-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    aspect-ratio: 1/1;
    max-width: 280px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

#qr-video-reader {
    width: 100% !important;
    height: 100% !important;
}

#qr-video-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Scanner Viewfinder Overlay */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-frame {
    width: 180px;
    height: 180px;
    position: relative;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

/* Corner highlights */
.scanner-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: #10b981;
    border-style: solid;
}
.scanner-corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-top-left-radius: 10px; }
.scanner-corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-top-right-radius: 10px; }
.scanner-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; border-bottom-left-radius: 10px; }
.scanner-corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-bottom-right-radius: 10px; }

/* Laser Line - Only animated when scanner is active */
.scanner-laser {
    display: none;
    position: absolute;
    left: 4px;
    right: 4px;
    height: 2.5px;
    background: linear-gradient(90deg, rgba(16,185,129,0) 0%, rgba(16,185,129,1) 50%, rgba(16,185,129,0) 100%);
    box-shadow: 0 0 8px #10b981;
}

.scanner-container.is-active .scanner-laser {
    display: block;
    animation: scanAnim 2s infinite ease-in-out;
    will-change: top, opacity;
}

@keyframes scanAnim {
    0% { top: 8px; opacity: 0.8; }
    50% { top: calc(100% - 10px); opacity: 1; }
    100% { top: 8px; opacity: 0.8; }
}

/* Mode Switch Tabs - Compact */
.nav-pills-custom .nav-link {
    color: #64748b;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    transition: all 0.15s ease;
}

.nav-pills-custom .nav-link.active {
    background-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Buttons - Reduced Sizes */
.btn {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.btn-sm {
    font-size: 0.76rem;
    padding: 4px 10px;
}

.btn-lg {
    font-size: 0.88rem;
    padding: 8px 16px;
}

/* Form Controls */
.form-control, .form-select, .input-group-text {
    font-size: 0.82rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.form-label {
    font-size: 0.76rem;
    margin-bottom: 3px;
}

.form-text {
    font-size: 0.7rem;
}

/* Digital Receipt Card - Compact */
.receipt-wrapper {
    max-width: 420px;
    margin: 0 auto;
    position: relative;
}

.receipt-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: relative;
}

.receipt-header-banner {
    padding: 16px 14px 12px;
    text-align: center;
    color: #ffffff;
    position: relative;
}

.receipt-header-banner.theme-cbe { background: linear-gradient(135deg, #6A1B9A 0%, #4A148C 100%); }
.receipt-header-banner.theme-telebirr { background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%); }
.receipt-header-banner.theme-cbebirr { background: linear-gradient(135deg, #8E24AA 0%, #6A1B9A 100%); }
.receipt-header-banner.theme-awash { background: linear-gradient(135deg, #0D47A1 0%, #01579B 100%); }
.receipt-header-banner.theme-dashen { background: linear-gradient(135deg, #003366 0%, #002244 100%); }
.receipt-header-banner.theme-failed { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); }
.receipt-header-banner.theme-duplicate { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }

.receipt-status-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 6px;
    backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.receipt-status-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.receipt-body {
    padding: 16px 14px;
}

.receipt-amount-box {
    text-align: center;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 14px;
    border: 1px dashed #cbd5e1;
}

.receipt-amount-val {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.receipt-amount-currency {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 3px;
}

/* Receipt Details List */
.receipt-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.78rem;
}

.receipt-detail-item:last-child {
    border-bottom: none;
}

.receipt-label {
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.receipt-value {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* Duplicate alert badge */
.duplicate-alert {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: #92400e;
    font-size: 0.75rem;
    margin-bottom: 12px;
}

/* Bottom Mobile Navbar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 5px 0 6px;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.nav-item-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.67rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.nav-item-btn i {
    font-size: 1.05rem;
    margin-bottom: 1px;
}

.nav-item-btn.active, .nav-item-btn:hover {
    color: #2563eb;
}

/* Print Styling */
@media print {
    body {
        background: #fff !important;
        padding: 0 !important;
    }
    .app-header, .mobile-bottom-nav, .no-print, .btn, .card-header {
        display: none !important;
    }
    .receipt-wrapper {
        max-width: 100% !important;
        box-shadow: none !important;
    }
    .receipt-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Bank Badges with subtle brand color tints */
.badge-cbe { background: #f3e5f5 !important; color: #6a1b9a !important; border: 1px solid #e1bee7 !important; }
.badge-telebirr { background: #f1f8e9 !important; color: #558b2f !important; border: 1px solid #dcedc8 !important; }
.badge-cbebirr { background: #f3e5f5 !important; color: #8e24aa !important; border: 1px solid #e1bee7 !important; }
.badge-awash { background: #e3f2fd !important; color: #0d47a1 !important; border: 1px solid #bbdefb !important; }
.badge-dashen { background: #e8f0fe !important; color: #003366 !important; border: 1px solid #c2d7fa !important; }

/* History Mobile Cards with Proper Padding and Separation */
.history-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 6px;
    background: #f8fafc;
}

.history-card-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 9px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.history-card-item:hover, .history-card-item:active {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.history-card-item .bank-badge {
    font-size: 0.65rem !important;
    padding: 2px 7px !important;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

.history-card-item .ref-text {
    font-size: 0.72rem !important;
    color: #334155;
    font-weight: 600;
}

.history-card-item .amount-text {
    font-size: 0.88rem !important;
    font-weight: 800;
    color: #0f172a;
}

.history-card-item .meta-text {
    font-size: 0.67rem !important;
    color: #64748b;
    line-height: 1.2;
}

.history-card-item .status-badge {
    font-size: 0.62rem !important;
    padding: 2px 6px !important;
    font-weight: 700;
    border-radius: 4px;
}

.history-card-item .btn-view-receipt {
    font-size: 0.68rem !important;
    padding: 2px 8px !important;
    border-radius: 6px;
    line-height: 1.3;
}

/* Lightweight Native Animations (Replaces external Animate.css for instant loading) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 16px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate__animated {
    animation-duration: 0.35s;
    animation-fill-mode: both;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
