:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-color: #0a0e27;
    --card-bg: #1a1f3a;
    --text-primary: #ffffff;
    --text-secondary: #8f9bb3;
    --border-color: #2e3458;
    --success-color: #00f2a5;
    --danger-color: #ff6b9d;
    --warning-color: #ffa500;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.loading-content {
    text-align: center;
}

.logo-container {
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.logo-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
}

.loading-text {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* Welcome Screen */
.screen {
    min-height: 100vh;
    padding-bottom: 80px;
}

.welcome-container {
    padding: 40px 20px;
}

.welcome-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    background: rgba(102, 126, 234, 0.1);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.welcome-form {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.btn {
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.feature-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Main Screen */
.header {
    background: var(--card-bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

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

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

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

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.wallet-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    border: none;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

/* Balance Section */
.balance-section {
    padding: 24px 20px;
}

.balance-card {
    background: var(--primary-gradient);
    padding: 32px 24px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 4px;
}

.balance-usd {
    font-size: 16px;
    opacity: 0.8;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.action-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 13px;
}

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

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deposit-icon {
    background: rgba(0, 242, 165, 0.15);
    color: var(--success-color);
}

.withdraw-icon {
    background: rgba(255, 107, 157, 0.15);
    color: var(--danger-color);
}

.exchange-icon {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

/* Currencies Section */
.currencies-section,
.transactions-section {
    padding: 0 20px 24px;
}

.currencies-section {
    padding-top: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

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

.see-all-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.currencies-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

/* Currency Cards - стиль основного сайта */
.currency-card-balance {
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 120px;
    border: 2px solid transparent;
}

.currency-card-balance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.currency-card-balance:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.currency-card-balance:hover::before {
    transform: scaleX(1);
}

.wallet-currency-card {
    border-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.wallet-currency-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.wallet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.currency-card-icon {
    font-size: 1.75rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.35), 0 6px 18px rgba(15, 23, 42, 0.25);
    padding: 20px;
}

.wallet-card-info-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.wallet-card-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wallet-card-info-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.wallet-card-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.currency-card-code {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.currency-card-name {
    font-size: 0.75rem;
    opacity: 0.8;
}

.currency-card-amount {
    font-size: 1.15rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.wallet-card-btn {
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.wallet-card-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.wallet-card-btn:active {
    transform: translateY(0);
}

.wallet-card-btn-deposit {
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
}

.wallet-card-btn-send {
    background: rgba(100, 116, 139, 0.9);
    color: #fff;
}

.wallet-card-btn-withdraw {
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
}

@media (max-width: 768px) {
    .currencies-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .currency-card-balance {
        padding: 1.25rem;
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .currency-card-balance {
        padding: 1rem;
    }

    .wallet-card-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* Old currency item styles for backward compatibility */
.currency-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-item:active {
    transform: scale(0.98);
}

.currency-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.currency-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(102, 126, 234, 0.1);
}

.currency-info {
    display: flex;
    flex-direction: column;
}

.currency-name {
    font-weight: 600;
    font-size: 15px;
}

.currency-code {
    font-size: 12px;
    color: var(--text-secondary);
}

.currency-right {
    text-align: right;
}

.currency-balance {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.currency-fiat {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Transactions */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.transaction-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-icon.incoming {
    background: rgba(0, 242, 165, 0.15);
    color: var(--success-color);
}

.transaction-icon.outgoing {
    background: rgba(255, 107, 157, 0.15);
    color: var(--danger-color);
}

.transaction-info {
    display: flex;
    flex-direction: column;
}

.transaction-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.transaction-right {
    text-align: right;
}

.transaction-amount {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 22px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-currency-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 16px;
}

.modal-currency-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.modal-currency-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.modal-currency-details p {
    font-size: 14px;
    color: var(--text-secondary);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.input-field::placeholder {
    color: rgba(143, 155, 179, 0.5);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-method:hover {
    background: rgba(255, 255, 255, 0.08);
}

.payment-method.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(102, 126, 234, 0.2);
}

.payment-method-info h5 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.payment-method-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.info-block {
    padding: 16px;
    background: rgba(255, 170, 0, 0.1);
    border-left: 4px solid var(--warning-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.qr-code {
    width: 200px;
    height: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.2);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(102, 126, 234, 0.3);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.transaction-amount.positive {
    color: var(--success-color);
}

.transaction-amount.negative {
    color: var(--danger-color);
}

.transaction-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

.transaction-status.completed {
    background: rgba(0, 242, 165, 0.15);
    color: var(--success-color);
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
    z-index: 100;
}

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

.nav-item.active {
    color: #667eea;
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-text {
    font-size: 14px;
}

/* Utilities */
.hide {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
