/*
 * Riche Chain Marketplace Stylesheet
 * Theme: Dark & Gold
 */

/* --- CSS Variables (Theme) --- */
:root {
    --dark-bg: #121212;
    --card-bg: #1a1a1a;
    --gold-accent: #d4af37;
    --text-light: #f0f0f0;
    --text-muted: #888;
    --network-ok: #28a745;
    --network-wrong: #dc3545;
    --border-color: #333;
}

/* --- Global Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Buttons & Inputs --- */
.primary-btn {
    background-color: var(--gold-accent);
    color: #000;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.primary-btn:hover {
    opacity: 0.85;
}

.primary-btn:disabled,
.primary-btn.disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

.quantity-input {
    width: 70px;
    background: #333;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

/* --- Navbar --- */
.navbar {
    background-color: var(--card-bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

.navbar-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.network-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.network-ok {
    background-color: var(--network-ok);
    color: #fff;
}

.network-wrong {
    background-color: var(--network-wrong);
    color: #fff;
}

.wallet-address {
    font-family: monospace;
    background: #333;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* --- View Switching --- */
#marketplace-view {
    display: none; /* Hidden by default */
}

/* --- Landing Page (Hero) --- */
.hero-section {
    text-align: center;
    padding: 5rem 1rem;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-section h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* --- Marketplace Grid --- */
#nft-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
    gap: 1.5rem;
    padding: 3rem 0;
}

/* --- NFT Card --- */
.nft-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.nft-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-accent);
}

.nft-card-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #000;
}

.nft-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Makes card content fill height */
}

.nft-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.nft-card-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nft-card-detail strong {
    color: var(--text-light);
    font-weight: 600;
}

.benefits-list {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.benefits-list h4 {
    margin-bottom: 0.5rem;
    color: var(--gold-accent);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.benefits-list ul {
    list-style: none;
    font-size: 0.9rem;
}

.benefits-list li {
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.buy-action {
    margin-top: auto; /* Pushes this to the bottom */
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.buy-action .primary-btn {
    flex-grow: 1;
}

/* --- Modals (Loading/Notification) --- */
#loading-overlay,
#notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#loading-overlay.show,
#notification-modal.show {
    display: flex; /* Show class toggled by JS */
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--gold-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-message {
    color: #fff;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    border: 1px solid var(--gold-accent);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--gold-accent);
}

#notification-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    line-height: 1.7;
}

/* --- Responsive Design --- */

/* Tablet / Large Mobile (Per permintaan: 2 kolom) */
@media (max-width: 992px) {
    #nft-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }
}

/* Small Mobile (Saya tambahkan 1 kolom agar tidak rusak) */
@media (max-width: 576px) {
    #nft-grid-container {
        grid-template-columns: 1fr; /* 1 column on small phones */
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section .subtitle {
        font-size: 1rem;
    }
    
    .navbar-status {
        gap: 0.5rem;
    }

    .wallet-address {
        display: none; /* Hide full address on small screens */
    }
}