/* NFT Marketplace Specific Styles */

/* Marketplace Section */
.marketplace-section {
    padding: 6rem 0 3rem;
    background: var(--bg-dark);
    min-height: 100vh;
}

/* Value Banner */
.value-banner {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(10, 10, 15, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.value-banner h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.value-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto 1.5rem;
}

.benefits {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.benefit-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
}

/* Header Controls */
.marketplace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    max-width: 500px;
}

.search-bar input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
    padding: 0.7rem 1.4rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.7rem 1.4rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: border-color 0.3s, color 0.3s;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-text {
    padding: 0.5rem 1rem;
    background: none;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.btn-text:hover {
    color: var(--primary-color);
}

.btn-mint {
    font-size: 1rem;
}

.btn-small {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select {
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== NFT GRID ===== */
.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* NFT Card */
.nft-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.nft-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.3);
}

.nft-card-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
    background: var(--bg-darker);
}

.nft-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.nft-card:hover .nft-card-image img {
    transform: scale(1.05);
}

.nft-card-image .image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    font-size: 3rem;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-darker));
}

/* Badges on image */
.nft-badge {
    position: absolute;
    top: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nft-badge-status {
    right: 0.75rem;
}

.nft-badge-category {
    left: 0.75rem;
    background: rgba(10, 10, 15, 0.8);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-listed {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.badge-tokenized {
    background: rgba(52, 152, 219, 0.9);
    color: white;
}

.badge-raw {
    background: rgba(149, 165, 166, 0.7);
    color: white;
}

/* Card Body */
.nft-card-body {
    padding: 1rem 1.2rem 1.2rem;
}

.nft-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nft-card-collection {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.nft-card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nft-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.nft-card-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.nft-card-price .price-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
}

.nft-card-creator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}

.nft-card-creator .creator-label {
    display: block;
    font-size: 0.65rem;
    opacity: 0.7;
}

/* ===== NFT DETAIL VIEW ===== */
.nft-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nft-detail-image {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-darker);
    max-height: 500px;
}

.nft-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nft-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nft-detail-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.nft-detail-collection {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
}

.nft-detail-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.nft-detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.meta-item {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.meta-item .meta-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.meta-item .meta-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
}

.nft-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Market Orders Section in Detail */
.market-orders-section {
    margin-top: 1.5rem;
}

.market-orders-section h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.order-item .order-price {
    color: var(--primary-color);
    font-weight: 700;
}

.order-item .order-amount {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 550px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 750px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-right: 2rem;
}

/* Blockchain info box */
.blockchain-info {
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.blockchain-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0.4rem 0;
}

.blockchain-info strong {
    color: var(--primary-color);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(176, 176, 200, 0.4);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    opacity: 0.8;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Image Preview */
.image-preview {
    margin: 1rem 0;
    text-align: center;
}

.image-preview h4 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: contain;
}

/* Buy Details */
.buy-details {
    margin-bottom: 1.5rem;
}

.buy-details .buy-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.buy-details .buy-summary .meta-item {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

/* Loading & Empty States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Info Modal Steps */
.info-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1rem;
}

.step-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.step-cost {
    font-size: 0.8rem !important;
    color: var(--primary-color) !important;
    font-style: italic;
}

.step-content code {
    background: var(--bg-darker);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Notification Container */
.notification-container {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notification.success {
    border-left: 3px solid #2ecc71;
}

.notification.error {
    border-left: 3px solid #e74c3c;
}

.notification.info {
    border-left: 3px solid #3498db;
}

.notification .notif-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification .notif-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .marketplace-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        max-width: 100%;
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-actions button {
        flex: 1;
    }

    .nft-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .nft-detail {
        grid-template-columns: 1fr;
    }

    .nft-detail-image {
        max-height: 300px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar select {
        width: 100%;
    }

    .nft-detail-meta {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.25rem;
        margin: 0.5rem;
    }
}

@media (max-width: 480px) {
    .nft-grid {
        grid-template-columns: 1fr;
    }

    .benefits {
        flex-direction: column;
        align-items: center;
    }

    .value-banner {
        padding: 1.5rem;
    }
}
