/**
 * Earn with Blocks - Mobile-First Stylesheet
 */

:root {
    --primary: #d4af37;
    --primary-dark: #b8941d;
    --primary-light: #f0d57c;
    --dark: #0a0e27;
    --dark-secondary: #161b38;
    --dark-tertiary: #1e2542;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-muted: #6b7a96;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    padding: 0 1rem;
}

/* Header/Navbar */
.header {
    background: var(--dark-secondary);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text i {
    font-size: 1.5rem;
}

/* User Avatar */
.user-avatar {
    color: var(--text-secondary);
    font-size: 2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.user-avatar:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.user-avatar:active {
    transform: scale(0.95);
}

/* Hide desktop navigation on mobile */
.nav-menu {
    display: none;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
}

.auth-card {
    background: var(--dark-secondary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark-tertiary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: var(--dark-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--dark-secondary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
    min-height: 100vh;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--dark-secondary);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Card */
.card {
    background: var(--dark-secondary);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--dark);
    border: none;
    padding: 2rem;
}

.wallet-balance {
    font-size: 3rem;
    font-weight: 800;
    margin: 1rem 0;
}

.wallet-label {
    font-size: 0.95rem;
    opacity: 0.8;
    font-weight: 600;
}

.wallet-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin: -0.5rem;
    padding: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table th {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.table td {
    color: var(--text-secondary);
}

.table tr:hover td {
    background: rgba(212, 175, 55, 0.05);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-prospect {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.badge-registered {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-pending {
    background: rgba(107, 122, 150, 0.2);
    color: var(--text-muted);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-secondary);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem;
    border-radius: 12px;
    flex: 1;
    max-width: 80px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

/* Special styling for the Add button */
.bottom-nav-item:nth-child(3) {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--dark);
    border-radius: 50%;
    padding: 1rem;
    margin: -0.5rem 0.5rem 0;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.bottom-nav-item:nth-child(3) i {
    font-size: 2rem;
}

.bottom-nav-item:nth-child(3):active {
    transform: scale(0.9);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(212, 175, 55, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.pb-5 { padding-bottom: 5rem; } /* For bottom nav spacing */

/* Responsive - Desktop */
@media (min-width: 768px) {
    /* Hide mobile bottom nav on desktop */
    .bottom-nav {
        display: none;
    }
    
    /* Show desktop navigation */
    .nav-menu {
        display: flex;
        gap: 1.5rem;
        align-items: center;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Larger logo/title on desktop */
    .logo-text {
        font-size: 1.5rem;
    }
    
    /* Ensure header content uses relative positioning for nav centering */
    .header-content {
        position: relative;
    }
    
    /* No bottom padding needed on desktop */
    .pb-5 {
        padding-bottom: 2rem;
    }
    
    .dashboard {
        padding: 2rem 0 3rem;
    }
    
    .auth-card {
        padding: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Hover effects on desktop */
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* Mobile-First Optimizations */
@media (max-width: 767px) {
    /* Improved header on mobile - logo left, avatar right */
    .header-content {
        justify-content: space-between;
    }
    
    .logo-text {
        text-align: left;
    }
    
    /* Ensure user avatar is visible on mobile */
    .user-avatar {
        position: relative;
        z-index: 10;
    }
    
    /* Better spacing for mobile */
    .dashboard {
        padding: 1rem 0 6rem;
    }
    
    .container,
    .container-fluid {
        padding: 0 1rem;
    }
    
    /* Mobile-optimized cards */
    .card {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .btn-sm {
        min-height: 40px;
        font-size: 0.875rem;
    }
    
    /* Better form inputs */
    .form-control {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Table optimization */
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Stack wallet actions */
    .wallet-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Stat cards better spacing */
    .stats-grid {
        gap: 0.75rem;
    }
    
    /* Better modal on mobile */
    .modal-content {
        margin: 1rem;
        border-radius: 12px;
    }
    
    /* Scrollable content with bottom nav */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

