/* RESET & GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background: #050E15;
    font-family: 'Inter', 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

.view {
    width: 100%;
    min-height: 844px;
    position: relative;
    background: linear-gradient(180deg, #050E15 0%, #050E15 100%);
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    padding-bottom: 80px;
}
.view.active { display: block; }

/* MARKETPLACE BACKGROUND */
.background-gradient {
    width: 590px;
    height: 606px;
    left: -100px;
    top: -335px;
    position: absolute;
    background: linear-gradient(180deg, rgba(0, 91.18, 191.25, 0.46) 0%, rgba(1.65, 41.78, 85.82, 0.32) 100%);
    filter: blur(100px);
    pointer-events: none;
}

/* TOP BAR */
.top-bar {
    padding: 32px 24px 0;
    display: flex;
    align-items: center;
    gap: 13px;
}
.avatar {
    width: 46px;
    height: 46px;
    border-radius: 9999px;
    background: #D9D9D9;
    cursor: pointer;
}
.balance-badge {
    background: rgba(0, 157.25, 255, 0.10);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 10px 12px;
    color: white;
    font-weight: 700;
    font-size: 12px;
}
.wallet-badge {
    background: #0067D6;
    border-radius: 24px;
    padding: 10px 12px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
    cursor: pointer;
}

/* FILTER ROW */
.filter-row {
    display: flex;
    gap: 10px;
    padding: 0 24px;
    margin-top: 15px;
}
.filter-icon {
    width: 39px;
    height: 54px;
    background: rgba(33.97, 50.03, 62.52, 0.40);
    border-radius: 20px;
    backdrop-filter: blur(20px);
}
.filter-chip {
    width: 100%;
    height: 54px;
    background: rgba(33.97, 50.03, 62.52, 0.40);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    padding: 10px 14px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.filter-chip span {
    font-size: 14px;
    font-weight: 700;
    margin-top: 4px;
    display: block;
}

.search-bar {
    width: 342px;
    margin: 16px auto 0;
    background: rgba(33.97, 50.03, 62.52, 0.40);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    padding: 17px 20px;
    color: white;
    font-weight: 600;
}

/* PRODUCTS GRID */
.nft-collection {
    margin: 8px 8px 0;
    color: white;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-name {
    margin: 2px 8px 0;
    font-family: 'Gilroy';
    font-style: normal;
    font-weight: 600;
    font-size: 11px;
    line-height: 13px;
    leading-trim: both;
    text-edge: cap;
    display: flex;
    align-items: center;

    /* white */
    color: #555;


}
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 8px 0;
}
.price {
    background: none;
    text-align: center;
    border-radius: 20px;
    padding: 4px 9px;
    color: white;
    font-size: 10px;
    font-weight: 700;
}
.buy-button {
    /* цена */

    /* Auto layout */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 4px 9px;
    gap: 5px;

    position: absolute;
    left: 7.41%;
    right: 7.41%;
    top: 81.4%;
    bottom: 4.65%;

    /* Button Blue */
    background: #007BFF;
    border-radius: 20px;
    border: none;
    color: white;
    font-weight: 500;
}
.buy-button i {
    margin-right: 4px;
}

/* ---------- PROFILE PAGE ---------- */
#profile-view {
    background: linear-gradient(180deg, #050E15 0%, #050E15 100%);
    position: relative;
    overflow-x: hidden;
}
.profile-bg-blur {
    position: absolute;
    width: 401px;
    height: 90px;
    left: 18px;
    top: 392px;
    background: rgba(159.38, 205.40, 255, 0.20);
    filter: blur(25px);
    border-radius: 9999px;
    pointer-events: none;
    z-index: 0;
}
.profile-bg-blur2 {
    position: absolute;
    width: 273px;
    height: 128px;
    left: 86px;
    top: 376px;
    background: rgba(0, 122.73, 255, 0.50);
    filter: blur(100px);
    border-radius: 9999px;
    pointer-events: none;
    z-index: 0;
}
.profile-header-bg {
    height: 200px;
    background: linear-gradient(149deg, #121A20 0%, #27313A 100%);
    border-radius: 0 0 24px 24px;
    position: relative;
    z-index: 1;
}
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
}
.profile-avatar-section {
    text-align: center;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}
.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 9999px;
    border: 3px solid #007BFF;
    background: #D9D9D9;
}
.profile-name {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-top: 8px;
}
.profile-userid {
    color: #495868;
    font-size: 14px;
}
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 24px;
    position: relative;
    z-index: 2;
}
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 12px 24px;
    text-align: center;
    min-width: 120px;
    backdrop-filter: blur(10px);
}
.stat-label {
    color: #495868;
    font-size: 12px;
    font-weight: 600;
}
.stat-value {
    color: white;
    font-size: 18px;
    font-weight: 700;
}

/* BALANCE PANEL */
.balance-panel {
    background: linear-gradient(149deg, #121A20 0%, #27313A 100%);
    border-radius: 20px;
    margin: 16px 24px;
    padding: 16px;
    border: 1px solid #333D45;
    text-align: center;
    position: relative;
    z-index: 2;
}
.balance-panel-title {
    color: #495868;
    font-size: 14px;
    font-weight: 600;
}
.balance-panel-amount {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
}
.balance-panel-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.balance-panel-buttons button {
    flex: 1;
    padding: 10px;
}

.stats-mini {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin: 16px 24px;
    padding: 12px;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}
.mini-stat {
    text-align: center;
}
.mini-value {
    color: white;
    font-size: 20px;
    font-weight: 700;
}
.mini-label {
    color: #495868;
    font-size: 10px;
}

.wallet-row {
    background: #007BFF;
    border-radius: 24px;
    margin: 16px 24px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
    position: relative;
    z-index: 2;
}
.copy-wallet-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}
.inventory-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 24px 24px 8px;
    position: relative;
    z-index: 2;
}

.tab-content {
    display: none;
    padding: 0 0px;
    position: relative;
    z-index: 2;
}
.tab-content.active {
    display: block;
}

/* ACTION BUTTONS */
.action-btn {
    background: #303E4A;
    border: none;
    border-radius: 20px;
    padding: 12px 16px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}
.action-btn.primary {
    background: #007AFF;
}
.action-btn:hover {
    opacity: 0.9;
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: #111A21;
    border-radius: 30px;
    width: 342px;
    padding: 20px;
    color: white;
}
.modal-three-quarters {
    width: 90%;
    max-width: 400px;
}
.modal-animation {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}
.rounded-animation {
    border-radius: 20px;
    overflow: hidden;
}
.modal-details {
    margin-top: 16px;
}
.centered-table {
    text-align: left;
}
.modal-attributes-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.attr-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #303E4A;
    padding: 6px 0;
}
.attr-label {
    color: #445768;
    font-weight: 600;
}
.attr-value {
    color: white;
    font-weight: 600;
}
.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-buttons-nft {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    display: flex;
    gap: 0;
    padding: 0;
    justify-content: center;   
}
.modal-buttons-nft button {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
}

.modal-buttons button {
    flex: 1;
}
.filter-list {
    max-height: 300px;
    overflow-y: auto;
}
.filter-item {
    padding: 12px;
    border-bottom: 1px solid #303E4A;
    cursor: pointer;
}
.filter-item.selected {
    background: #007AFF20;
}
.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.close-modal, .close-filter, .close-offer-modal, .close-sheet {
    float: right;
    font-size: 28px;
    cursor: pointer;
    background: none;
    color: white;
    border: none;
}
.bottom-sheet {
    align-items: flex-end;
}
.bottom-sheet-content {
    background: #111A21;
    border-radius: 30px 30px 0 0;
    width: 100%;
    max-height: 80%;
    overflow-y: auto;
    padding: 20px;
}
.sheet-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.input-group {
    margin-bottom: 16px;
}
.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #aaa;
}
input, select {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #303E4A;
    background: #1D252C;
    color: white;
}
hr {
    margin: 16px 0;
    border-color: #303E4A;
}
#nft-modal-content {
    margin: 0;
    position: fixed;
    top: 10vh;
    left: 0;
    right: 0;
    padding-bottom: 0;
    width: 100%;
    height: 85vh;
    border-radius: 10px 10px 0 0;
    background: rgba(17, 26, 33, 0.5);
    backdrop-filter: blur(20px);
}

/* Full-width tabs bar: no gaps, flush edges */
.profile-tabs {
    display: flex;
    flex-wrap: nowrap;          /* one line */
    gap: 0;                     /* no space between buttons */
    margin: 0 0 16px 0;         /* remove side margins, keep bottom margin */
    width: 100%;
    background: transparent;
}

/* Square, compact buttons with equal width */
.tab-btn {
    flex: 1 1 0;                /* equal share of free space */
    text-align: center;
    background: #1D252C;
    padding: 3px 0;             /* (text height + 5px) total – line-height:1 + 3px padding top/bottom */
    border: none;
    border-radius: 0;           /* square corners */
    border-right: 1px solid #2a3a44;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;             /* text height = font-size */
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Remove right border from last button */
.tab-btn:last-child {
    border-right: none;
}

/* Active tab: wider by ~6.5%, accent color */
.tab-btn.active {
    background: #007BFF;
    flex: 1.1 1 0;              /* ~6.5% larger than equal share */
}

/* Hover feedback (optional) */
.tab-btn:hover {
    filter: brightness(1.05);
}

/* Guarantee 3 items per row on any screen width */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* exactly 3 equal columns */
    gap: 4px;
    padding: 8px;
    justify-items: center;   /* center cards within cells (optional) */
}

/* Make product card fill its grid cell, remove fixed width */
.product-card {
    width: 100%;             /* fill the grid cell */
    max-width: 100%;
    background: linear-gradient(105.45deg, rgba(45, 67, 85, 0.3) 11.29%, rgba(68, 92, 110, 0.3) 90.31%);
    backdrop-filter: blur(13.1286px);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
    padding-bottom: 52px;
    display: flex;
    flex-direction: column;
    /* Ensure consistent internal spacing */
    box-sizing: border-box;
}

/* Adjust NFT image to be responsive within the card */
.nft-image {
    width: calc(100% - 16px);   /* take full width minus margins */
    aspect-ratio: 1 / 1;        /* keep square shape */
    margin: 8px auto 0;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
}

/* Optional: fine-tune text and button sizes for narrow screens */
@media (max-width: 480px) {
    .product-name, .nft-collection {
        font-size: 10px;
    }
    .buy-button {
        padding: 2px 6px;
        font-size: 9px;
    }
}
