/* =======================================================
   Shamalfarm - Main Stylesheet
   Dark-green luxury agricultural investment platform
   RTL | Mobile-first | Arabic typography
   ======================================================= */

/* ===== CSS Custom Properties ===== */
:root {
    /* Colors */
    --bg-primary:    #070f0b;
    --bg-secondary:  #0d1f16;
    --bg-card:       #0f2318;
    --bg-card-hover: #152d1f;
    --bg-glass:      rgba(15, 35, 24, 0.7);

    --green-900:  #052e12;
    --green-800:  #0a4520;
    --green-700:  #155e35;
    --green-600:  #1e8049;
    --green-500:  #28a35d;
    --green-400:  #34c973;
    --green-300:  #52d98a;
    --green-200:  #86e8a9;
    --green-100:  #c3f4d4;

    --gold-400:  #d4a844;
    --gold-300:  #e8c063;

    --text-primary:   #e8f5ec;
    --text-secondary: #9ab8a4;
    --text-muted:     #557063;

    --danger:   #e05252;
    --warning:  #e89d44;
    --info:     #4499e8;
    --success:  var(--green-400);

    --border:       rgba(52, 201, 115, 0.15);
    --border-light: rgba(52, 201, 115, 0.08);

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;

    /* Radii */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 24px rgba(52, 201, 115, 0.18);

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;

    /* Nav heights */
    --top-nav-h:    60px;
    --bottom-nav-h: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--top-nav-h);
    padding-bottom: calc(var(--bottom-nav-h) + 8px);
    overflow-x: hidden;
}

body.no-bottom-nav {
    padding-bottom: var(--space-xl);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--green-700); border-radius: var(--radius-full); }

/* ===== Top Navigation ===== */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--top-nav-h);
    background: rgba(7, 15, 11, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 900;
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--green-400);
}
.logo-icon { font-size: 1.5rem; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 1.35rem;
    transition: background var(--transition), color var(--transition);
}
.nav-icon-btn:hover,
.nav-icon-btn.active { color: var(--green-400); background: var(--border-light); }

.notif-badge {
    position: absolute;
    top: 4px; left: 4px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: rgba(7, 15, 11, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 900;
    padding: 0 var(--space-sm);
}

.bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    transition: color var(--transition), transform var(--transition);
    min-width: 52px;
    border-radius: var(--radius-md);
}
.bottom-nav-item i { font-size: 1.4rem; }
.bottom-nav-item:hover { color: var(--green-300); transform: translateY(-2px); }
.bottom-nav-item.active { color: var(--green-400); }
.bottom-nav-item.active i {
    background: var(--green-900);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
}

.notif-badge-bottom {
    position: absolute;
    top: 4px; right: 8px;
    min-width: 14px; height: 14px;
    padding: 0 3px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
}

/* ===== Main Content ===== */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-glow); }

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* ===== Section Heading ===== */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.section-title .title-icon {
    width: 32px; height: 32px;
    background: var(--green-900);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--green-400);
    flex-shrink: 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
    white-space: nowrap;
}
.btn-block { width: 100%; display: flex; }

.btn-primary {
    background: linear-gradient(135deg, var(--green-500), var(--green-400));
    color: #fff;
    box-shadow: 0 4px 16px rgba(52, 201, 115, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--green-400), var(--green-300));
    box-shadow: 0 6px 24px rgba(52, 201, 115, 0.45);
    transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--green-500);
    color: var(--green-400);
}
.btn-outline:hover { background: var(--green-900); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-secondary {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--green-700); }

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 4px;
    border: none;
    font-family: 'Cairo', sans-serif;
}
.btn-sm.btn-primary { background: linear-gradient(135deg, var(--green-500), var(--green-400)); color: #fff; }
.btn-sm.btn-outline { background: transparent; border: 1.5px solid var(--green-500); color: var(--green-400); }

/* ===== Forms ===== */
.form-group { margin-bottom: var(--space-md); }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-control {
    width: 100%;
    padding: 12px var(--space-md);
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(52, 201, 115, 0.12);
}
.form-control::placeholder { color: var(--text-muted); }

.form-control-lg { padding: 14px var(--space-md); font-size: 1.1rem; }

select.form-control option { background: var(--bg-secondary); }

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.82rem;
    color: var(--danger);
    margin-top: 4px;
}

/* ===== Alert / Flash Messages ===== */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border: 1px solid transparent;
}
.alert-success { background: rgba(52,201,115,0.12); border-color: rgba(52,201,115,0.3); color: var(--green-300); }
.alert-danger  { background: rgba(224,82,82,0.12);  border-color: rgba(224,82,82,0.3);  color: #f07070; }
.alert-warning { background: rgba(232,157,68,0.12); border-color: rgba(232,157,68,0.3); color: var(--warning); }
.alert-info    { background: rgba(68,153,232,0.12); border-color: rgba(68,153,232,0.3); color: var(--info); }

/* ===== Stat Cards ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
@media (min-width: 600px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }

.stat-icon {
    width: 44px; height: 44px;
    background: var(--green-900);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto var(--space-sm);
    color: var(--green-400);
}
.stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--green-400);
    margin-bottom: 2px;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== Product Cards ===== */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}
@media (min-width: 480px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }

.product-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--green-900);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: block;
    transition: transform 0.4s ease;
}
.product-card:hover .product-img { transform: scale(1.04); }
.product-img-wrap { overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.product-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--green-900), var(--green-800));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.product-body { padding: var(--space-md); flex: 1; display: flex; flex-direction: column; gap: var(--space-sm); }
.product-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.product-category {
    font-size: 0.75rem;
    background: var(--green-900);
    color: var(--green-400);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    font-weight: 600;
}
.product-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.product-profit {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--green-400);
}
.product-profit small { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

/* ===== Category Filter Tabs ===== */
.category-tabs {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-lg);
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    display: flex; align-items: center; gap: 4px;
}
.category-tab:hover { border-color: var(--green-500); color: var(--green-400); }
.category-tab.active { background: var(--green-800); border-color: var(--green-500); color: var(--green-300); }

/* ===== Badge ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-success  { background: rgba(52,201,115,0.15); color: var(--green-300); }
.badge-warning  { background: rgba(232,157,68,0.15); color: var(--warning); }
.badge-danger   { background: rgba(224,82,82,0.15);  color: var(--danger); }
.badge-info     { background: rgba(68,153,232,0.15); color: var(--info); }
.badge-secondary{ background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th, .table td {
    padding: var(--space-sm) var(--space-md);
    text-align: right;
    border-bottom: 1px solid var(--border-light);
}
.table th { color: var(--text-muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}
.page-btn {
    min-width: 38px; height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Cairo', sans-serif;
}
.page-btn:hover { border-color: var(--green-500); color: var(--green-400); }
.page-btn.active { background: var(--green-800); border-color: var(--green-500); color: var(--green-300); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Wallet Balances ===== */
.wallet-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
@media (min-width: 520px) { .wallet-grid { grid-template-columns: repeat(2, 1fr); } }

.wallet-card {
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}
.wallet-main {
    background: linear-gradient(135deg, var(--green-800), var(--green-700));
    border: 1px solid var(--green-600);
}
.wallet-profit {
    background: linear-gradient(135deg, #1a2e0f, #2a4810);
    border: 1px solid rgba(212, 168, 68, 0.25);
}
.wallet-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.wallet-card-label { font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.6); margin-bottom: var(--space-sm); }
.wallet-card-amount { font-size: 1.6rem; font-weight: 900; color: #fff; }
.wallet-card-sub { font-size: 0.78rem; color: rgba(255,255,255,0.5); margin-top: 4px; }
.wallet-card-icon { font-size: 2rem; opacity: 0.2; position: absolute; left: var(--space-md); bottom: var(--space-md); }

/* ===== Notification Items ===== */
.notif-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: background var(--transition);
    cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(52,201,115,0.04); border-color: var(--border); }
.notif-item + .notif-item { margin-top: var(--space-sm); }
.notif-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--green-900);
    color: var(--green-400);
}
.notif-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.notif-body  { font-size: 0.82rem; color: var(--text-secondary); }
.notif-time  { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ===== Referral ===== */
.referral-link-box {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
}
.referral-link-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--green-400);
    font-family: monospace;
    font-size: 0.85rem;
    outline: none;
    text-align: right;
    direction: ltr;
}
.copy-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--green-800);
    color: var(--green-300);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    font-family: 'Cairo', sans-serif;
}
.copy-btn:hover { background: var(--green-700); }

/* ===== Page Header ===== */
.page-header {
    margin-bottom: var(--space-lg);
}
.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); }

/* ===== Loading Spinner ===== */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--green-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--space-xl) auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast Notification ===== */
#toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px);
    right: var(--space-md);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
    max-width: 280px;
    display: flex; align-items: center; gap: var(--space-sm);
}
.toast.success { border-color: rgba(52,201,115,0.4); color: var(--green-300); }
.toast.error   { border-color: rgba(224,82,82,0.4);  color: #f07070; }

@keyframes slideIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut  { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

/* ===== Fade In Animation ===== */
.fade-in { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }

/* ===== Divider ===== */
.divider { border: none; border-top: 1px solid var(--border-light); margin: var(--space-lg) 0; }

/* ===== Utility ===== */
.text-center    { text-align: center; }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }
.text-gold      { color: var(--gold-400); }
.text-green     { color: var(--green-400); }
.text-sm        { font-size: 0.85rem; }
.text-xs        { font-size: 0.75rem; }
.font-bold      { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex   { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ===== Checkout / Investment Form ===== */
.profit-preview {
    background: var(--green-900);
    border: 1px solid rgba(52,201,115,0.25);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
}
.profit-preview-title { font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--space-sm); }
.profit-preview-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.profit-preview-row:last-child { margin-bottom: 0; border-top: 1px solid var(--border-light); padding-top: 6px; margin-top: 4px; font-weight: 700; }
.profit-preview-label { font-size: 0.85rem; color: var(--text-secondary); }
.profit-preview-value { font-size: 0.9rem; font-weight: 700; color: var(--green-400); }

/* ===== Insurance Toggle ===== */
.insurance-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: rgba(212, 168, 68, 0.06);
    border: 1px solid rgba(212, 168, 68, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.insurance-label { font-size: 0.9rem; font-weight: 700; color: var(--gold-400); }
.insurance-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 46px; height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    top: 2px; right: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: rgba(212, 168, 68, 0.2); border-color: var(--gold-400); }
.toggle-switch input:checked + .toggle-slider::before { background: var(--gold-400); transform: translateX(-22px); }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-md); opacity: 0.5; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.empty-state p { font-size: 0.875rem; }

/* ===== Report Tabs ===== */
.report-tabs {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
    margin-bottom: var(--space-lg);
}
.report-tab {
    flex: 1;
    text-align: center;
    padding: 9px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    font-family: 'Cairo', sans-serif;
}
.report-tab.active { background: var(--green-800); color: var(--green-300); }

/* ===== Investment History ===== */
.investment-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-sm);
    transition: background var(--transition);
}
.investment-item:hover { background: rgba(255,255,255,0.02); }
.investment-item-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: var(--green-900);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.investment-item-info { flex: 1; }
.investment-item-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.investment-item-meta { font-size: 0.78rem; color: var(--text-muted); }
.investment-item-amount { text-align: left; }
.investment-item-amount .amount { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.investment-item-amount .daily  { font-size: 0.75rem; color: var(--green-400); font-weight: 600; }

/* ===== Modal Overlay ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-sheet {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-lg);
    transform: translateY(100%);
    transition: transform 0.35s ease;
}
.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}
.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}
.modal-close {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.modal-close:hover { background: rgba(224,82,82,0.15); color: var(--danger); }

/* ===== Amount Input (Large Currency) ===== */
.amount-input-wrap {
    position: relative;
    margin-bottom: var(--space-md);
}
.amount-input {
    width: 100%;
    padding: 18px var(--space-md);
    padding-left: 60px;
    background: rgba(255,255,255,0.04);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--green-400);
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.amount-input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(52, 201, 115, 0.12);
}
.amount-input::placeholder { color: var(--text-muted); font-weight: 600; font-size: 1.1rem; }
.amount-currency {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* ===== Detail Rows (Product Info / Checkout) ===== */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.detail-value.highlight { color: var(--green-400); font-size: 1rem; }

/* ===== Product Detail Header ===== */
.product-hero {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--green-900), var(--green-800));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    overflow: hidden;
    position: relative;
}
.product-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7,15,11,0.8), transparent);
}

/* ===== Deposit Info Card ===== */
.deposit-info {
    background: rgba(52,201,115,0.06);
    border: 1px solid rgba(52,201,115,0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}
.deposit-info-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green-400);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}
.deposit-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
}
.deposit-info-row .label { color: var(--text-muted); }
.deposit-info-row .value { color: var(--text-primary); font-weight: 700; direction: ltr; }

/* ===== Withdrawal Info ===== */
.withdraw-rules {
    background: rgba(232,157,68,0.06);
    border: 1px solid rgba(232,157,68,0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}
.withdraw-rules-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}
.withdraw-rules li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
    padding-right: 16px;
    position: relative;
}
.withdraw-rules li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--warning);
}

/* ===== Referral Stats ===== */
.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.referral-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}
.referral-stat-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--green-400);
    margin-bottom: 2px;
}
.referral-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== Referred User List ===== */
.referred-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-sm);
}
.referred-user-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    background: var(--green-900);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--green-400);
    flex-shrink: 0;
}
.referred-user-info { flex: 1; }
.referred-user-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.referred-user-date { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Quick Action Buttons Row ===== */
.action-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.action-row .btn { flex: 1; }

/* ===== Responsive ===== */
@media (min-width: 768px) {
    .main-content { padding: var(--space-xl) var(--space-xl); }
    .page-title { font-size: 1.7rem; }
}

/* =======================================================
   Auth Pages (login / register / forgot password)
   ======================================================= */
body.auth-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(52,201,115,0.10), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(212,168,68,0.07), transparent 40%),
        var(--bg-primary);
}
.auth-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}
.auth-brand {
    text-align: center;
    margin-bottom: var(--space-lg);
}
.auth-brand .auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--green-400);
}
.auth-brand .auth-logo i { font-size: 2.1rem; }
.auth-brand p { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: -60px; left: -60px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(52,201,115,0.08);
}

.auth-tabs {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 11px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition);
}
.auth-tab.active { background: var(--green-800); color: var(--green-200); box-shadow: var(--shadow-sm); }

.input-icon-wrap { position: relative; }
.input-icon-wrap > i {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-muted);
    pointer-events: none;
}
.input-icon-wrap .form-control { padding-right: 44px; }
.input-icon-wrap .toggle-pass {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    pointer-events: auto;
    background: none; border: none;
}
.input-icon-wrap .toggle-pass:hover { color: var(--green-400); }

.auth-support {
    margin-top: var(--space-xl);
    text-align: center;
}
.auth-support p { font-size: 0.78rem; color: var(--text-muted); margin-bottom: var(--space-md); }
.auth-support-row { display: flex; align-items: center; justify-content: space-around; }
.auth-support-row a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-secondary); transition: color var(--transition); }
.auth-support-row a:hover { color: var(--green-300); }
.auth-support-row .icon-circle {
    width: 46px; height: 46px;
    border-radius: var(--radius-full);
    background: var(--green-900);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: var(--green-400);
    transition: background var(--transition);
}
.auth-support-row a:hover .icon-circle { background: var(--green-800); }
.auth-support-row span { font-size: 0.72rem; }

/* =======================================================
   Home (index) specific
   ======================================================= */
.hero {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    padding: var(--space-xl) var(--space-lg);
    margin-bottom: var(--space-lg);
    background:
        linear-gradient(135deg, rgba(5,46,18,0.92), rgba(10,69,32,0.75)),
        url('https://images.unsplash.com/photo-1500937386664-56d1dfef3854?auto=format&fit=crop&w=1200&q=80') center/cover;
    box-shadow: var(--shadow-md);
}
.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold-300);
    background: rgba(212,168,68,0.12);
    border: 1px solid rgba(212,168,68,0.3);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-sm);
}
.hero h2 { font-size: 1.6rem; font-weight: 900; color: #fff; line-height: 1.3; margin-bottom: 6px; }
.hero p { font-size: 0.9rem; color: rgba(232,245,236,0.85); max-width: 90%; }

/* ===== Home Banner Panorama ===== */
.home-banner {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-glow);
}
.home-banner-img {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
}
.home-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(7,15,11,0.15) 0%,
        rgba(7,15,11,0.55) 100%
    );
    z-index: 1;
}
.home-banner-text {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    z-index: 2;
    text-align: right;
}
.home-banner-text h2 {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 2px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.home-banner-text p {
    font-size: 0.78rem;
    color: rgba(232,245,236,0.85);
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.home-banner-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 2;
    background: rgba(52,201,115,0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.balance-card {
    background: linear-gradient(135deg, var(--green-800), var(--bg-card));
    border: 1px solid var(--green-600);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}
.balance-card::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -30px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(212,168,68,0.08);
}
.balance-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.balance-head .label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: rgba(255,255,255,0.7); }
.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-md); }
.balance-grid .label { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.balance-grid .value { font-size: 1.35rem; font-weight: 900; color: #fff; }
.balance-grid .value.gold { color: var(--gold-300); }
.balance-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-md); position: relative; z-index: 1; }
.balance-actions .btn { flex: 1; }

.invest-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition);
}
.invest-link:hover { background: var(--bg-card-hover); transform: translateX(-3px); box-shadow: var(--shadow-glow); }
.invest-link .left { display: flex; align-items: center; gap: var(--space-md); }
.invest-link .ic {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: var(--green-900);
    color: var(--green-400);
    flex-shrink: 0;
}
.invest-link .ic.gold { background: rgba(212,168,68,0.12); color: var(--gold-400); }
.invest-link .t { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.invest-link .s { font-size: 0.76rem; color: var(--green-400); font-weight: 600; }
.invest-link .s.gold { color: var(--gold-400); }
.invest-link > i { color: var(--text-muted); font-size: 1.4rem; }

.feature-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    scrollbar-width: none;
}
.feature-scroll::-webkit-scrollbar { display: none; }
.feature-card {
    min-width: 270px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: 4px solid var(--green-500);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.feature-card.gold { border-right-color: var(--gold-400); }
.feature-card .fic {
    width: 42px; height: 42px;
    border-radius: var(--radius-full);
    background: var(--green-900);
    color: var(--green-400);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.feature-card.gold .fic { background: rgba(212,168,68,0.12); color: var(--gold-400); }
.feature-card .ft { font-size: 0.95rem; font-weight: 800; color: var(--text-primary); }
.feature-card .fd { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.feature-card .fl { font-size: 0.8rem; font-weight: 700; color: var(--green-400); display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.feature-card.gold .fl { color: var(--gold-400); }

/* =======================================================
   Admin Panel
   ======================================================= */
.admin-shell { max-width: 1100px; margin: 0 auto; padding: var(--space-lg) var(--space-md); }
.admin-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--top-nav-h);
    background: rgba(7,15,11,0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 900;
    display: flex;
    align-items: center;
}
.admin-topbar .inner { max-width: 1100px; width: 100%; margin: 0 auto; padding: 0 var(--space-md); display: flex; align-items: center; justify-content: space-between; }
.admin-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--green-400); font-size: 1.1rem; }
.admin-brand .tag { font-size: 0.65rem; background: var(--gold-400); color: #1a1a1a; padding: 1px 7px; border-radius: var(--radius-full); font-weight: 800; }

.admin-tabs {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    margin-bottom: var(--space-lg);
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 2px;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 6px;
}
.admin-tab:hover { color: var(--green-300); }
.admin-tab.active { color: var(--green-400); border-bottom-color: var(--green-400); }

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
@media (min-width: 700px) { .admin-stat-grid { grid-template-columns: repeat(4, 1fr); } }

.admin-table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table-card .table th { background: var(--bg-secondary); }
.admin-table-card .table td, .admin-table-card .table th { white-space: nowrap; }

.btn-xs {
    padding: 5px 11px;
    font-size: 0.76rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-approve { background: rgba(52,201,115,0.15); color: var(--green-300); border: 1px solid rgba(52,201,115,0.3); }
.btn-approve:hover { background: var(--green-700); color:#fff; }
.btn-reject { background: rgba(224,82,82,0.12); color: #f07070; border: 1px solid rgba(224,82,82,0.3); }
.btn-reject:hover { background: var(--danger); color:#fff; }
.btn-neutral { background: var(--bg-card-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-neutral:hover { color: var(--text-primary); border-color: var(--green-700); }
