/* ============================================================================
   VANTAGEQUANT - PREMIUM TRADING PLATFORM UI (v5.0 Final)
   Theme: Obsidian Black + Amber Gold — iOS Glassmorphism
   
   This stylesheet covers ALL global components used across every page:
   - Navigation (desktop + mobile)
   - Buttons (all variants)
   - Forms (inputs, selects, textareas, file uploads)
   - Modals
   - Toasts
   - Footer
   - Loading / Empty states
   - WhatsApp float
   - Particles canvas
   - Typography & Utilities
   ============================================================================ */

/* ─── Design Tokens ─── */
:root {
    --c-black:     #050507;
    --c-dark-1:    #0c0c0f;
    --c-dark-2:    #141418;
    --c-dark-3:    #1c1c21;
    --c-dark-4:    #26262c;
    --c-dark-5:    #333339;

    --c-amber:     #f59e0b;
    --c-amber-lt:  #fbbf24;
    --c-amber-dk:  #d97706;
    --c-amber-bg:  rgba(245, 158, 11, 0.08);
    --c-amber-glow:rgba(245, 158, 11, 0.25);

    --c-green:     #22c55e;
    --c-red:       #ef4444;

    --c-white:     #f8fafc;
    --c-grey-1:    #e2e8f0;
    --c-grey-2:    #94a3b8;
    --c-grey-3:    #64748b;
    --c-grey-4:    #475569;

    --glass:       rgba(20, 20, 24, 0.72);
    --glass-heavy: rgba(12, 12, 15, 0.85);
    --glass-border:rgba(255, 255, 255, 0.07);

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-pill: 999px;

    --blur: 20px;
    --max-w: 1200px;
    --z-nav: 900;
    --z-modal: 2000;
    --z-overlay: 3000;
    --z-toast: 4000;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--c-black);
    color: var(--c-grey-1);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; border: none; outline: none; background: none; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-black); }
::-webkit-scrollbar-thumb { background: var(--c-dark-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-amber); }

/* ─── Particles ─── */
#particleCanvas {
    position: fixed; inset: 0;
    z-index: -1; pointer-events: none; opacity: 0.25;
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION — Floating Glass Pill (Desktop)
   ══════════════════════════════════════════════════════════════ */
.navbar {
    position: fixed; top: 12px; left: 24px; right: 24px;
    z-index: var(--z-nav);
    background: var(--glass-heavy);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-pill);
    transition: background 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    background: rgba(5,5,7,0.95);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

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

.nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 1.1rem;
    z-index: 2;
}

.nav-logo {
    width: 28px !important; height: 28px !important;
    border-radius: var(--r-sm); object-fit: contain;
    flex-shrink: 0;
}

.nav-name { color: var(--c-white); letter-spacing: -0.01em; }

.nav-links {
    display: flex; align-items: center; gap: 4px;
}

.nav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--r-pill);
    font-size: 0.8125rem; font-weight: 600;
    color: var(--c-grey-2);
    transition: all 0.2s;
}

.nav-link:hover { color: var(--c-white); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--c-white); background: rgba(255,255,255,0.08); }
.nav-admin { color: var(--c-amber) !important; }
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* Mobile toggle — hidden on desktop */
.nav-toggle {
    display: none;
    padding: 8px; border-radius: var(--r-md); color: var(--c-grey-2);
}
.nav-toggle:hover { background: rgba(255,255,255,0.06); color: var(--c-white); }

/* Mobile menu — hidden by default */
.mobile-menu {
    display: none !important;
    flex-direction: column; padding: 8px 20px 16px;
    border-top: 1px solid var(--glass-border);
}
.mobile-menu.show { display: flex !important; }

.mobile-link {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--r-md);
    font-weight: 600; color: var(--c-grey-2);
}
.mobile-link:hover, .mobile-link.active { color: var(--c-amber); background: var(--c-amber-bg); }

@media (max-width: 768px) {
    .navbar { top: 8px; left: 12px; right: 12px; border-radius: var(--r-xl); }
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .mobile-menu { display: none !important; }
    .mobile-menu.show { display: flex !important; }
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS — All variants
   ══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--r-md);
    font-size: 0.875rem; font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap; cursor: pointer;
}

.btn i, .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--c-amber); color: #000;
    box-shadow: 0 2px 12px var(--c-amber-glow);
}
.btn-primary:hover {
    background: var(--c-amber-lt); transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--c-amber-glow);
}

.btn-ghost {
    background: rgba(255,255,255,0.06); color: var(--c-grey-1);
    border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25);
    color: var(--c-white);
}

.btn-danger {
    background: rgba(239,68,68,0.12); color: var(--c-red);
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-lg { padding: 14px 28px; font-size: 0.9375rem; border-radius: var(--r-lg); }

.w-full { width: 100%; }

.btn-clear-img {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--c-red);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--r-sm);
    display: none; /* Hidden by default, shown when preview exists */
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-clear-img:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-clear-img i, .btn-clear-img svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY & UTILITIES
   ══════════════════════════════════════════════════════════════ */
.gradient-text {
    background: linear-gradient(135deg, var(--c-amber), #ef8e1c);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-green { color: var(--c-green); }
.section-container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.section-header { text-align: center; margin-bottom: 48px; }
.section-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; background: var(--c-amber-bg);
    border: 1px solid rgba(245,158,11,0.15); border-radius: var(--r-pill);
    font-size: 0.75rem; font-weight: 700; color: var(--c-amber);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 16px;
}
.section-badge i, .section-badge svg { width: 14px; height: 14px; }
.section-title { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; color: var(--c-white); margin-bottom: 12px; }
.section-desc { color: var(--c-grey-2); font-size: 1rem; max-width: 520px; margin: 0 auto; }

/* ══════════════════════════════════════════════════════════════
   FORMS — Glassmorphic inputs
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 0.75rem; font-weight: 700;
    color: var(--c-grey-3); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.06em;
}

.form-input, .form-select, .form-textarea {
    width: 100%; padding: 11px 14px;
    background: var(--c-dark-3); border: 1px solid var(--glass-border);
    border-radius: var(--r-md); color: var(--c-white); font-size: 0.875rem;
    transition: border-color 0.2s, background 0.2s;
}
.form-input::placeholder { color: var(--c-grey-4); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--c-amber); background: var(--c-dark-4);
    outline: none; box-shadow: 0 0 0 3px rgba(245,158,11,0.08);
}

.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; appearance: auto; }

.form-grid {
    display: grid; gap: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }
.full-width { grid-column: 1 / -1; }

.form-section {
    background: var(--c-dark-2); border: 1px solid var(--glass-border);
    border-radius: var(--r-xl); padding: 28px; margin-bottom: 24px;
}
.form-section h3, .form-section h4 {
    font-size: 0.9375rem; font-weight: 800; color: var(--c-amber);
    margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.05em;
}

.file-upload-wrapper {
    background: var(--c-dark-3); padding: 16px;
    border: 1px dashed rgba(255,255,255,0.1); border-radius: var(--r-md);
    transition: 0.2s;
}
.file-upload-wrapper:hover { border-color: var(--c-amber); background: var(--c-amber-bg); }

.upload-preview { margin-top: 10px; }
.upload-preview img {
    max-height: 80px; border-radius: var(--r-sm);
    border: 1px solid var(--glass-border);
}

/* ══════════════════════════════════════════════════════════════
   MODALS — Frosted Glass Overlay
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--c-dark-2); border: 1px solid var(--glass-border);
    border-radius: var(--r-xl); width: 100%; max-width: 520px;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-content.admin-modal { max-width: 720px; }

.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 1.0625rem; font-weight: 800; color: var(--c-white); }

.close-modal {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm); color: var(--c-grey-3); transition: 0.2s;
}
.close-modal:hover { background: rgba(255,255,255,0.06); color: var(--c-white); }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-body p { color: var(--c-grey-2); margin-bottom: 20px; line-height: 1.7; }

.modal-actions {
    display: flex; gap: 12px;
    padding-top: 20px; border-top: 1px solid var(--glass-border);
}
.modal-actions .btn {
    flex: 1; text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   TOASTS — Slide-in notifications
   ══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed; top: 84px; right: 24px;
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 10px;
}

.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; background: var(--c-dark-2);
    border: 1px solid var(--glass-border); border-radius: var(--r-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    font-size: 0.875rem; font-weight: 500; color: var(--c-grey-1);
    animation: toastSlide 0.4s cubic-bezier(0.16,1,0.3,1);
    max-width: 380px;
}
.toast i, .toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success { border-left: 3px solid var(--c-green); }
.toast.success i { color: var(--c-green); }
.toast.error { border-left: 3px solid var(--c-red); }
.toast.error i { color: var(--c-red); }

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════════════════════════
   LOADING / EMPTY STATES
   ══════════════════════════════════════════════════════════════ */
.loading-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 20px; gap: 16px;
    color: var(--c-grey-3);
}

.loader { position: relative; width: 40px; height: 40px; }
.loader-ring {
    position: absolute; width: 100%; height: 100%;
    border: 2px solid transparent; border-top-color: var(--c-amber);
    border-radius: 50%; animation: spin 1s linear infinite;
}
.loader-ring:nth-child(2) {
    width: 70%; height: 70%; top: 15%; left: 15%;
    border-top-color: var(--c-amber-dk); animation-duration: 0.75s; animation-direction: reverse;
}
.loader-ring:nth-child(3) {
    width: 40%; height: 40%; top: 30%; left: 30%;
    border-top-color: var(--c-amber-lt); animation-duration: 0.5s;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center; padding: 80px 20px; color: var(--c-grey-3);
}
.empty-icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--c-grey-4); }
.empty-state h3 { color: var(--c-grey-1); font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }

/* ══════════════════════════════════════════════════════════════
   WHATSAPP FLOAT
   ══════════════════════════════════════════════════════════════ */
.wa-float {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 500; width: 52px; height: 52px;
    background: #25d366; color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.35);
    transition: 0.3s;
}
.wa-float:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 6px 24px rgba(37,211,102,0.5); }

/* ══════════════════════════════════════════════════════════════
   FOOTER — Glass Panel
   ══════════════════════════════════════════════════════════════ */
.footer {
    margin-top: 80px; padding: 48px 0 32px;
    background: var(--c-dark-1);
    border-top: 1px solid var(--glass-border);
}

.footer-container {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
}

.footer-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-bottom: 32px; margin-bottom: 32px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap; gap: 24px;
}

.footer-brand h3 {
    font-size: 1.125rem; font-weight: 800; color: var(--c-white); margin-bottom: 6px;
}
.footer-brand p { color: var(--c-grey-3); font-size: 0.875rem; }

.footer-links { display: flex; gap: 24px; }
.footer-links a {
    color: var(--c-grey-3); font-size: 0.875rem; font-weight: 600;
}
.footer-links a:hover { color: var(--c-amber); }

.footer-bottom { text-align: center; }
.footer-bottom p { color: var(--c-grey-4); font-size: 0.8125rem; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile polish
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .footer-top { flex-direction: column; text-align: center; align-items: center; }
    .footer-links { justify-content: center; }
}
