/* ==========================================================================
   1. CSS VARIABLES & THEME
   ========================================================================== */
:root {
  --bg-dark: #0b0e14; 
  --bg-card: #151a25; 
  --bg-white: #ffffff; 
  --bg-light: #f4f6f8;
  --text-main: #ffffff; 
  --text-dark: #1a1d24; 
  --text-muted: #8892b0; 
  --text-muted-dark: #636b80;
  --primary: #00ff88; 
  --primary-hover: #00cc6a; 
  --danger: #ff4d4d;
  --border-color: #2a2f3a; 
  --border-light: #e1e4e8;
}

/* ==========================================================================
   2. RESET, BASE & TYPOGRAPHY
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-x: hidden; 
    scroll-behavior: smooth; 
}

a { 
    text-decoration: none; 
}

h1, h2, h3, h4 { 
    line-height: 1.2; 
    font-weight: 700; 
}

/* Base Classes */
.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.section-block { padding: 6rem 0; }
.section-title { font-size: 2.5rem; margin-bottom: 1rem; }
.section-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin-inline: auto; }

/* Utilities */
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-primary { color: var(--primary); }
.text-dark { color: var(--text-dark); }
.text-dark .section-subtitle { color: var(--text-muted-dark); }
.bg-white { background-color: var(--bg-white); }
.bg-dark { background-color: var(--bg-dark); }
.mb-4 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1.5rem; }
.w-100 { width: 100%; }
.d-block { display: block; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.border-bottom { border-bottom: 1px solid var(--border-color); }

/* ==========================================================================
   3. BUTTONS & BADGES
   ========================================================================== */
.btn { 
    display: inline-block; 
    padding: 0.8rem 2.5rem; 
    background: var(--primary); 
    color: #000; 
    font-size: 1rem; 
    font-weight: 700; 
    border-radius: 4px; 
    cursor: pointer; 
    border: 2px solid var(--primary); 
    transition: 0.3s ease; 
    text-align: center; 
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2); }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.9rem; }
.btn-outline-green { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-green:hover { background: var(--primary); color: #000; }
.btn-danger { background: transparent; color: var(--danger) !important; border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff !important; }

/* Base Badge */
.badge { 
    padding: 0.3rem 0.8rem; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600; 
    text-transform: uppercase; 
}
/* Status Badges */
.badge-completed, .badge-successful, .badge-approved { background: rgba(0, 255, 136, 0.1); color: var(--primary); }
.badge-pending, .badge-processing { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.badge-failed, .badge-declined, .badge-cancelled { background: rgba(255, 77, 77, 0.1); color: var(--danger); }

/* ==========================================================================
   4. GLOBAL NAVIGATION & FOOTER (Public Pages)
   ========================================================================== */
header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.2rem 5%; 
    background-color: var(--bg-card); 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
nav ul { list-style: none; display: flex; gap: 2rem; align-items: center; }
nav ul li a { color: var(--text-main); font-weight: 500; transition: color 0.3s; }
nav ul li a:hover { color: var(--primary); }
nav ul li a.nav-btn { background: var(--primary); color: #000; padding: 0.5rem 1.2rem; border-radius: 4px; font-weight: 600; }
.nav-toggle { display: none; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; }

/* Footer */
footer { background: #07090d; padding: 4rem 0 2rem; border-top: 1px solid var(--border-color); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.95rem; max-width: 300px; margin-top: 1rem; }
.footer-links-col h4 { margin-bottom: 1.5rem; color: #fff; }
.footer-links-col a { display: block; color: var(--text-muted); margin-bottom: 0.8rem; transition: color 0.3s; }
.footer-links-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 2rem; color: var(--text-muted); font-size: 0.9rem; }

/* ==========================================================================
   5. LANDING PAGE COMPONENTS
   ========================================================================== */
/* Ticker Marquee */
.ticker-wrap { width: 100%; overflow: hidden; background-color: #05070a; border-bottom: 1px solid var(--border-color); height: 45px; display: flex; align-items: center; }
.ticker { display: inline-flex; white-space: nowrap; animation: ticker 35s linear infinite; padding-left: 100%; }
.ticker:hover { animation-play-state: paused; }
.ticker-item { display: flex; align-items: center; gap: 0.8rem; margin-right: 4rem; font-weight: 600; font-size: 0.95rem; font-family: 'Courier New', monospace; }
.ticker-item span.coin-name { color: var(--text-muted); font-family: sans-serif; }
.ticker-item span.up { color: var(--primary); }
.ticker-item span.down { color: var(--danger); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* Hero Slider */
.hero-slider { position: relative; height: 600px; width: 100%; overflow: hidden; background: var(--bg-dark); }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease-in-out; display: flex; align-items: center; justify-content: center; text-align: center; z-index: 1; }
.slide.active { opacity: 1; z-index: 2; }
.slide-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; filter: brightness(0.3) contrast(1.2); z-index: -1; }
.slide-content { max-width: 800px; padding: 0 20px; }
.slide-content h1 { font-size: 4rem; margin-bottom: 1.5rem; }
.slide-content p { font-size: 1.2rem; color: #ddd; margin-bottom: 2rem; }
.slider-controls { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); display: flex; justify-content: space-between; padding: 0 2rem; z-index: 10; pointer-events: none; }
.slide-arrow { pointer-events: auto; background: rgba(0,0,0,0.5); color: white; border: none; font-size: 2rem; padding: 1rem; cursor: pointer; border-radius: 50%; transition: 0.3s; width: 60px; height: 60px; }
.slide-arrow:hover { background: var(--primary); color: #000; }

/* Market Table */
.table-responsive { overflow-x: auto; }
.market-table { width: 100%; border-collapse: collapse; margin-top: 1rem; text-align: left; }
.market-table th, .market-table td { padding: 1.2rem; border-bottom: 1px solid var(--border-color); }
.market-table th { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; }
.market-table tr:hover { background-color: rgba(255,255,255,0.02); }
.market-table .up { color: var(--primary); }
.market-table .down { color: var(--danger); }
.coin-flex { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.coin-flex span { color: var(--text-muted); font-weight: normal; font-size: 0.85rem; text-transform: uppercase; }

/* How It Works (Steps) */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; margin-top: 3rem; }
.step-card { padding: 2rem; }
.step-icon { width: 60px; height: 60px; background: var(--bg-light); color: var(--primary); font-size: 1.5rem; font-weight: bold; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; border: 2px solid var(--primary); }
.step-card h3 { margin-bottom: 1rem; color: var(--text-dark); }
.step-card p { color: var(--text-muted-dark); }

/* Packages */
.packages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; }
.package-card { background: var(--bg-card); padding: 3rem 2rem; border-radius: 8px; border: 1px solid var(--border-color); text-align: center; position: relative; transition: transform 0.3s; }
.package-card:hover { transform: translateY(-10px); }
.package-card.popular { border-color: var(--primary); }
/* Specific fix for badge inside package card */
.package-card .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #000; padding: 4px 12px; }
.price { font-size: 3.5rem; font-weight: 800; margin-bottom: 2rem; color: #fff; }
.price span { font-size: 1.5rem; vertical-align: top; color: var(--primary); }
.package-features { list-style: none; margin-bottom: 2.5rem; text-align: left; }
.package-features li { padding: 0.8rem 0; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.95rem; }
.package-features li:before { content: '✓'; color: var(--primary); margin-right: 10px; font-weight: bold; }

/* About & Testimonials */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-text p { font-size: 1.1rem; margin-bottom: 1.5rem; color: var(--text-muted-dark); }
.check-list { list-style: none; color: var(--text-dark); font-weight: 600; margin-bottom: 2rem; }
.check-list li { margin-bottom: 0.5rem; }
.check-list li:before { content: '✓'; color: var(--primary); margin-right: 10px; }
.about-stats { display: grid; gap: 1.5rem; }
.stat-box { background: var(--bg-light); padding: 1.5rem; border-left: 4px solid var(--primary); border-radius: 0 8px 8px 0; }
.stat-box h4 { font-size: 2rem; color: var(--text-dark); }
.stat-box span { color: var(--text-muted-dark); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; }

.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; }
.testimonial-card { background: var(--bg-card); padding: 2rem; border-radius: 8px; border: 1px solid var(--border-color); font-style: italic; color: var(--text-muted); }
.testimonial-card .client { margin-top: 1rem; color: var(--primary); font-weight: bold; font-style: normal; }

/* ==========================================================================
   6. DASHBOARD STYLES
   ========================================================================== */
.dashboard-body {
    background-color: var(--bg-dark);
    min-height: 100vh;
}
.dash-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 5%;
}
.dash-main {
    padding: 3rem 0;
}

/* Dashboard Header & Nav */
.dash-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dash-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.dash-nav a {
    color: var(--text-muted);
    font-weight: 500;
    transition: 0.3s;
}
.dash-nav a:hover, .dash-nav a.active {
    color: var(--primary);
}

/* Dashboard Dropdown Logic */
.dropdown-wrapper { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 180px;
    padding: 0.5rem 0;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none; 
    flex-direction: column;
    gap: 0 !important;
}
.dropdown-menu.show { display: flex; }
.dropdown-menu li a { display: block; padding: 0.8rem 1.2rem; width: 100%; }
.dropdown-menu li a:hover { background: rgba(0, 255, 136, 0.05); }

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
}
.stat-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.stat-card h3 {
    font-size: 2rem;
    color: #fff;
}

/* Dashboard Cards & Table */
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}
.dash-card-header h2 {
    font-size: 1.2rem;
    color: #fff;
}
.dash-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    text-align: left;
}
.dash-table th {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.dash-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #fff;
    font-size: 0.95rem;
}
.dash-table tr:hover td { background-color: rgba(255,255,255,0.02); }
.empty-state { color: var(--text-muted); padding: 2rem !important; text-align: center; }

/* Dashboard Table Utilities */
.ref-no { font-family: 'Courier New', monospace; color: var(--text-muted); }
.trans-type { text-transform: capitalize; }


/* ==========================================================================
   7. AUTHENTICATION PAGES
   ========================================================================== */
.auth-layout { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--bg-dark) 0%, #111822 100%); padding: 2rem; }
.auth-wrapper { width: 100%; max-width: 450px; }
.auth-card { background: var(--bg-card); padding: 3rem 2.5rem; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.form-group input[type="email"], .form-group input[type="text"], .form-group input[type="password"] { width: 100%; padding: 0.9rem; background: var(--bg-dark); border: 1px solid var(--border-color); color: white; border-radius: 4px; font-size: 1rem; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.checkbox-group { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-group input { margin-top: 4px; }
.checkbox-group label { font-size: 0.85rem; line-height: 1.4; }
.auth-footer p { color: var(--text-muted); font-size: 0.9rem; }
.auth-card a { color: var(--primary); }
.auth-card a:hover { text-decoration: underline; }

/* ==========================================================================
   8. TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container { position: fixed; bottom: 20px; left: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: var(--bg-card); border-left: 4px solid var(--primary); color: #fff; padding: 1rem 1.5rem; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); font-size: 0.9rem; display: flex; align-items: center; gap: 12px; animation: slideInUp 0.4s ease forwards; max-width: 350px; pointer-events: auto; }
.toast.hide { animation: fadeOutDown 0.4s ease forwards; }
.toast-icon { background: rgba(0, 255, 136, 0.1); color: var(--primary); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

@keyframes slideInUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOutDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }

/* ==========================================================================
   9. MOBILE RESPONSIVE (Merged)
   ========================================================================== */
@media (max-width: 768px) {
    /* Main Navigation & Dashboard Navigation */
    nav ul, .dash-nav ul { 
        display: none; 
        flex-direction: column; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        right: 0; 
        background: var(--bg-card); 
        padding: 1.5rem; 
        border-bottom: 1px solid var(--border-color); 
        gap: 0; 
    }
    nav ul.show, .dash-nav ul.show { display: flex; }
    .dash-nav ul li { width: 100%; }
    .dash-nav ul li a { display: block; padding: 1rem 0; border-bottom: 1px solid var(--border-color); }
    .nav-toggle { display: block; }
    
    /* Dashboard Dropdown Fix for Mobile */
    .dropdown-menu { position: static; box-shadow: none; border: none; margin-left: 1rem; }

    /* Landing Page Elements */
    .slide-content h1 { font-size: 2.5rem; }
    .about-grid, .footer-grid { grid-template-columns: 1fr; }
    #toast-container { bottom: 10px; left: 10px; right: 10px; align-items: center; }
    .toast { max-width: 100%; }

    /* Dashboard Mobile Table -> Card View */
    .dash-table, .dash-table tbody, .dash-table tr, .dash-table td {
        display: block;
        width: 100%;
    }
    .dash-table thead {
        display: none; /* Hide table headers */
    }
    .dash-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-dark);
    }
    .dash-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.8rem 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    .dash-table td:last-child {
        border-bottom: none;
    }
    .dash-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.8rem;
        color: var(--text-muted);
        text-align: left;
    }
}