/* Taho - Dark Modern Crypto Investment App */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #1f2537;
    --bg-input: #1e2538;
    --bg-nav: #0d1117;
    --text-primary: #f0f4ff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #00e5a0;
    --accent-secondary: #00bcd4;
    --accent-gradient: linear-gradient(135deg, #00e5a0, #00bcd4);
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;
    --border-color: #1e293b;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 229, 160, 0.15);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html, body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

/* Links */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}
a:hover {
    opacity: 0.8;
}

/* App Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg-primary);
    padding-bottom: 80px;
}

/* Top Bar */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-topbar .logo {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.app-topbar .actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-topbar .actions .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 18px;
}
.app-topbar .actions .icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
}
.app-topbar .actions .icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom Navigation */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 200;
}

.app-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 4px 12px;
    border: none;
    background: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
}

.app-bottom-nav .nav-item .nav-icon {
    font-size: 22px;
    line-height: 1;
}

.app-bottom-nav .nav-item .nav-label {
    font-size: 10px;
    font-weight: 500;
}

.app-bottom-nav .nav-item.active {
    color: var(--accent-primary);
}
.app-bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 4px 4px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}
.card:hover {
    border-color: rgba(0, 229, 160, 0.2);
}
.card-glow {
    background: linear-gradient(135deg, rgba(0, 229, 160, 0.08), rgba(0, 188, 212, 0.08));
    border-color: rgba(0, 229, 160, 0.2);
    box-shadow: var(--shadow-glow);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    border: none;
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 16px;
    position: relative;
    overflow: hidden;
}
.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 229, 160, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.balance-card .balance-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}
.balance-card .balance-amount {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}
.balance-card .balance-details {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.balance-card .balance-details .detail-item {
    text-align: center;
}
.balance-card .balance-details .detail-item .detail-value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.balance-card .balance-details .detail-item .detail-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    text-decoration: none;
    width: 100%;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: var(--accent-gradient);
    color: #000;
}
.btn-primary:hover {
    box-shadow: 0 0 25px rgba(0, 229, 160, 0.3);
    color: #000;
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.btn-danger {
    background: var(--accent-danger);
    color: #fff;
}
.btn-success {
    background: var(--accent-primary);
    color: #000;
}
.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.1);
}
.form-group input::placeholder {
    color: var(--text-muted);
}
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Investment Packages Grid */
.packages-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
}

.package-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.package-card:hover,
.package-card.selected {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}
.package-card.selected {
    background: linear-gradient(135deg, rgba(0, 229, 160, 0.1), rgba(0, 188, 212, 0.1));
}
.package-card .package-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.package-card .package-price {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.package-card .package-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.package-card .package-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-gradient);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

/* Page Content */
.page-content {
    padding: 16px;
}
.page-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
}
.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}
.stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Transaction List */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}
.transaction-item .tx-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.tx-icon.deposit { background: rgba(0, 229, 160, 0.15); color: var(--accent-primary); }
.tx-icon.withdrawal { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.tx-icon.profit { background: rgba(0, 188, 212, 0.15); color: var(--accent-secondary); }
.tx-icon.bonus { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.tx-icon.referral { background: rgba(59, 130, 246, 0.15); color: var(--accent-info); }
.tx-icon.salary { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

.transaction-item .tx-info { flex: 1; }
.transaction-item .tx-info .tx-type {
    font-size: 14px;
    font-weight: 600;
}
.transaction-item .tx-info .tx-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.transaction-item .tx-amount {
    text-align: right;
}
.transaction-item .tx-amount .amount {
    font-size: 15px;
    font-weight: 700;
}
.transaction-item .tx-amount .amount.positive { color: var(--accent-primary); }
.transaction-item .tx-amount .amount.negative { color: var(--accent-danger); }
.transaction-item .tx-amount .tx-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 2px;
}
.tx-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.tx-status.completed { background: rgba(0, 229, 160, 0.15); color: var(--accent-primary); }
.tx-status.failed { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.tx-status.cancelled { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
}
.auth-page .auth-logo {
    font-size: 42px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.auth-page .auth-tagline {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}
.auth-page .auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px 24px;
}
.auth-page .auth-card .auth-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}
.auth-page .auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}
.auth-divider span {
    background: var(--bg-card);
    padding: 0 12px;
    position: relative;
    color: var(--text-muted);
    font-size: 12px;
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success {
    background: rgba(0, 229, 160, 0.1);
    border: 1px solid rgba(0, 229, 160, 0.2);
    color: var(--accent-primary);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}
.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}
.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent-info);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-content .modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

/* Team Tree */
.team-tree {
    padding: 0 16px;
}
.team-level {
    margin-bottom: 16px;
}
.team-level .level-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.team-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 6px;
}
.team-member .member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #000;
    flex-shrink: 0;
}
.team-member .member-info { flex: 1; }
.team-member .member-info .member-name {
    font-size: 14px;
    font-weight: 600;
}
.team-member .member-info .member-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Copy Button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 229, 160, 0.1);
    border: 1px solid rgba(0, 229, 160, 0.2);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.copy-btn:hover {
    background: rgba(0, 229, 160, 0.2);
}

/* Amount Chips */
.amount-chip {
    padding: 8px 18px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}
.amount-chip:hover,
.amount-chip.active {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 160, 0.1);
    color: var(--accent-primary);
}

/* Coin Selector */
.coin-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.coin-option {
    padding: 14px 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
}
.coin-option:hover,
.coin-option.selected {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 160, 0.08);
}
.coin-option .coin-sub {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

/* Loading */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 229, 160, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state .empty-text {
    font-size: 15px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 440px;
    width: calc(100% - 32px);
}
.toast {
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideDown 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.toast-success { background: #065f46; color: #6ee7b7; border: 1px solid rgba(110, 231, 183, 0.2); }
.toast-error { background: #7f1d1d; color: #fca5a5; border: 1px solid rgba(252, 165, 165, 0.2); }
.toast-warning { background: #78350f; color: #fcd34d; border: 1px solid rgba(252, 211, 77, 0.2); }
@keyframes toastSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Plans & Features */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.feature-item .feature-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 229, 160, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 12px;
    flex-shrink: 0;
}

/* Wallet Address Display */
.wallet-display {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.wallet-display .wallet-address {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    color: var(--text-secondary);
}
.wallet-display .wallet-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Responsive for larger screens too */
@media (min-width: 481px) {
    .app-container {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }
    .app-bottom-nav {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quick Action Buttons */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 16px;
}
.quick-action {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.quick-action:hover {
    border-color: var(--accent-primary);
}
.quick-action .qa-icon {
    font-size: 28px;
    margin-bottom: 6px;
}
.quick-action .qa-label {
    font-size: 13px;
    font-weight: 600;
}
