/**
 * Zombie Miner - Toxic Green & Black Theme
 * Mobile-first responsive design for Telegram WebApp
 */

/* CSS Variables for Toxic Theme */
:root {
    --toxic-green: #00ff00;
    --toxic-green-dark: #00cc00;
    --toxic-green-light: #33ff33;
    --dark-bg: #0a0a0a;
    --dark-card: #1a1a1a;
    --dark-surface: #2a2a2a;
    --dark-border: #333333;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --danger: #ff4444;
    --warning: #ffaa00;
    --success: var(--toxic-green);
    --info: #00aaff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.zombie-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #0f0f0f 50%, var(--dark-bg) 100%);
    position: relative;
    overflow: hidden;
}

/* Animated Background Lines */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--toxic-green), transparent);
    animation: movingLines 8s linear infinite;
    z-index: 1;
    opacity: 0.3;
}

.app-container::after {
    content: '';
    position: fixed;
    top: 20%;
    left: 0;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--warning), transparent);
    animation: movingLines 12s linear infinite reverse;
    z-index: 1;
    opacity: 0.2;
}

/* Additional animated lines */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 200%;
    background: linear-gradient(180deg, transparent, var(--toxic-green), transparent);
    animation: diagonalLines 15s linear infinite;
    z-index: 1;
    opacity: 0.15;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 1px;
    height: 200%;
    background: linear-gradient(180deg, transparent, var(--warning), transparent);
    animation: diagonalLines 20s linear infinite reverse;
    z-index: 1;
    opacity: 0.1;
}

/* Header */
.app-header {
    background: var(--dark-card);
    border-bottom: 2px solid var(--toxic-green);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 255, 0, 0.1);
    animation: headerGlow 3s ease-in-out infinite alternate;
}

.app-title {
    color: var(--toxic-green);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    animation: userInfoGlow 4s ease-in-out infinite alternate;
}

.balance-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.balance-item {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.balance-item:hover {
    transform: scale(1.05);
}

.uranium-counter {
    color: var(--toxic-green);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
    animation: uraniumGlow 2.5s ease-in-out infinite alternate;
}

.trx-counter {
    color: var(--warning);
    text-shadow: 0 0 5px rgba(255, 170, 0, 0.3);
    animation: trxGlow 3s ease-in-out infinite alternate;
}

/* Main Content */
.main-content {
    flex: 1;
    padding-bottom: 80px; /* Space for bottom nav */
}

.page {
    display: none;
    min-height: calc(100vh - 140px);
    padding: 1rem;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Mining Stats Card */
.mining-stats-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--toxic-green);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Mining Area */
.mining-area {
    text-align: center;
}

.passive-mining-info {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.passive-info {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.passive-info i {
    margin-right: 0.5rem;
}

/* Main Mining Button */
.mining-button-container {
    margin: 2rem 0;
}

.mining-button {
    width: 200px;
    height: 200px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--toxic-green) 0%, var(--toxic-green-dark) 100%);
    color: var(--dark-bg);
    font-size: 1.2rem;
    font-weight: bold;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 25px rgba(0, 255, 0, 0.3);
    overflow: hidden;
}

.mining-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 255, 0, 0.4);
}

.mining-button:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.5);
}

.zombie-miner {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.mining-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.mining-button.clicked .mining-effect {
    animation: miningRipple 0.6s ease-out;
}

.uranium-gain {
    font-size: 1rem;
    font-weight: bold;
}

.click-instruction {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Ad Bonus Section */
.ad-bonus-section {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.ad-bonus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ad-bonus-header h6 {
    margin: 0;
    color: var(--toxic-green);
}

.ad-counter {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-ad {
    background: linear-gradient(135deg, var(--warning) 0%, #ff8800 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 170, 0, 0.3);
}

.active-bonuses {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--dark-surface);
    border-radius: 10px;
    border: 1px solid var(--warning);
}

.bonus-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bonus-timer {
    font-weight: bold;
    color: var(--warning);
}

/* Wallet Page Styles */
.wallet-content {
    max-width: 500px;
    margin: 0 auto;
}

.balance-cards {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.balance-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--toxic-green), var(--warning));
}

.balance-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.balance-header i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.balance-header h6 {
    margin: 0;
    color: var(--text-secondary);
}

.balance-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--toxic-green);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    margin-bottom: 0.5rem;
}

.balance-usd {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.wallet-section {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.wallet-section h6 {
    color: var(--toxic-green);
    margin-bottom: 1rem;
}

.convert-form, .withdraw-form {
    margin-top: 1rem;
}

.transaction-list {
    max-height: 300px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--dark-border);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-weight: bold;
    color: var(--toxic-green);
}

.transaction-amount {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.transaction-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.transaction-status.pending {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.transaction-status.completed {
    background: rgba(0, 255, 0, 0.2);
    color: var(--success);
}

.transaction-status.rejected {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger);
}

/* Profile Page Styles */
.profile-content {
    max-width: 500px;
    margin: 0 auto;
}

.profile-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--toxic-green), var(--info));
}

.profile-avatar {
    font-size: 4rem;
    color: var(--toxic-green);
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.stats-section, .achievements-section {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-section h6, .achievements-section h6 {
    color: var(--toxic-green);
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 10px;
    padding: 1rem;
}

.stat-icon {
    font-size: 2rem;
    margin-right: 1rem;
    width: 60px;
    text-align: center;
}

.stat-info {
    flex: 1;
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--toxic-green);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-card);
    border-top: 2px solid var(--toxic-green);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 10px;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}

.nav-item.active {
    color: var(--toxic-green);
    background: rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.nav-item:hover {
    color: var(--toxic-green);
    transform: translateY(-2px);
}

/* Custom Bootstrap Overrides */
.btn-toxic {
    background: linear-gradient(135deg, var(--toxic-green) 0%, var(--toxic-green-dark) 100%);
    border: none;
    color: var(--dark-bg);
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-toxic:hover {
    background: linear-gradient(135deg, var(--toxic-green-light) 0%, var(--toxic-green) 100%);
    color: var(--dark-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.3);
}

.form-control {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    color: var(--text-primary);
    border-radius: 10px;
}

.form-control:focus {
    background: var(--dark-surface);
    border-color: var(--toxic-green);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 0, 0.25);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.input-group .btn {
    border-radius: 0 10px 10px 0;
}

.text-toxic {
    color: var(--toxic-green) !important;
}

/* Toast Notifications */
.toast {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    color: var(--text-primary);
}

.toast-header {
    background: var(--dark-surface);
    border-bottom: 1px solid var(--dark-border);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes miningRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    }
}

@keyframes headerGlow {
    0% {
        box-shadow: 0 2px 20px rgba(0, 255, 0, 0.1);
        border-bottom-color: var(--toxic-green);
    }
    100% {
        box-shadow: 0 2px 30px rgba(0, 255, 0, 0.2);
        border-bottom-color: var(--toxic-green-light);
    }
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
        transform: scale(1.02);
    }
}

@keyframes userInfoGlow {
    0% {
        color: var(--text-secondary);
    }
    100% {
        color: var(--toxic-green-light);
    }
}

@keyframes uraniumGlow {
    0% {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
        color: var(--toxic-green);
    }
    100% {
        text-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
        color: var(--toxic-green-light);
    }
}

@keyframes trxGlow {
    0% {
        text-shadow: 0 0 5px rgba(255, 170, 0, 0.3);
        color: var(--warning);
    }
    100% {
        text-shadow: 0 0 15px rgba(255, 170, 0, 0.6);
        color: #ffcc00;
    }
}

@keyframes movingLines {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100vw);
    }
}

@keyframes diagonalLines {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100vw) translateY(100vh) rotate(45deg);
    }
}

@keyframes waveLines {
    0% {
        transform: translateX(-100%) scaleY(1);
    }
    50% {
        transform: translateX(50vw) scaleY(1.5);
    }
    100% {
        transform: translateX(100vw) scaleY(1);
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    .mining-button {
        width: 160px;
        height: 160px;
    }
    
    .zombie-miner {
        font-size: 2.5rem;
    }
    
    .balance-amount {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 320px) {
    .mining-button {
        width: 140px;
        height: 140px;
    }
    
    .zombie-miner {
        font-size: 2rem;
    }
}

/* Bootstrap Overrides */
.text-muted {
    color: var(--text-secondary) !important;
}

/* Utility Classes */
.d-none {
    display: none !important;
}

.text-center {
    text-align: center !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }

.p-3 { padding: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Prevent text selection and zoom */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Haptic feedback for buttons */
.mining-button,
.btn,
.nav-item {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--toxic-green);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--toxic-green-light);
}
