/* ========================================
   MARKETPLACE TAB STYLES
   Asset Cards, Grid/List Views, Search, Filters
   ======================================== */

/* View Controls */
.view-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 8px 0 8px;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-row {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: #24A1DE;
    box-shadow: 0 0 0 2px rgba(36, 161, 222, 0.1);
}

.search-input-wrapper .fa-search {
    color: #888;
    font-size: 14px;
    margin-right: 8px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    padding: 0;
}

.search-input::placeholder {
    color: #555;
}

.clear-search {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    font-size: 12px;
    transition: color 0.2s ease;
}

.clear-search:hover {
    color: #ffffff;
}

.search-options-btn {
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.search-options-btn:hover {
    background: #242424;
    border-color: #24A1DE;
    color: #24A1DE;
}

.search-options-btn.active {
    background: #24A1DE;
    border-color: #24A1DE;
    color: white;
}

/* Search Options Modal */
.search-options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.search-options-modal.show {
    display: flex;
}

.search-options-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #2a2a2a;
}

.search-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.search-options-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.close-search-options {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.close-search-options:hover {
    color: white;
}

.search-options-body {
    padding: 20px;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    color: #24A1DE;
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #444;
    position: relative;
    transition: all 0.3s ease;
}

/* Checkbox styling */
.filter-option input[type="checkbox"] + .checkmark {
    border-radius: 4px;
}

.filter-option input[type="checkbox"]:checked + .checkmark {
    background: #24A1DE;
    border-color: #24A1DE;
}

.filter-option input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Radio button styling */
.filter-option input[type="radio"] + .checkmark {
    border-radius: 50%;
}

.filter-option input[type="radio"]:checked + .checkmark {
    background: #1a1a1a;
    border-color: #24A1DE;
}

.filter-option input[type="radio"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #24A1DE;
}

/* Items per page styling */
.filter-option select {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 14px;
    margin-left: 10px;
    min-width: 80px;
    cursor: pointer;
}

.filter-option select:focus {
    outline: none;
    border-color: #24A1DE;
    box-shadow: 0 0 0 2px rgba(0, 102, 153, 0.2);
}

.filter-option select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 8px;
}

/* Specific styling for items per page option */
.items-per-page-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.items-per-page-option label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.items-per-page-option select {
    margin-left: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #ffffff;
    padding: 10px 16px;
    font-size: 14px;
    min-width: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.items-per-page-option select:hover {
    border-color: #24A1DE;
    background: #333;
}

.items-per-page-option select:focus {
    outline: none;
    border-color: #24A1DE;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: #333;
}

.filter-option i {
    width: 16px;
    text-align: center;
}

.search-options-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #2a2a2a;
}

.clear-filters-btn,
.apply-filters-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.clear-filters-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
}

.clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.apply-filters-btn {
    background: #24A1DE;
    color: white;
}

.apply-filters-btn:hover {
    background: #1C7DAD;
}

.display-mode {
    display: flex;
    gap: 4px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active,
.view-btn:hover {
    background: #24A1DE;
    color: white;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 14px;
}

.items-per-page label {
    color: #888;
}

.items-per-page select {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.items-per-page select:focus {
    outline: none;
    border-color: #24A1DE;
}

/* Assets Grid */
.assets-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 0;
    margin-bottom: 30px;
}

/* Grid View - 2 columns side by side */
.assets-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Adjust card height for grid view */
.assets-grid.grid-view .asset-card {
    height: 400px !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
}

/* Make grid cards more compact */
.assets-grid.grid-view .asset-card .telegram-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.assets-grid.grid-view .asset-card .asset-identifier {
    font-size: 10px;
    padding: 16px 24px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.assets-grid.grid-view .asset-card .asset-url {
    font-size: 11px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assets-grid.grid-view .asset-card .rental-info {
    font-size: 10px;
    padding: 14px 20px;
    margin-bottom: 8px;
}

.assets-grid.grid-view .asset-card .asset-details {
    margin-top: 12px;
}

.assets-grid.grid-view .asset-card .asset-category {
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assets-grid.grid-view .asset-card .asset-duration,
.assets-grid.grid-view .asset-card .asset-availability {
    font-size: 12px;
    margin-bottom: 6px;
}

.assets-grid.grid-view .asset-card .rent-btn {
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 13px;
    height: auto;
}

/* Grid view icon adjustments */
.assets-grid.grid-view .asset-card .telegram-logo {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.assets-grid.grid-view .asset-card .verified-badge {
    width: 16px;
    height: 16px;
    font-size: 10px;
}

.assets-grid.grid-view .asset-card .authenticity-badge {
    font-size: 11px;
    padding: 4px 8px;
}

.assets-grid.grid-view .asset-card .availability-dot {
    width: 6px;
    height: 6px;
}

/* List View - single column */
.assets-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Clean Telegram-style card layout */
.asset-card {
    background: #1e1e1e;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.telegram-card-header {
    background: transparent;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.header-price {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    background: #24A1DE;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.telegram-logo {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.telegram-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.asset-identifier {
    background: #24A1DE;
    color: white;
    padding: 16px 48px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    display: block;
}

.username-identifier {
    background: #24A1DE;
    color: white;
}

.number-identifier {
    background: #24A1DE;
    color: white;
}

.asset-url {
    color: #888;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    display: block;
}

.asset-details {
    border-top: none;
    padding-top: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.asset-details::before {
    display: none;
}

.asset-category {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.asset-name-large {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.asset-price-duration {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.asset-price {
    color: #0088cc;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.asset-duration {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.duration-label {
    color: #888;
    font-size: 14px;
}

.duration-value {
    color: #0088cc;
    font-size: 14px;
    font-weight: 600;
}

.asset-availability {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    white-space: nowrap;
}

.availability-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
}

.availability-text {
    color: #10b981;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.rental-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0;
    gap: 12px;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
}

.rental-duration {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 6px 12px;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rental-duration::before {
    content: "⏱";
    font-size: 14px;
}

.rental-separator {
    display: none;
}

.rental-price {
    background: #24A1DE;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    flex: 1;
    text-align: right;
}

.rent-btn {
    width: 100%;
    background: #24A1DE;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: auto;
}

.rent-btn:hover {
    background: #24A1DE;
}

.rent-btn:disabled {
    background: linear-gradient(135deg, #24A1DE, #1C7DAD);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Blue border for verified assets */
.asset-card.verified-asset {
    border: 1px solid #2a2a2a !important;
    box-shadow: none !important;
}

/* Styling for rented status */
.asset-availability .availability-text {
    color: #10b981; /* Green for available */
}

.asset-card:has(.rent-btn[disabled]) .availability-text {
    color: #ef4444 !important; /* Red for rented */
}

.asset-card:has(.rent-btn[disabled]) .availability-dot {
    background: #ef4444 !important; /* Red dot for rented */
}

/* Telegram-style Cards */
.telegram-style {
    padding: 0;
    overflow: hidden;
}

/* Edge-to-edge NFT images */
.asset-card.telegram-style > img {
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    width: 100%;
    border-radius: 12px 12px 0 0;
    object-fit: cover;
    aspect-ratio: 1;
}

/* Hide empty card header when image is at top */
.asset-card.telegram-style:has(> img) .telegram-card-header:empty {
    display: none;
    padding: 0;
    margin: 0;
    height: 0;
}

/* Ensure telegram-card-header with no content has no padding */
.telegram-card-header:empty {
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    display: none !important;
}

/* Remove top padding from card body when image is present */
.asset-card.telegram-style:has(> img) .telegram-card-body {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure assets grid cards work properly in Telegram */
.assets-grid .asset-card.telegram-style {
    padding: 0;
}

/* Ensure no padding on cards with images */
.asset-card.telegram-style.username-card,
.asset-card.telegram-style.number-card {
    padding: 0;
}

/* Asset Header and Type */
.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.asset-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.asset-type {
    background: #24A1DE;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.asset-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-text {
    font-size: 14px;
    color: #888;
}

/* End of Results Section */
.end-of-results {
    text-align: center;
    padding: 20px 20px 30px;
    margin-top: 10px;
}

.end-divider {
    width: 60px;
    height: 2px;
    background: #2a2a2a;
    margin: 0 auto 12px;
}

.end-text {
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}

.back-to-top-link {
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #888;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.back-to-top-link:hover {
    background: #1a1a1a;
    border-color: #24A1DE;
    color: #24A1DE;
}

.back-to-top-link i {
    font-size: 12px;
}

/* Owner Reputation System */
.owner-reputation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.rating {
    font-size: 12px;
    color: #888;
}

/* Subscription System Styling */
.subscription-benefits {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #3a3a3a;
}

.benefit-item {
    font-size: 12px;
    color: #10b981;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Fee Breakdown Styling */
.fee-breakdown {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #2a2a2a;
}

.fee-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.fee-info.total {
    border-top: 1px solid #3a3a3a;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 600;
}

.fee-label {
    color: #888;
}

.fee-value {
    color: #ffffff;
    font-weight: 500;
}

.fee-deduction {
    color: #ef4444;
}

.fee-info.total .fee-value {
    color: #10b981;
    font-size: 14px;
}

/* Blockchain Info Styling */
.blockchain-info {
    background: #1a1a2a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #2a2a3a;
    margin-bottom: 15px;
}

.blockchain-address {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #64b5f6;
    word-break: break-all;
}

.collection-address {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #a855f7;
    word-break: break-all;
}

