/* ==================== 
   CRYPTO BOT MINI APP 
   PREMIUM DESIGN SYSTEM 
   ==================== */

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

:root {
    /* Core Colors */
    --bg-deep: #05050a;
    --bg-surface: #0f101a;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-heavy: rgba(255, 255, 255, 0.08);

    /* Semantic Colors */
    --primary: #833ab4;
    --primary-light: #c13584;
    --accent: #5851db;
    --success: #00f2fe;
    --success-light: #4facfe;
    --danger: #ff0844;
    --danger-light: #ffb199;
    --warning: #f9d423;

    /* Text Colors */
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Interaction & Effects */
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-pill: 100px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    --grad-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --grad-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-dark: linear-gradient(135deg, #1e1e2f 0%, #0f0f1a 100%);
    --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', 'Outfit', sans-serif;
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(131, 58, 180, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(88, 81, 219, 0.15) 0%, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    user-select: none;
}

.hidden {
    display: none !important;
}

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

.loading-screen.hidden {
    display: none !important;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--success);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Layout ==================== */
#app {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1;
    animation: contentInitialAppear 0.5s ease-out;
}

@keyframes contentInitialAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== Glass Elements ==================== */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-premium);
}

/* ==================== Header ==================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wrapper {
    position: relative;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 20px rgba(131, 58, 180, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.3px;
}

.user-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.settings-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: var(--transition);
}

.settings-btn:active {
    transform: scale(0.9);
    background: var(--bg-glass-heavy);
}

/* ==================== Balance Card ==================== */
.balance-card {
    background: var(--grad-dark);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.balance-card::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(131, 58, 180, 0.2) 0%, transparent 70%);
}

.balance-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-weight: 500;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.balance-currency {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-light);
    width: 50px;
}

.balance-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.wallet-address-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.wallet-address-pill:active {
    opacity: 0.7;
}

#address-text {
    font-size: 12px;
    color: var(--text-dim);
    font-family: monospace;
    flex: 1;
}

.balance-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-premium {
    flex: 1;
    height: 54px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-send {
    background: var(--grad-purple);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-receive {
    background: var(--grad-blue);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
}

.btn-premium:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* ==================== Navigation Tabs ==================== */
.nav-container {
    padding: 0 4px;
    margin-bottom: 24px;
}

.nav-tabs-glass {
    display: flex;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 5px;
    gap: 4px;
}

.nav-tab-lux {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.nav-tab-lux.active {
    background: var(--bg-glass-heavy);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-tab-lux svg {
    margin-bottom: 4px;
    stroke-width: 2.5px;
    width: 20px;
    height: 20px;
}

.nav-tab-lux.active svg {
    color: var(--success);
}

/* ==================== Services Row ==================== */
.services-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.service-card {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.service-card:active {
    transform: scale(0.95);
    background: var(--bg-glass-heavy);
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.service-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5px;
}

.service-card span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.p2p-grad {
    background: linear-gradient(135deg, #FF9A8B 0%, #FF6A88 55%, #FF99AC 100%);
}

.checks-grad {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
}

.ref-grad {
    background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
}

/* ==================== Transitions ==================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabEnter 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes tabEnter {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== List Styling ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title-lux {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.item-card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: var(--transition);
}

.item-card-glass:active {
    background: var(--bg-glass-heavy);
    transform: scale(0.98);
}

/* ==================== Floating Action Button ==================== */
.fab-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    padding: 0 24px;
    z-index: 50;
    pointer-events: none;
}

.btn-fab {
    width: 100%;
    height: 58px;
    background: var(--grad-primary);
    border-radius: var(--radius-md);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(253, 29, 29, 0.3);
    pointer-events: auto;
    transition: var(--transition);
}

.btn-fab:active {
    transform: scale(0.95);
}

/* ==================== Modals ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    animation: overlayFade 0.3s ease;
}

.modal-sheet {
    width: 100%;
    background: var(--bg-surface);
    border-radius: 32px 32px 0 0;
    padding: 24px;
    padding-bottom: 40px;
    animation: sheetSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px solid var(--glass-border);
}

@keyframes overlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sheetSlide {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.handle {
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 10px;
    margin: -12px auto 20px;
}

/* ==================== Utilities ==================== */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-glass-heavy);
    border-radius: 10px;
}

/* ==================== Empty State ==================== */
.empty-state-lux {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-lux svg {
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-lux p {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
}

/* ==================== P2P Filters & Chips ==================== */
.p2p-filters-row {
    padding-bottom: 8px;
    scrollbar-width: none;
    display: flex;
    overflow-x: auto;
}

.p2p-filters-row::-webkit-scrollbar {
    display: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.filter-group span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.chip {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chip.active {
    background: var(--grad-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(253, 29, 29, 0.2);
}

.chip:active {
    transform: scale(0.95);
}

/* ==================== Toast & Feedback ==================== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-premium);
}

.toast:not(.hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== Send/Receive Redesign ==================== */
.selection-card {
    background: var(--bg-glass-heavy);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.selection-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.12);
}

.selection-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.selection-details {
    flex: 1;
}

.selection-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.selection-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-light);
    margin-top: 2px;
}

.selection-value {
    text-align: right;
}

.value-main {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.value-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group-premium {
    width: 100%;
}

.input-wrapper-lux {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2px;
    transition: var(--transition);
}

.input-wrapper-lux:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(131, 58, 180, 0.2);
}

.input-wrapper-lux input {
    width: 100%;
    height: 56px;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 18px;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.input-wrapper-lux input::placeholder {
    color: var(--text-muted);
}

.input-icon-right {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 4px;
}

.input-action-text {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--primary-light);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-action-premium {
    width: 100%;
    height: 60px;
    background: var(--grad-blue);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.25);
    cursor: pointer;
    transition: var(--transition);
}

.btn-action-premium:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.wallet-address-pill-lux {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--glass-border);
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.wallet-address-pill-lux span {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-dim);
    word-break: break-all;
}

.wallet-address-pill-lux:active {
    background: rgba(255, 255, 255, 0.08);
}

.asset-dropdown {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--glass-border);
    border-radius: 24px 24px 0 0;
    padding: 20px;
    padding-bottom: 40px;
    z-index: 1200;
    transform: translateY(100%);
    transition: var(--transition);
}

.asset-dropdown:not(.hidden) {
    transform: translateY(0);
}

.asset-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-glass);
    border-radius: 16px;
    margin-bottom: 10px;
    cursor: pointer;
}

.asset-option:active {
    background: var(--bg-glass-heavy);
}

.asset-option span {
    font-weight: 700;
    font-size: 16px;
}

/* Modal Back Button */
.btn-back {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.btn-back:active {
    transform: translateY(-50%) scale(0.9);
    background: rgba(255, 255, 255, 0.1);
}

.modal-header {
    position: relative;
    /* For absolute button positioning */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
}