/**
 * Zynq Rewards Platform - Applex Mobile-First Redesign
 * Light-mode, 450px centered container, fixed bottom tabbar
 */

:root {
    --bg-base: #f0f2f5;
    --bg-surface: #f4f5f7;
    --bg-glass: #ffffff;
    --bg-glass-card: #ffffff;
    --border-glass: #e5e5ea;
    --border-glow: rgba(67, 97, 238, 0.15);
    
    --primary: #4361EE;
    --primary-glow: #3A0CA3;
    --accent: #7B2CBF;
    --accent-pink: #F72585;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --text-dim: #98989d;
    
    --font-outfit: 'Outfit', sans-serif;
    
    --header-height: 60px;
    --tabbar-height: 65px;
}

/* Base Layout Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.zynq-dark-canvas {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-outfit);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center; /* Center the app container */
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Ambient Background Decor Objects (Hidden for clean Applex style or made subtle) */
.ambient-glow, .ambient-particles {
    display: none;
}

/* --- Mobile App Container --- */
.app-layout-frame {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    width: 100%;
    max-width: 450px;
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: var(--tabbar-height); /* Space for bottom tabbar */
}

/* --- Premium Navigation Header --- */
.zynq-main-header {
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

.header-inner {
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.brand-logo .brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.accent-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Desktop Nodes (Hidden completely) */
.desktop-nav {
    display: none;
}

/* Header Action Components */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-status-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 4px 4px 4px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.balance-meta .label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

.balance-meta .amount {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.vip-badge-mini {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}

.btn-icon-logout {
    display: none; /* Move to user profile or tabbar */
}

/* Glow Buttons (Adapted to flat Applex style) */
.btn-outline-glow {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    background: #fff;
}

.btn-outline-glow:hover {
    background: var(--bg-surface);
}

.btn-primary-glow {
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--primary);
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* Mobile Drawers (Hidden, using bottom tabbar instead) */
.mobile-menu-btn {
    display: none;
}
.mobile-nav-canvas {
    display: none !important;
}

/* --- Fixed Bottom Tabbar --- */
.bottom-tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: var(--tabbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 4px;
    width: 60px;
    height: 100%;
}

.tab-item i {
    font-size: 24px;
    transition: transform 0.2s;
}

.tab-item span {
    font-size: 10px;
    font-weight: 500;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item.active i {
    transform: translateY(-2px);
}

/* Alert Layer Anchor */
.alert-anchor-container {
    width: 100%;
    padding: 16px 16px 0;
    margin: 0 auto;
}

.custom-alert {
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-glass);
}

/* --- Shared Layout / Containers --- */
.container {
    padding: 24px 16px;
    flex-grow: 1;
    width: 100%;
}

/* Dynamic Live Ticker */
.live-payout-marquee {
    background: #fff;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.live-payout-marquee .ticker-badge {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.marquee-content {
    display: flex;
    gap: 24px;
    animation: scrollMarquee 20s linear infinite;
    white-space: nowrap;
}

.ticker-item {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticker-item strong {
    color: var(--text-main);
}

/* Premium Card Components (Vant Style) */
.glass-card {
    background: #fff;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    margin-bottom: 16px;
}

/* Grid Framework (Mobile First) */
.grid-3 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grid-2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Form System --- */
.auth-wrapper {
    width: 100%;
    margin: 40px auto;
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-group {
    margin-bottom: 16px;
}

.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid transparent;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn-submit-full {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 12px;
    margin-top: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 600;
}

/* --- Stats Counters --- */
.stat-card {
    background: #fff;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card .stat-info .stat-val {
    font-size: 20px;
    font-weight: 700;
}

.stat-card .stat-info .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Table Modules (Mobile Card Style) */
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background: var(--bg-surface);
    padding: 12px 16px;
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-glass);
    font-size: 13px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.badge-completed { background: rgba(52, 199, 89, 0.1); color: var(--success); }
.badge-pending { background: rgba(255, 149, 0, 0.1); color: var(--warning); }
.badge-failed { background: rgba(255, 59, 48, 0.1); color: var(--danger); }

/* --- Premium Footer Component --- */
.zynq-main-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
    padding: 40px 24px 20px;
    margin-top: auto;
}

.footer-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-bottom: 32px;
}

.footer-col .col-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.brand-slogan {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.social-links-footer {
    display: flex;
    gap: 10px;
}

.social-links-footer a {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links li a {
    color: var(--text-dim);
    font-size: 13px;
}

.security-badge-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.security-badge-grid .badge-item {
    background: #fff;
    border: 1px solid var(--border-glass);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.footer-bottom {
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.copyright-text {
    font-size: 12px;
    color: var(--text-dim);
}

.node-status {
    display: inline-flex;
}

/* Modal Core Frames */
.custom-modal-canvas {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.custom-modal-canvas.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-card {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: translateY(20px);
}

.custom-modal-canvas.active .custom-modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-surface);
}

.modal-body {
    padding: 20px;
}

/* Typography Overrides for Light Mode */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
}
p {
    color: var(--text-muted);
}
