/* ===== BASE CSS - THEME VARIABLES AND FOUNDATION ===== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables for Both Orbitron Themes */
:root {
    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Common Colors */
    --accent-primary: #00d4ff;
    --accent-secondary: #ff6b35;
    --accent-success: #00ff88;
    --accent-warning: #ffaa00;
    --accent-error: #ff4757;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    
    /* Additional color variables */
    --primary-color: #00d4ff;
    --secondary-color: #ff6b35;
    --success-color: #00ff88;
    --warning-color: #ffaa00;
    --error-color: #ff4757;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-bg: #0a0a0f;
    --secondary-bg: #151520;
    --card-bg: #1e1e2e;
    --text-primary: #ffffff;
    --text-secondary: #b8bcc8;
    --text-muted: #6c7293;
    
    /* Dark Theme Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
    --gradient-card: linear-gradient(145deg, #1e1e2e 0%, #2d2d44 100%);
    --gradient-button: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-space: linear-gradient(45deg, #00d4ff, #a855f7, #ec4899, #00ff88);
    
    /* Dark Theme Effects */
    --shadow-primary: 0 8px 25px rgba(0, 212, 255, 0.2);
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.3);
    --border-glow: 0 0 15px rgba(0, 212, 255, 0.3);
    
    /* UPDATED Space background - STARS ONLY */
    --space-bg: radial-gradient(ellipse at bottom, #0d1421 0%, #080b14 100%);
    --star-color: rgba(255, 255, 255, 0.9);
    
    /* Additional dark theme variables */
    --text-color: #ffffff;
    --background-primary: #0a0a0f;
    --background-secondary: #151520;
    --border-color: rgba(0, 212, 255, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(0, 212, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

/* Light Theme Variables */
[data-theme="light"] {
    --primary-bg: #f8fafc;
    --secondary-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    /* Light Theme Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    --gradient-button: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-space: linear-gradient(45deg, #00d4ff, #a855f7, #ec4899, #00ff88);
    
    /* Light Theme Effects */
    --shadow-primary: 0 8px 25px rgba(0, 212, 255, 0.15);
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-glow: 0 0 15px rgba(0, 212, 255, 0.2);
    
    /* UPDATED Light space background - STARS ONLY */
    --space-bg: radial-gradient(ellipse at bottom, #e8f4f8 0%, #f0f8ff 100%);
    --star-color: rgba(0, 150, 200, 0.7);
    
    /* Additional light theme variables */
    --text-color: #2c2c2c;
    --background-primary: #f8fafc;
    --background-secondary: #ffffff;
    --border-color: rgba(0, 150, 200, 0.3);
    --glass-bg: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(0, 212, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.8);
}

/* Base Body Styles */
body {
    font-family: var(--font-secondary);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 14px;
    transition: var(--transition-smooth);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* UPDATED Space Background - Stars Only Theme */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--space-bg);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Multiple layers of stars for depth */
    background-image: 
        /* Large bright stars */
        radial-gradient(2px 2px at 20px 30px, var(--star-color), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--star-color), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--star-color), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--star-color), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--star-color), transparent),
        /* Medium stars */
        radial-gradient(1px 1px at 50px 120px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 180px 10px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 220px 90px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 60px 180px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 140px 160px, rgba(255, 255, 255, 0.7), transparent),
        /* Small twinkling stars */
        radial-gradient(0.5px 0.5px at 25px 15px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 75px 35px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 115px 55px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 155px 75px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 195px 95px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 35px 115px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 85px 135px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 125px 155px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 165px 175px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(0.5px 0.5px at 205px 195px, rgba(255, 255, 255, 0.5), transparent);
    background-repeat: repeat;
    background-size: 250px 200px;
    animation: starsMove 300s linear infinite;
}

/* Additional star layer for more density */
.stars::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 30px 50px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 80px 20px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(0.5px 0.5px at 120px 100px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(0.5px 0.5px at 170px 60px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 210px 140px, rgba(255, 255, 255, 0.6), transparent);
    background-repeat: repeat;
    background-size: 280px 180px;
    animation: starsMove 400s linear infinite reverse;
}

/* Twinkling effect for stars */
.stars::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 45px 85px, rgba(0, 212, 255, 0.8), transparent),
        radial-gradient(1px 1px at 135px 25px, rgba(168, 85, 247, 0.6), transparent),
        radial-gradient(1px 1px at 185px 145px, rgba(0, 255, 136, 0.7), transparent),
        radial-gradient(1px 1px at 65px 165px, rgba(255, 170, 0, 0.5), transparent);
    background-repeat: repeat;
    background-size: 220px 160px;
    animation: starsTwinkle 8s ease-in-out infinite alternate;
}

@keyframes starsMove {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.ai-robot {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: robotBounce 2s ease-in-out infinite;
}

.loading-text {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 255, 0.1);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes robotBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(21, 21, 32, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    z-index: 1000;
    height: 60px;
    transition: var(--transition-smooth);
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

.logo-img {
    height: 45px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 212, 255, 0.3));
    transition: all 0.3s ease;
}

.logo-img:hover {
    filter: drop-shadow(0 4px 12px rgba(0, 212, 255, 0.5));
    transform: scale(1.05);
}

.logo-text {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.network-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--accent-success);
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.1);
}

.network-status i {
    color: var(--accent-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.theme-toggle {
    background: var(--gradient-card);
    border: 1px solid var(--accent-purple);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--accent-purple);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
    background: var(--accent-purple);
    color: white;
}

.menu-toggle {
    background: var(--gradient-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.menu-toggle i {
    line-height: 1;
}

/* Main Container */
.main-container {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    padding: 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== UPDATED TOTAL INCOME SECTION - NORMAL BLUE COLORS ===== 
   Replace the Total Income styles in your base.css with these: */

/* Total Income Section Styles - Updated to match Available Balance */
.total-income-section {
    margin: 0.5rem 0;
    display: flex;
    justify-content: center;
}

.total-income-card {
    max-width: 400px;
    width: 100%;
    background: var(--gradient-card);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.total-income-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 212, 255, 0.2);
    border-color: var(--accent-primary);
}

.income-header {
    display: flex;
    align-items: left;
    justify-content: left;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}



.robot-gif {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.income-header h3 {
    font-family: var(--font-primary);
    color: var(--accent-primary);
    margin: 0;
    font-size: 1rem;
}

.income-display {
    margin: 0.8rem 0;
}

.total-income-amount {
    display: block;
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    text-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
    margin-bottom: 0.3rem;
}

.income-display small {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.income-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

[data-theme="light"] .breakdown-item {
    background: rgba(0, 212, 255, 0.03);
}

.breakdown-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.breakdown-value {
    color: var(--accent-primary);
    font-weight: 700;
    font-family: var(--font-primary);
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    .total-income-card {
        padding: 0.8rem 1.2rem;
        padding: 0.8rem 1.2rem;
        margin: 1rem;
    }
    
    .total-income-amount {
        font-size: 1.6rem;
    }
    
    .income-breakdown {
        gap: 0.4rem;
    }
    
    .breakdown-item {
        flex-direction: column;
        text-align: center;
        gap: 0.3rem;
    }
}

@media screen and (max-width: 480px) {
    .total-income-card {
        padding: 0.7rem 1rem;
        margin: 0.5rem;
    }
    
    .total-income-amount {
        font-size: 1.4rem;
    }
    
    .income-header h3 {
        font-size: 0.9rem;
    }
}

/* Enhanced Wallet Info Card */
.wallet-info-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.wallet-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.wallet-info-card h3 {
    color: var(--primary-color);
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
    min-height: 40px;
}

.wallet-info-item:last-child {
    border-bottom: none;
}

.wallet-info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.wallet-info-value {
    color: var(--text-color);
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    text-align: right;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-connected {
    color: var(--success-color) !important;
}

.wallet-disconnected {
    color: var(--error-color) !important;
}

.balance-sufficient {
    color: var(--success-color) !important;
}

.balance-insufficient {
    color: var(--warning-color) !important;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    border-color: var(--success-color);
    background: rgba(0, 255, 136, 0.1);
}

.notification.warning {
    border-color: var(--warning-color);
    background: rgba(255, 170, 0, 0.1);
}

.notification.error {
    border-color: var(--error-color);
    background: rgba(255, 71, 87, 0.1);
}

.notification.info {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-color);
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.visible { display: block !important; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Selection */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* Focus States */
*:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus,
.nav-item:focus,
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3);
}

/* Mobile Responsive Header */
@media screen and (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .theme-toggle,
    .menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .header-right {
        gap: 0.75rem;
    }
    
    .total-income-card {
        padding: 0.8rem 1.2rem;
        padding: 0.8rem 1.2rem;
        margin: 1rem;
    }
    
    .total-income-amount {
        font-size: 1.6rem;
        font-size: 1.6rem;
    }
    
    .income-breakdown {
        gap: 0.4rem;
    }
    
    .breakdown-item {
        flex-direction: column;
        text-align: center;
        gap: 0.3rem;
    }
    
    .notification-container {
        top: 80px;
        right: 16px;
        left: 16px;
    }
    
    .notification {
        max-width: none;
        width: 100%;
    }
    
    .wallet-info-card {
        padding: 14px;
        margin-bottom: 14px;
    }
    
    .wallet-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }
    
    .wallet-info-value {
        max-width: none;
        text-align: left;
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }
    
    .logo-img {
        height: 36px;
    }
    
    .theme-toggle,
    .menu-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .total-income-card {
        padding: 0.7rem 1rem;
        margin: 0.5rem;
    }
    
    .total-income-amount {
        font-size: 1.4rem;
    }
    
    .income-header h3 {
        font-size: 0.9rem;
    }
    
    .wallet-info-card {
        padding: 12px;
        border-radius: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}