/* Universal Font Import */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;700&display=swap');

/* --- THEME COLOR VARIABLES --- */
:root {
    --primary-text: #333;
    --secondary-text: #666;
    --bg-main: #e9ebee;
    --bg-frame: #f4f6f9;
    --bg-card: #ffffff;
    --border-color: #ddd;
    --accent-color-1: #FF416C;
    --accent-color-2: #8E2DE2;
    --success-color: #2ecc71;
    --danger-color: #FF416C;
}

body.dark-mode {
    --primary-text: #e0e0e0;
    --secondary-text: #aaa;
    --bg-main: #121212;
    --bg-frame: #1e1e1e;
    --bg-card: #2a2a2a;
    --border-color: #444;
}

/* --- GENERAL & LAYOUT STYLES --- */
body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background-color: var(--bg-main);
    color: var(--primary-text);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.mobile-frame {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background-color: var(--bg-frame);
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: linear-gradient(to right, #FF4B2B, var(--accent-color-1));
    height: 35px;
    flex-shrink: 0;
}

/* Fixed Headers */
.dashboard-header, .page-header {
    flex-shrink: 0;
    padding: 15px 15px 0 15px;
    position: relative;
    z-index: 10;
    background-color: var(--bg-frame);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Scrollable Content Area */
.dashboard-main, .page-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Fixed Bottom Navigation */
.bottom-nav {
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    z-index: 1000;
}

/* --- REUSABLE COMPONENTS --- */
.greeting p { margin: 0; color: var(--secondary-text); font-size: 16px; }
.greeting h3 { margin: 0; color: var(--primary-text); font-size: 20px; }

.header-icons { display: flex; align-items: center; gap: 15px; }
.user-avatar {
    width: 50px; height: 50px; border-radius: 50%; background: var(--accent-color-1);
    display: flex; justify-content: center; align-items: center;
    font-size: 24px; font-weight: bold; color: white; overflow: hidden;
}
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.page-header { justify-content: flex-start; }
.back-btn { font-size: 20px; color: var(--primary-text); text-decoration: none; }
.page-header h3 { flex-grow: 1; margin: 0; text-align: center; padding-right: 20px; }

.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #999; flex: 1; }
.nav-item.active { color: var(--accent-color-1); }
.nav-item i { font-size: 22px; margin-bottom: 5px; }
.nav-item span { font-size: 12px; font-weight: 500; }

.form-container, .recharge-container, .cashout-container { background: var(--bg-card); padding: 20px; border-radius: 20px; margin-bottom: 20px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--secondary-text); }
.input-group input, .input-group select, .input-group textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border-color);
    border-radius: 8px; box-sizing: border-box; font-size: 16px;
    background-color: var(--bg-frame); color: var(--primary-text); font-family: inherit;
}
.btn {
    width: 100%; padding: 14px; border: none; border-radius: 8px;
    background: linear-gradient(90deg, var(--accent-color-2), #4A00E0); color: white;
    font-size: 16px; font-weight: bold; cursor: pointer;
    transition: transform 0.2s; box-shadow: 0 4px 10px rgba(74, 0, 224, 0.3);
}
.btn:hover { transform: translateY(-2px); }

.message-box { padding: 15px; margin-bottom: 20px; border-radius: 8px; text-align: center; font-weight: 500; }
.message-box.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message-box.error, .error-message { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- PAGE-SPECIFIC STYLES --- */

/* Login & Register */
.auth-container {
    padding: 30px 20px; background: var(--bg-card); border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); width: 100%; max-width: 360px; margin: auto;
    box-sizing: border-box; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.auth-container h2 { text-align: center; color: var(--primary-text); margin-bottom: 30px; font-size: 24px; }
.message { text-align: center; margin-top: 20px; font-size: 14px; color: var(--secondary-text); }
.message a { color: var(--accent-color-2); text-decoration: none; font-weight: bold; }

/* Dashboard */
.balance-card {
    background: linear-gradient(90deg, var(--accent-color-2), #4A00E0); color: white;
    padding: 25px; border-radius: 20px; display: flex;
    justify-content: space-between; align-items: center; margin-bottom: 25px;
}
.balance-info p { margin: 0; font-size: 16px; opacity: 0.9; }
.balance-info h2 { margin: 5px 0 0; font-size: 32px; }
.refresh-icon i { font-size: 20px; cursor: pointer; opacity: 0.8; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 15px; margin-bottom: 30px; }
.action-item { text-align: center; text-decoration: none; color: var(--primary-text); }
.action-item .icon-bg {
    width: 60px; height: 60px; background-color: var(--bg-card); border-radius: 15px;
    margin: 0 auto 8px; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.action-item .icon-bg i { font-size: 24px; color: var(--accent-color-2); }
.action-item span { font-size: 14px; font-weight: 500; display: block; color: var(--secondary-text); }

/* Transactions & History */
.transactions-section { margin-bottom: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-header h4 { margin: 0; font-size: 18px; color: var(--primary-text); }
.section-header a { text-decoration: none; color: var(--accent-color-1); font-weight: bold; font-size: 14px; }
.transaction-item {
    background: var(--bg-card); padding: 15px; border-radius: 15px;
    display: flex; align-items: center; margin-bottom: 10px;
}
.transaction-icon {
    width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center;
    align-items: center; font-size: 18px; margin-right: 15px;
}
.transaction-icon.icon-out { background: rgba(255, 65, 108, 0.1); color: var(--danger-color); }
.transaction-icon.icon-in { background: rgba(46, 204, 113, 0.1); color: var(--success-color); }
.transaction-details { flex-grow: 1; }
.transaction-details p { margin: 0; font-weight: bold; }
.transaction-details span { font-size: 12px; color: var(--secondary-text); }
.transaction-amount p { margin: 0; font-weight: bold; }
.transaction-amount .amount-out { color: var(--danger-color); }
.transaction-amount .amount-in { color: var(--success-color); }
.filter-container { background: var(--bg-card); padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.filter-form { display: grid; grid-template-columns: 1fr; gap: 15px; }
.filter-buttons { display: flex; gap: 10px; }
.btn-filter, .btn-clear { flex: 1; padding: 12px; border-radius: 8px; text-align: center; font-weight: bold; cursor: pointer; text-decoration: none; }
.btn-filter { background-color: var(--primary-color, #2c3e50); color: white; border: none; }
.btn-clear { background-color: var(--light-gray, #ecf0f1); color: var(--text-color, #333); border: 1px solid var(--border-color); }
.no-results { text-align: center; padding: 30px; color: var(--secondary-text); }
@media (min-width: 400px) {
    .filter-form { grid-template-columns: 1fr 1fr; }
    .filter-form .form-group:first-child { grid-column: 1 / -1; }
}

/* Profile Page */
.profile-info-card { background: var(--bg-card); border-radius: 12px; padding: 20px; text-align: center; margin-bottom: 20px; }
.user-avatar-large {
    width: 80px; height: 80px; border-radius: 50%; background: var(--accent-color-1);
    display: flex; justify-content: center; align-items: center; font-size: 40px;
    font-weight: bold; color: white; margin: 0 auto 15px;
}
.user-avatar-large-img {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 15px;
    border: 3px solid var(--bg-card); box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.profile-info-card h3 { margin: 0 0 5px 0; }
.profile-info-card p { margin: 0; color: var(--secondary-text); }
.upload-form { margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.upload-form input[type="file"] { font-size: 12px; width: 150px; }
.upload-form button { padding: 5px 10px; font-size: 12px; border: none; background: #eee; border-radius: 5px; cursor: pointer; }

/* Dark Mode Toggle */
.dark-mode-toggle-container {
    background: var(--bg-card); padding: 15px; display: flex; justify-content: space-between;
    align-items: center; border-radius: 12px; margin-bottom: 20px;
}
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--accent-color-2); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Add Money, Cash Out, Payment Pages */
.instruction-box { background-color: #fff3cd; color: #856404; padding: 15px; border-radius: 12px; margin-bottom: 20px; border: 1px solid #ffeeba; }
.payment-numbers-box { background: var(--bg-card); padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.number-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--border-color); }
.method-selector { display: flex; gap: 10px; margin-bottom: 20px; }
.method-btn { flex: 1; padding: 10px; font-size: 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border-color); background-color: var(--bg-frame); color: var(--primary-text); font-weight: 500; }
.method-btn.active { background-color: var(--accent-color-2); color: white; border-color: var(--accent-color-2); }
.qr-section { background: var(--bg-card); border-radius: 12px; padding: 20px; text-align: center; color: var(--secondary-text); border: 1px dashed var(--border-color); margin-bottom: 20px; cursor: pointer; }
.qr-section i { font-size: 40px; margin-bottom: 10px; color: var(--accent-color-2); }
.separator { text-align: center; color: #888; margin-bottom: 20px; }

/* Savings & Loan Pages */
.savings-plan-card {
    background: var(--bg-card); border-radius: 12px; margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07); overflow: hidden;
}
.plan-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: var(--bg-frame); }
.plan-header h4 { margin: 0; }
.status-badge { padding: 5px 10px; border-radius: 15px; color: #fff; font-size: 12px; text-transform: capitalize;}
.status-active { background-color: var(--success-color); }
.status-completed, .status-paid { background-color: var(--accent-color); }
.status-closed, .status-rejected { background-color: var(--danger-color); }
.status-pending, .status-answered { background-color: var(--warning-color); }
.status-open { background-color: #3498db; }
.plan-body { padding: 15px; }
.plan-body p { margin: 0 0 10px 0; }
.progress-bar { width: 100%; height: 8px; background-color: var(--bg-frame); border-radius: 4px; overflow: hidden; }
.progress { height: 100%; background-color: var(--accent-color-2); border-radius: 4px; }
.plan-footer { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: var(--bg-frame); border-top: 1px solid var(--border-color); }
.plan-footer span { font-weight: bold; }
.btn-small { background: var(--accent-color-2); color: white; padding: 8px 15px; text-decoration: none; border-radius: 5px; font-size: 14px; }
.btn-small.disabled { background-color: #ccc; cursor: not-allowed; }

/* Notification & Support Ticket Pages */
.notification-bell { position: relative; font-size: 24px; color: var(--secondary-text); text-decoration: none; }
.unread-count {
    position: absolute; top: -5px; right: -8px; background-color: var(--danger-color); color: white;
    font-size: 10px; font-weight: bold; border-radius: 50%; width: 16px; height: 16px;
    display: flex; justify-content: center; align-items: center;
}
.notification-list, .ticket-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.notification-item, .ticket-item {
    display: flex; align-items: center; background: var(--bg-card); padding: 15px;
    border-radius: 12px; text-decoration: none; color: inherit; transition: background-color 0.2s;
}
.notification-item:hover, .ticket-item:hover { background-color: var(--bg-frame); }
.notification-icon { font-size: 20px; color: var(--accent-color-2); margin-right: 15px; }
.ticket-item { justify-content: space-between; }
.ticket-info p { margin: 0; font-weight: bold; }
.ticket-info small { color: var(--secondary-text); }
.ticket-conversation { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.reply-item { padding: 15px; border-radius: 12px; border: 1px solid var(--border-color); }
.reply-header { font-size: 12px; color: var(--secondary-text); margin-bottom: 5px; }
.reply-header strong { font-size: 14px; color: var(--primary-text); }
.reply-item p { margin: 0; }
.user-reply { background-color: #e9f5ff; }
.admin-reply { background-color: var(--bg-frame); }
body.dark-mode .user-reply { background-color: #2c3e50; }
body.dark-mode .admin-reply { background-color: #34495e; }

/* PIN Modal */
.pin-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: none; justify-content: center; align-items: center; z-index: 2000; }
.pin-modal-content { background: var(--bg-card); padding: 25px; border-radius: 16px; text-align: center; width: 90%; max-width: 320px; }
.pin-modal-content h4 { margin-top: 0; font-size: 18px; }
.pin-modal-content p { color: var(--secondary-text); margin-bottom: 20px; }
.pin-inputs { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; }
.pin-box {
    width: 45px; height: 45px; text-align: center; font-size: 20px; border: 1px solid var(--border-color);
    border-radius: 8px; -webkit-text-security: disc; background-color: var(--bg-frame); color: var(--primary-text);
}