:root {
    --primary-blue: #1035ac;
    --primary-dark: #0a247a;
    --accent-blue: #4c6ef5;
    --text-dark: #1F2937;
    --text-grey: #6B7280;
    --bg-light: #F3F4F6;
    --white: #FFFFFF;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

.mobile-wrapper {
    display: flex;
    justify-content: center;
    background: #e0e0e0;
    min-height: 100vh;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-light);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* Header Section */
.app-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 20px 24px 80px; /* Extra padding bottom for overlap */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.user-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

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

.greeting-text {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.username-display {
    font-size: 24px;
    font-weight: 700;
}

.avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.action-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--white);
    flex: 1;
}

.icon-circle {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
    backdrop-filter: blur(5px);
}

.action-btn:active .icon-circle {
    transform: scale(0.95);
    background: rgba(255,255,255,0.25);
}

.action-btn span {
    font-size: 12px;
    font-weight: 500;
}

/* Content Sheet (Main Card) */
.content-sheet {
    background: var(--bg-light);
    margin-top: -24px;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px 20px 100px; /* Bottom padding for nav */
    flex: 1;
    z-index: 10;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sheet-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.see-all-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #E5E7EB;
    color: var(--text-grey);
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(16, 53, 172, 0.2);
}

/* Transaction (Exchange Code) List */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.3s ease-out forwards;
}

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

.t-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #EFF6FF;
    color: var(--primary-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.t-info {
    flex: 1;
    overflow: hidden;
}

.t-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t-subtitle {
    font-size: 12px;
    color: var(--text-grey);
    display: flex;
    align-items: center;
    gap: 6px;
}

.t-amount {
    text-align: right;
    font-weight: 600;
    font-family: monospace;
    font-size: 14px;
    color: var(--primary-blue);
    background: #EEF2FF;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.t-amount:active {
    background: #DBEAFE;
}

.expired .t-amount {
    color: #DC2626;
    background: #FEE2E2;
}

.expired .t-icon {
    background: #FEE2E2;
    color: #DC2626;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px calc(12px + var(--safe-area-bottom));
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #9CA3AF;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    width: 60px;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-plus-btn {
    width: 48px;
    height: 48px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(16, 53, 172, 0.4);
    transform: translateY(-20px);
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 200;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.login-overlay.active {
    display: flex;
}

.login-content h1 {
    color: var(--primary-blue);
    margin-bottom: 8px;
    font-size: 28px;
}

.login-content p {
    color: var(--text-grey);
    margin-bottom: 40px;
}

.btn-discord-large {
    background: #5865F2;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(88, 101, 242, 0.3);
    transition: transform 0.2s;
}

.btn-discord-large:hover {
    transform: translateY(-2px);
    background: #4752C4;
}

/* Loading */
.loading-spinner {
    display: none;
    justify-content: center;
    padding: 20px;
}
.loading-spinner.show {
    display: flex;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #E5E7EB;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.guide-image {
    width: 100%;
    border-radius: 8px;
}

.image-caption {
    font-size: 13px;
    color: #555;
    margin-top: 10px;
    line-height: 1.5;
}
