:root {
    --bg-base: #000000;
    --bg-panel: #111111;
    --text-light: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.5);
    --surface-light: rgba(255, 255, 255, 0.1);
    --surface-dark: #1E1E1E;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

body {
    background-color: #000000;
    color: #FFFFFF;
}

.app-container {
    width: 100%;
    max-width: 414px;
    margin: 0 auto;
    background-color: #000000;
    background-image: url('Frame 114717.png');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden; /* Скрываем общий скролл */
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    height: 100vh; /* Фиксированная высота */
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    position: relative;
    z-index: 1;
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.hello {
    font-size: 11px;
    color: var(--text-muted);
}

.name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: var(--surface-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    position: relative;
    backdrop-filter: blur(10px);
}

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

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    border: 1px solid #FFFFFF;
}

/* Toggle Pill */
.toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.toggle-pill {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 4px;
    backdrop-filter: blur(10px);
}

.toggle-item {
    padding: 10px 30px;
    border-radius: 26px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-item.active {
    background: #FFFFFF;
    color: #000000;
}

/* Eye Icon */
.eye-icon {
    display: flex;
    justify-content: flex-start;
    padding: 20px 24px 0;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.eye-icon svg {
    width: 18px;
    height: 18px;
}

/* Balance */
.balance-container {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.balance-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

.cents {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dots Indicator */
.dots-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.dot.active {
    background: var(--text-light);
}

/* Quick Actions (Row format) */
.quick-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 22%;
}

.action-btn {
    width: 100%;
    aspect-ratio: 1.2;
    background: var(--surface-light);
    border: none;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
}

/* Bottom Panel */
.bottom-panel {
    background: var(--bg-panel);
    flex: 1;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 30px 24px 20px 24px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Panel Tabs */
.panel-tabs {
    display: flex;
    gap: 12px;
}

.panel-tab {
    background: var(--surface-dark);
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
    text-align: center;
    transition: background 0.2s;
}

.panel-tab.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-light);
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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

/* Card Info Box */
.card-info-box {
    background: var(--surface-dark);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-logo {
    width: 40px;
    height: 40px;
    background: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.card-logo svg {
    width: 20px;
    height: 20px;
}

.card-details {
    flex: 1;
}

.card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.card-number {
    font-size: 13px;
    color: var(--text-muted);
}

.card-balance {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
}

/* Widgets (Analytics & Cashback) */
.widget-box {
    background: #1A1A1A;
    border-radius: 24px;
    padding: 20px;
    margin-top: 16px;
}

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

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
}

.widget-action {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

/* Analytics */
.analytics-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item:last-child {
    align-items: flex-end;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #FFFFFF; /* Нейтральный цвет, никаких ярких градиентов */
    border-radius: 3px;
}

/* Cashback */
.cashback-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.cb-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cb-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05); /* Нейтральный фон иконки */
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #FFFFFF;
}

.cb-icon svg {
    width: 20px;
    height: 20px;
}

.cb-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-name {
    font-size: 15px;
    font-weight: 500;
    color: #FFFFFF;
}

.cb-val {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.widget-btn {
    width: 100%;
    height: 48px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* Transactions in Dark Mode */
.tx-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tx-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tx-icon svg {
    width: 18px;
    height: 18px;
}

.tx-info {
    flex: 1;
}

.tx-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.tx-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.tx-amount {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
}

.tx-amount.positive {
    color: #FFFFFF;
}

/* Bottom Nav (Floating Pill) */
.bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 48px);
    max-width: 366px;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-image: url('Frame 114719.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 100;
    border-radius: 40px;
    padding: 0 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.bottom-nav .nav-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: all 0.2s ease;
}

.bottom-nav .nav-item.active {
    background: rgba(255, 255, 255, 0.15); /* Круглое выделение как на референсе */
    color: #FFFFFF;
}

.bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
}

/* Animations Framework */
.anim-init {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-active {
    opacity: 1;
    transform: translateY(0);
}

/* Micro-interactions */
.action-btn:active, .icon-btn:active, .nav-item:active, .panel-tab:active, .tx-item:active {
    transform: scale(0.92) !important;
    opacity: 0.8;
}

.action-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modals & Bottom Sheets */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 414px;
    background: #1A1A1A;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 30px 24px 50px;
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.bottom-sheet.active {
    bottom: 0;
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin: 0 auto 24px;
}

.sheet-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 12px;
    text-align: center;
}

.sheet-content {
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

/* View switching */
.main-view {
    display: none;
    animation: fadeIn 0.3s ease;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 110px; /* Отступ под плавающий навбар */
}

.main-view.active {
    display: flex;
}

#view-chat {
    overflow: hidden; /* Чат не должен скроллиться целиком */
    height: 100%;
    display: none;
    flex-direction: column;
}

#view-chat.active {
    display: flex;
}


#chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Важно для сжатия во flex-контейнере */
}



/* --- NFC & Chat Styles --- */
.nfc-wave {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: nfcPulse 2.5s infinite ease-out;
    opacity: 0;
}
.wave-1 { width: 60px; height: 60px; animation-delay: 0s; }
.wave-2 { width: 100px; height: 100px; animation-delay: 0.8s; }
.wave-3 { width: 140px; height: 140px; animation-delay: 1.6s; }

@keyframes nfcPulse {
    0% { transform: scale(0.6); opacity: 0; }
    50% { opacity: 0.7; }
    100% { transform: scale(1.3); opacity: 0; }
}

.suggest-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    outline: none;
}
.suggest-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Chat bubble types */
.chat-bubble.user {
    background: rgba(255,255,255,0.9);
    color: black !important;
    padding: 14px 16px;
    border-radius: 18px;
    border-top-right-radius: 4px;
    max-width: 85%;
    align-self: flex-end;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeInBubble 0.25s ease forwards;
}

.chat-bubble.ai {
    animation: fadeInBubble 0.3s ease forwards;
}

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

/* Custom switch representation */
.custom-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.custom-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.15);
    transition: .3s;
    border-radius: 24px;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .switch-slider {
    background-color: white;
}
input:checked + .switch-slider:before {
    transform: translateX(20px);
    background-color: black;
}

