/* --- GLOBAL VARIABLES (Matches Landing Page) --- */
:root {
    --primary-color: #EB6121; /* Fallback Color */
    --primary-hover: #D15319;
    --bg-dark: #121218;
    --bg-card: rgba(28, 28, 40, 0.75);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --border-radius: 16px;
    --whatsapp-color: #25D366;
}

/* --- LIGHT THEME OVERRIDES --- */
[data-theme="light"] {
    --bg-dark: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: rgba(0, 0, 0, 0.1);
    --input-bg: #f1f3f5;
}

/* --- BASE STYLES --- */
* {
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Subtle gradient matching landing page */
    background-image: radial-gradient(circle at 50% 0%, rgba(235, 97, 33, 0.1), transparent 50%); 
}

/* --- THEME TOGGLE FAB --- */
.theme-toggle-fab {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.theme-toggle-fab:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* Hide/Show Icons based on Theme */
[data-theme="dark"] .fa-moon-o { display: none; }
[data-theme="light"] .fa-sun-o { display: none; }

/* --- CARD DESIGN (Glassmorphism) --- */
.card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.card-header h1 {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    margin-top: 0;
}

/* --- FORM FLOATING LABELS --- */
.form-floating {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.form-control {
    width: 100%;
    padding: 16px 15px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    background: rgba(255,255,255,0.08);
}
[data-theme="light"] .form-control:focus {
    background: #fff;
}

/* Floating Label Logic */
.form-floating label {
    position: absolute;
    top: 14px;
    left: 15px;
    font-size: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: 0.2s ease all;
}

/* Move label up when input has value or is focused */
.form-control:focus ~ label,
.form-control:not(:placeholder-shown) ~ label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    background: var(--bg-card); /* Matches card bg to hide line behind label */
    padding: 0 5px;
    color: var(--primary-color);
    border-radius: 4px;
}

/* --- PASSWORD TOGGLE ICON --- */
.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 10;
}
.password-toggle-icon:hover {
    color: var(--primary-color);
}

/* --- BUTTONS & LINKS --- */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(235, 97, 33, 0.3); /* Uses orange shadow by default */
}

.form-options {
    text-align: right;
    margin-bottom: 20px;
}

.form-options a, .card-footer a {
    color: var(--primary-color); /* Updated to use dynamic color */
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.form-options a:hover, .card-footer a:hover {
    text-decoration: underline;
}

.card-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- WHATSAPP FAB --- */
.whatsapp-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background-color: var(--whatsapp-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: white;
    font-size: 30px;
}

.whatsapp-fab.visible {
    transform: scale(1);
    opacity: 1;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
}

/* --- SWEETALERT THEME FIXES --- */
body.swal2-shown > [aria-hidden="true"] {
    transition: 0.1s filter;
    filter: blur(5px);
}

/* Dark Mode SweetAlert Customization */
.swal2-popup.theme-dark {
    background: #1c1c28 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.1);
}
.swal2-title, .swal2-content {
    color: inherit !important;
}

/* --- DASHBOARD SPECIFIC STYLES --- */

/* Header & Greeting */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; animation: fadeInDown 0.5s ease-out; }
.header .greeting-block { display: flex; flex-direction: column; }
.header .greeting { font-size: 16px; font-weight: 400; color: var(--text-secondary); }
.header .user-name { font-size: 26px; font-weight: 600; color: var(--text-primary); }
.header-right { display: flex; align-items: center; gap: 15px; }

.logout-btn { background-color: transparent; color: var(--text-secondary); border: none; padding: 8px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; }
.logout-btn:hover { color: #dc3545; }

/* Dashboard Container Override */
.dashboard-container { max-width: 1200px; margin: 0 auto; padding: 20px 15px; width: 100%; }

/* Summary Grid */
.summary-grid { display: flex; gap: 10px; animation: fadeInUp 0.7s ease-out; margin-bottom: 20px;}
.summary-card { flex-grow: 1; flex-shrink: 0; flex-basis: 0; padding: 15px; text-align: center; border: 1px solid var(--border-color); background: var(--bg-card); border-radius: var(--border-radius); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.summary-card .label { color: var(--text-secondary); margin-bottom: 8px; font-size: 13px; font-weight: 500; text-transform: uppercase; }
.summary-card .value { font-size: 22px; font-weight: 700; color: var(--text-primary); }

/* Section Headers */
.section-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin: 30px 0 20px 0; }
.section-header h2 { font-size: 20px; margin: 0; font-weight: 600; color: var(--text-primary); }
.section-header a { color: var(--primary-color); text-decoration: none; font-weight: 500; font-size: 14px; }

/* Accounts Carousel */
.accounts-carousel { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; scrollbar-width: thin; scrollbar-color: var(--primary-color) var(--bg-dark); }
.accounts-carousel::-webkit-scrollbar { height: 6px; }
.accounts-carousel::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 10px; }
.account-card { background: linear-gradient(45deg, var(--primary-color), var(--primary-hover)); border-radius: var(--border-radius); padding: 20px; min-width: 260px; flex-shrink: 0; display: flex; flex-direction: column; color: white; }
.account-card .bank-name { font-size: 16px; font-weight: 600; margin-bottom: 15px; }
.account-no-container { display: flex; align-items: center; justify-content: space-between; gap: 10px; background-color: rgba(0,0,0,0.2); padding: 10px 15px; border-radius: 8px; }
.account-no-container .account-no { font-size: 20px; letter-spacing: 1px; font-weight: 600; }
.copy-icon { cursor: pointer; color: white; font-size: 18px; transition: transform 0.2s ease; position: relative; }
.copy-icon:hover { transform: scale(1.2); }
.copy-tooltip { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background-color: #25D366; color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px; opacity: 0; transition: opacity 0.3s; pointer-events: none; white-space: nowrap; }
.copy-tooltip.visible { opacity: 1; }

/* Services Grid */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; }
.service-card { padding: 15px; text-align: center; text-decoration: none; color: var(--text-primary); transition: all 0.3s ease; cursor: pointer; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius); }
.service-card:hover { transform: translateY(-5px); border-color: var(--primary-color); }
.service-card .icon-wrapper { width: 60px; height: 60px; margin: 0 auto 15px auto; border-radius: 50%; background: var(--bg-dark); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--primary-color); transition: all 0.3s ease; }
.service-card:hover .icon-wrapper { background-color: var(--primary-color); color: white; }
.service-card .name { font-weight: 500; font-size: 13px; }
.other-service-item { display: none; }

/* Referral Card */
.referral-card { padding: 25px; background: linear-gradient(135deg, var(--primary-color), #483d8b); color: white; border-radius: var(--border-radius); }
.referral-card .benefits-list { list-style: none; padding: 0; margin: 0 0 20px 0; }
.referral-card .benefit-item { display: flex; align-items: flex-start; gap: 15px; font-size: 14px; }
.referral-card .benefit-item:not(:last-child) { margin-bottom: 12px; }
.referral-card .benefit-item .fa { font-size: 16px; color: #25D366; margin-top: 4px; }
.referral-card .btn-share { background-color: rgba(255,255,255,0.9); color: var(--primary-color); font-weight: 600; text-decoration: none; padding: 12px 25px; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px; }
.referral-card .btn-share:hover { background-color: white; transform: translateY(-2px); }

/* Transactions Table */
.transactions-table { width: 100%; border-collapse: collapse; }
.transactions-table th, .transactions-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-primary); }
.transactions-table th { font-weight: 600; color: var(--text-secondary); text-transform: uppercase; font-size: 11px; }
.transactions-table tr:last-child td { border-bottom: none; }
.transactions-table tbody tr { cursor: pointer; transition: background-color 0.2s ease; }
.transactions-table tbody tr:hover { background-color: rgba(255,255,255,0.05); }

/* Status Badges */
.status-badge { padding: 4px 10px; border-radius: 15px; font-size: 12px; font-weight: 500; display: inline-block; }
.status-badge.success { background-color: rgba(37, 211, 102, 0.2); color: #25D366; }
.status-badge.fail, .status-badge.failed { background-color: rgba(220, 53, 69, 0.2); color: #dc3545; }
.status-badge.processing { background-color: rgba(255, 193, 7, 0.2); color: #ffc107; }

/* Skeleton Loader */
.skeleton { animation: shimmer 1.5s infinite; background: linear-gradient(90deg, var(--bg-dark) 25%, var(--border-color) 50%, var(--bg-dark) 75%); background-size: 200% 100%; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Floating Theme Switch Override */
#floating-theme-toggle { position: fixed; top: 50px; right: 20px; z-index: 1001; background: var(--bg-card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border-color); padding: 8px 10px; border-radius: 100px; animation: fadeInDown 0.5s ease-out forwards; }
.theme-switch { display: inline-block; height: 24px; position: relative; width: 44px; }
.theme-switch input { display: none; }
.slider { background-color: #555; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 24px; }
.slider:before { background-color: #fff; bottom: 4px; content: ""; height: 16px; left: 4px; position: absolute; transition: .4s; width: 16px; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

/* Animations */
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- UNIVERSAL THEME TOGGLE BUTTON --- */
.theme-toggle-fab {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 2000; /* Ensure it is on top of everything */
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle-fab:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color); /* Glow effect on hover */
}

/* LOGIC: Show Sun in Dark Mode, Show Moon in Light Mode */
[data-theme="dark"] .theme-toggle-fab .fa-moon-o { display: none; }
[data-theme="dark"] .theme-toggle-fab .fa-sun-o { display: inline-block; color: #FFD700; /* Gold for Sun */ }

[data-theme="light"] .theme-toggle-fab .fa-sun-o { display: none; }
[data-theme="light"] .theme-toggle-fab .fa-moon-o { display: inline-block; color: #555; /* Dark for Moon */ }

/* Remove the old slider styles if present to avoid conflict */
#floating-theme-toggle { display: none !important; }