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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px 80px;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.header-subtitle {
    font-size: 14px;
    color: #888;
    font-weight: 400;
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-group {
    position: relative;
}

.filter-full {
    grid-column: 1 / -1;
}

.filter-select {
    width: 100%;
    padding: 14px 16px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    text-align: center;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.filter-select:focus {
    outline: none;
    background-color: #252525;
}

/* Custom Select for Collections */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 14px 16px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.custom-select-trigger:hover {
    background-color: #252525;
}

.custom-select-trigger.active {
    background-color: #252525;
}

.custom-select-text {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #2a2a2a;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background-color: #252525;
}

.custom-select-option.selected {
    background-color: #2a2a2a;
}

.custom-select-option-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #2a2a2a;
}

.custom-select-option-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar styling for options */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 12px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 12px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Custom Multi-Select for Filters */
.custom-multiselect {
    position: relative;
    width: 100%;
}

.custom-multiselect-trigger {
    width: 100%;
    padding: 14px 16px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.custom-multiselect-trigger:hover {
    background-color: #252525;
}

.custom-multiselect-trigger.active {
    background-color: #252525;
}

.custom-multiselect-text {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-multiselect-count {
    background-color: #0098EA;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.custom-multiselect.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-multiselect-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.custom-multiselect.open .custom-multiselect-options {
    display: block;
}

.custom-multiselect-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #2a2a2a;
    position: relative;
}

.custom-multiselect-option:last-child {
    border-bottom: none;
}

.custom-multiselect-option:hover {
    background-color: #252525;
}

.custom-multiselect-option.selected {
    background-color: #2a2a2a;
}

.custom-multiselect-option.selected::before {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #0098EA;
    font-weight: bold;
    font-size: 16px;
}

.custom-multiselect-option-image {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #fff;
}

.custom-multiselect-option-color {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.custom-multiselect-option-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 24px;
}

/* Scrollbar styling for multiselect options */
.custom-multiselect-options::-webkit-scrollbar {
    width: 6px;
}

.custom-multiselect-options::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 12px;
}

.custom-multiselect-options::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 12px;
}

.custom-multiselect-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Reset filters button */
.reset-filters-btn {
    width: 100%;
    padding: 12px;
    background-color: #ff3b30;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.2s ease;
}

.reset-filters-btn:hover {
    background-color: #ff2d20;
}

.reset-filters-btn:active {
    transform: scale(0.98);
}

/* NFT Grid */
.nft-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* Responsive grid */
@media (min-width: 768px) {
    .nft-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .nft-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .nft-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* NFT Card */
.nft-card {
    background-color: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.nft-card:hover {
    text-decoration: none;
}

.nft-card:active {
    transform: scale(0.97);
}

.nft-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #2a2a2a;
}

.nft-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nft-id {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #000;
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.nft-duration {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: #fff;
    color: #000;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.nft-info {
    padding: 12px;
}

.nft-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nft-price-button {
    width: 100%;
    background-color: #fff;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nft-price-button:active {
    background-color: #e8e8e8;
}

.ton-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.price-ton {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-rub {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* Loading spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading.hidden {
    display: none;
}

/* End message */
.end-message {
    text-align: center;
    padding: 40px 0;
    color: #888;
    font-size: 14px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

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

.empty-state-text {
    font-size: 16px;
}
