:root {
    /* Shrine Green & Gold Theme */
    --primary-color: #0d4a30; /* Deep Shrine Green */
    --primary-light: #166b47;
    --primary-dark: #08301f;
    --gold: #d4af37; /* Premium Gold */
    --gold-light: #f3d97f;
    
    /* Transaction Colors */
    --deposit-color: #2ecc71; /* Green for incoming */
    --withdraw-color: #e74c3c; /* Red for outgoing */
    
    /* Backgrounds & Surfaces */
    --bg-color: #f4f7f6;
    --surface-color: #ffffff;
    --surface-dark: #1e1e1e;
    
    /* Text */
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --text-inverse: #ffffff;

    /* Styling */
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(13, 74, 48, 0.15);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile App dimensions for desktop view */
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
    box-shadow: var(--shadow-glass);
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* Typography Utility */
.text-gold { color: var(--gold); }
.text-green { color: var(--deposit-color); }
.text-red { color: var(--withdraw-color); }

/* Buttons */
button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.icon-btn:active { transform: scale(0.95); }

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-inverse);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding-bottom: 60px; /* space for overlapping card */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold-light);
    border: 2px solid var(--gold);
}

.greeting {
    display: flex;
    flex-direction: column;
}

.hello {
    font-size: 0.85rem;
    opacity: 0.8;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.app-header .icon-btn {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Glassmorphism Balance Card */
.balance-section {
    padding: 0 20px;
    margin-top: -45px;
    position: relative;
    z-index: 10;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.balance-amount {
    margin: 15px 0 20px;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.balance-amount .currency {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background-color: rgba(0,0,0,0.03);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.divider {
    width: 1px;
    height: 30px;
    background-color: rgba(0,0,0,0.05);
}

/* Transactions List */
.transactions-section {
    padding: 25px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.text-btn {
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    opacity: 0.7;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #cbd5e1;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-color);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.transaction-item:active {
    transform: scale(0.98);
}

.tr-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tr-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tr-icon.deposit { background-color: rgba(46, 204, 113, 0.1); color: var(--deposit-color); }
.tr-icon.withdraw { background-color: rgba(231, 76, 60, 0.1); color: var(--withdraw-color); }

.tr-details {
    display: flex;
    flex-direction: column;
}

.tr-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.tr-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tr-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tr-amount {
    font-weight: 800;
    font-size: 1.1rem;
}

.tr-amount.deposit { color: var(--deposit-color); }
.tr-amount.withdraw { color: var(--text-main); } /* Keeping out neutral or red depending on preference */

.tr-sync-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 30px;
    right: 50%;
    transform: translateX(50%); /* Centered for now, or move to right */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #b8962e);
    color: white;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (min-width: 480px) {
    .fab {
        right: calc(50% - 240px + 30px);
        transform: none;
    }
}

.fab:active {
    transform: translateX(50%) scale(0.9);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}
@media (min-width: 480px) {
    .fab:active {
        transform: scale(0.9);
    }
}

/* Modal Bottom Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--surface-color);
    width: 100%;
    max-width: 480px;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Form Styles */
.type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.type-selector input[type="radio"] {
    display: none;
}

.type-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#typeIn:checked + .type-btn {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--deposit-color);
    border-color: var(--deposit-color);
}

#typeOut:checked + .type-btn {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--withdraw-color);
    border-color: var(--withdraw-color);
}

.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.input-group input[type="number"],
.input-group input[type="text"] {
    width: 100%;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #e2e8f0;
    font-size: 1rem;
    font-family: inherit;
    background-color: #f8fafc;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    background-color: var(--surface-color);
}

/* Camera Upload UI */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed #cbd5e1;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    overflow: hidden;
    cursor: pointer;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-light);
    gap: 8px;
}

.upload-ui i {
    font-size: 1.8rem;
}

.file-upload-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.6);
    color: white;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden { display: none !important; }

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    margin-top: 10px;
    box-shadow: var(--shadow-md);
}

.submit-btn:active {
    transform: scale(0.98);
}

/* Toasts */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--surface-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    z-index: 300;
    transition: top 0.3s, opacity 0.3s;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.login-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-box {
    width: 90%;
    max-width: 400px;
    background: var(--surface-color);
    padding: 30px 20px;
    border-radius: 24px;
    box-shadow: var(--shadow-glass);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 800;
    margin: 0 auto 15px;
    box-shadow: var(--shadow-md);
}

.login-logo h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}
