@font-face {
    font-family: 'SF Pro Text';
    src: url('SFProText-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'SF Pro Text';
    src: url('SFProText-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

:root {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --accent-blue: #007aff;
    --accent-gold: #ffd60a;
    --nav-bg: #1c1c1e;
    --separator: #3a3a3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 0;
    padding-top: env(safe-area-inset-top);
    min-height: 100vh;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    align-items: center;
    position: sticky;
    top: 0;
    transition: top 0.3s;
    background-color: var(--bg-color);
    z-index: 1000;
    border-bottom: 0.5px solid rgba(58, 58, 60, 0.5);
}

.balance-pill {
    background-color: #2c2c2e;
    padding: 8px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
    gap: 8px;
}

.balance-pill.stars .icon {
    display: flex;
    align-items: center;
}

.star-icon {
    width: 18px;
    height: 18px;
    fill: var(--accent-gold);
}

.login-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 2px 4px 2px 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
    cursor: pointer;
    line-height: normal;
}

.login-btn ion-icon[name="diamond"] {
    font-size: 12px;
}

.login-btn ion-icon[name="add-circle"] {
    font-size: 22px;
}


.add-btn {
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Banner */
.banner {
    margin: 0 16px 20px 16px;
    background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    height: 122px;
    position: relative;
    overflow: hidden;
    background-size: cover !important;
    background-position: center !important;
}

/* Section Title */
.section-title {
    display: flex;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 8px;
    align-items: baseline;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.section-title::-webkit-scrollbar {
    display: none;
}

.section-title .tab {
    font-size: 22px;
    cursor: pointer;
    line-height: normal;
    transition: color 0.2s ease;
}

.section-title .active {
    color: var(--text-primary);
    font-weight: 800;
}

.section-title .inactive {
    color: var(--text-secondary);
    font-weight: 700;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 6px;
    padding: 0 12px;
    overflow-x: auto;
    margin-bottom: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    background-color: var(--card-bg);
    padding: 6px 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-width: 72px;
    font-size: 11px;
    color: var(--text-secondary);
    position: relative;
}

.chip .value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    margin-top: 2px;
}

.chip ion-icon {
    position: absolute;
    right: 10px;
    top: 12px;
    font-size: 14px;
    opacity: 0.5;
}

.chip.icon-only {
    min-width: 44px;
    align-items: center;
    justify-content: center;
    background-color: white;
}

.chip.icon-only ion-icon {
    position: static;
    color: black;
    font-size: 20px;
    opacity: 1;
    margin: 0;
}

/* Controls */
.controls-row {
    display: flex;
    padding: 0 12px;
    gap: 6px;
    margin-bottom: 12px;
}

.slider-container {
    flex: 1;
    background: #1c1c1e;
    border-radius: 12px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
}

.slider-track-area {
    flex: 1;
    height: 4px;
    background: #3a3a3c;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    margin-right: 4px;
    display: flex;
    align-items: center;
}

.slider-track-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 2px;
    opacity: 0;
}

.slider-fill {
    height: 100%;
    background: #636366;
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}

.slider-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    cursor: grab;
    z-index: 2;
}

.slider-thumb.active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-labels {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    line-height: 1.1;
    text-align: right;
}

.price-val {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.count-val {
    font-size: 11px;
    color: #4c8ebc;
    font-weight: 500;
}

.view-buttons {
    display: flex;
    gap: 4px;
}

.search-bar {
    background: #1c1c1e;
    border-radius: 12px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    height: 44px;
    gap: 8px;
    color: var(--text-secondary);
    margin: 0 12px 16px;
}

.search-bar ion-icon {
    font-size: 20px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    width: 100%;
    height: 100%;
    outline: none;
    padding: 0;
}

.icon-btn {
    width: 44px;
    height: 44px;
    background: #1c1c1e;
    border-radius: 12px;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn.active {
    color: white;
    background: #3a3a3c;
}

/* NFT Grid */
.nft-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 12px;
}

.nft-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-image {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.card-info {
    padding: 12px;
}

.card-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.price-btn {
    flex: 1;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.basket-btn {
    background: #2c2c2e;
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    padding: 8px;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 1;
}

.ton-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--separator);
    padding: 8px 16px 24px 16px;
    display: flex;
    justify-content: space-around;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    width: 60px;
}

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

.nav-item ion-icon {
    font-size: 24px;
}

.nav-item span {
    font-size: 10px;
}

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

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.auth-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #1c1c1e;
    padding: 24px;
    border-radius: 20px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 1001;
}

.modal-tg-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.modal-login-btn {
    width: 100%;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
}

/* Empty State */
.auth-hint-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    margin: 16px;
    margin-bottom: 40px;
}

.hint-icon {
    margin-bottom: 16px;
}

.auth-hint-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-hint-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.4;
}

.hint-login-btn {
    width: 100%;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hint-tg-icon {
    width: 20px;
    height: 20px;
}

.view-section {
    display: none;
}
.view-section.active {
    display: block;
}

/* New Inventory Styles */
.inventory-toggles {
    display: flex;
    background: #1c1c1e;
    border-radius: 12px;
    padding: 2px;
    margin-bottom: 16px;
}
.toggle-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #8e8e93;
    font-weight: 600;
}
.toggle-btn.active {
    background: #3a3a3c;
    color: white;
}

/* Inventory Actions */
.action-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.action-btn {
    background: #1c1c1e;
    border: none;
    border-radius: 12px;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
    cursor: pointer;
}

.action-btn ion-icon {
    font-size: 24px;
    color: white;
}

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

/* Fix for content under header */
.content {
    padding-top: 10px;
}
