/* OriFinance Clone Design System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --dark: #1E293B;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --white: #FFFFFF;
    --container-width: 1280px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #fef2f2 100%);
    color: var(--dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Blobs (Purple/Pink Circle background) */
.bg-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    filter: blur(150px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
    animation: blob-float 20s infinite alternate;
}

.blob-1 { top: -200px; right: -100px; background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%); }
.blob-2 { bottom: -200px; left: -100px; background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); animation-delay: -5s; }

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: var(--shadow-xl) !important;
}

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

/* Auth Pages (Login/Sign Up) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--gray-50);
}

.auth-card {
    background-color: var(--white);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-brand svg {
    width: 32px;
    height: 32px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 30px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    background-color: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

.btn-primary {
    width: 100%;
    height: 48px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    border-radius: 1.5rem;
    transition: all 0.2s;
    margin-top: 10px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.auth-footer {
    margin-top: 25px;
    font-size: 14px;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* Dashboard Styles Placeholder (Detailed in dashboard.html) */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 24px 0;
}

.main-content {
    flex: 1;
    background-color: var(--gray-50);
}

.navbar {
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: #0052FF;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover { color: #0052FF; }

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
}

.avatar-circle {
    width: 35px;
    height: 35px;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== NAVBAR DESKTOP ===== */
@media (min-width: 1001px) {
    .hamburger-btn { display: none !important; }
    .mobile-nav-overlay { display: none !important; }
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    flex-direction: column;
    gap: 5px;
    z-index: 1100;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== MOBILE NAV OVERLAY ===== */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

.mobile-nav-overlay.open { display: block; }

.mobile-nav-drawer {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1060;
    padding: 30px 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 5px 0 30px rgba(0,0,0,0.15);
}

.mobile-nav-overlay.open .mobile-nav-drawer {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-nav-logo {
    font-size: 20px;
    font-weight: 800;
    color: #0052FF;
}

.mobile-nav-close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.mobile-nav-user {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-wallet {
    margin-top: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

/* ===== TABLET/MOBILE NAVBAR ===== */
@media (max-width: 1000px) {
    .navbar { padding: 0 20px; height: 65px; }
    .nav-menu { display: none; }
    .hamburger-btn { display: flex; }

    /* Hide wallet text on mobile, show only in drawer */
    .wallet-balance-display span { display: none; }
    .wallet-balance-display {
        padding: 8px 12px !important;
        margin-right: 5px !important;
    }
    .user-profile span,
    .user-profile i { display: none; }
}

/* ===== DASHBOARD PAGE ===== */
@media (max-width: 768px) {
    .dashboard-wrapper { margin-top: 0 !important; }
    
    .dash-hero { padding: 20px 15px 30px; }
    .dash-hero h1 { font-size: 28px !important; }
    .dash-hero p { font-size: 14px; }

    .main-grid { 
        grid-template-columns: 1fr !important;
        padding: 0 15px;
        gap: 15px;
    }

    .small-grid {
        grid-template-columns: 1fr 1fr !important;
        padding: 15px;
        gap: 12px;
    }

    .lower-widgets-grid {
        grid-template-columns: 1fr !important;
        padding: 0 15px;
        gap: 15px;
    }

    .big-card { padding: 20px !important; }
    .card-value-lg { font-size: 28px !important; }
    .mini-value { font-size: 22px !important; }
    .mini-card { padding: 20px 15px !important; }
    .widget-box-main { padding: 25px 20px !important; }
}

/* ===== PLANS PAGE ===== */
@media (max-width: 768px) {
    .plans-container { margin: 80px auto 40px !important; padding: 0 15px !important; }
    .plans-title { font-size: 32px !important; }
    .plans-subtitle { font-size: 15px !important; margin-bottom: 40px !important; }
    .plans-grid { grid-template-columns: 1fr !important; gap: 25px !important; }
    .plan-yield { font-size: 48px !important; }
    .plan-features { padding: 0 25px 25px !important; }
    .btn-invest { width: calc(100% - 50px) !important; margin: 0 25px 25px !important; }
    .calculator-card { 
        grid-template-columns: 1fr !important;
        padding: 30px 20px !important;
        gap: 30px !important;
        margin-top: 40px !important;
    }
}

/* ===== WITHDRAW PAGE ===== */
@media (max-width: 768px) {
    .withdraw-container { margin: 80px auto 30px !important; padding: 0 15px !important; }
    .wallet-balance-amount { font-size: 30px !important; }
    .withdraw-form-card { padding: 25px 20px !important; }
    .withdraw-grid { grid-template-columns: 1fr !important; }
}

/* ===== DEPOSIT PAGE ===== */
@media (max-width: 768px) {
    .deposit-container { margin: 80px auto 30px !important; padding: 0 15px !important; }
    .deposit-header h1 { font-size: 28px !important; }
    .payment-methods-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    .method-card { padding: 25px 20px !important; }
    .proof-form-card { padding: 25px 18px !important; }
    .qr-section { padding: 25px 18px !important; }
    .qr-code { width: 200px !important; height: 200px !important; }
    .steps-indicator { gap: 10px; flex-wrap: wrap; justify-content: center; }
}

/* ===== AFFILIATE PAGE ===== */
@media (max-width: 768px) {
    .affiliate-container { margin: 80px auto 30px !important; padding: 0 15px !important; }
    .referral-card { padding: 30px 20px !important; }
    .referral-card h1 { font-size: 28px !important; }
    .referral-link-box { flex-direction: column; gap: 10px; }
    .affiliate-stats { grid-template-columns: 1fr 1fr !important; }
    .table-card { padding: 20px 15px !important; overflow-x: auto; }
    .custom-table { min-width: 500px; }
}

/* ===== PROFILE PAGE ===== */
@media (max-width: 768px) {
    .profile-container { margin: 80px auto 30px !important; padding: 0 15px !important; }
    .profile-grid { grid-template-columns: 1fr !important; }
    .profile-header-card { flex-direction: column !important; text-align: center !important; }
}

/* ===== AUTH PAGES ===== */
@media (max-width: 480px) {
    .auth-card { padding: 25px 20px; border-radius: 16px; }
    .auth-title { font-size: 22px; }
    .auth-brand { font-size: 20px; }
}

/* ===== FOOTER ===== */
@media (max-width: 768px) {
    footer > div > div { 
        flex-direction: column !important; 
        text-align: center; 
        gap: 15px !important; 
    }
    footer a { font-size: 13px !important; }
}

/* ===== GLOBAL MOBILE POLISH ===== */
@media (max-width: 768px) {
    .bg-blob { width: 300px !important; height: 300px !important; }

    /* Prevent horizontal scroll */
    body { overflow-x: hidden; }

    /* Better tap targets */
    button, a { min-height: 44px; }

    /* Alert messages */
    .alert { flex-direction: row; font-size: 14px !important; padding: 15px !important; }
}

/* ===== BOTTOM NAV BAR (Mobile Only) ===== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: white;
        border-top: 1px solid var(--gray-100);
        padding: 8px 0 env(safe-area-inset-bottom, 8px);
        z-index: 900;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.08);
    }

    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 10px;
        font-weight: 700;
        color: var(--gray-500);
        text-decoration: none;
        padding: 6px 4px;
        transition: color 0.2s;
    }

    .mobile-bottom-nav a i { font-size: 20px; }

    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a:hover {
        color: var(--primary);
    }

    /* Add padding to page so content not hidden behind bottom nav */
    body { padding-bottom: 70px; }
    .navbar { padding-bottom: env(safe-area-inset-top, 0); }
}

/* ===== STANDARD STATS SECTION ===== */
.dashboard-hero {
    padding: 50px 30px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 30px 40px;
}

.stat-card {
    background-color: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
}

.stat-card.blue::before { background-color: var(--primary); }
.stat-card.orange::before { background-color: var(--warning); }
.stat-card.green::before { background-color: var(--success); }
.stat-card.yellow::before { background-color: #FBBF24; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background-color: var(--gray-100);
}

.stat-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}
