/* market.css - NOIR GLITCH EDITION (Optimized) */

/* =========================================
   1. BASE & LAYOUT
   ========================================= */
.market-bg {
    background-color: #000000;
    background-image: radial-gradient(circle at center, #111 0%, #000 100%);
}

.market-area {
    padding: 80px 15px 90px 15px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.section-desc {
    text-align: center;
    color: #666;
    font-size: 11px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: monospace;
}

/* =========================================
   2. TABS (TERMINAL NAVIGATION)
   ========================================= */
.tabs-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 0px;
    padding: 5px;
}

.market-tab {
    flex: 1;
    background: transparent;
    color: #444;
    border: none;
    padding: 10px 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.market-tab.active {
    background: #fff;
    color: #000;
    text-shadow: none;
}

/* =========================================
   3. STORE (GRIGLIA OGGETTI IN VENDITA)
   ========================================= */
.market-category {
    margin-top: 25px;
    margin-bottom: 35px;
}

.category-title {
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #222;
    padding-bottom: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.category-title::before {
    content: "";
    width: 4px;
    height: 14px;
    background: #fff;
    margin-right: 10px;
    display: inline-block;
}

.market-list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.market-item-card {
    background: #000;
    border: 2px solid #fff;
    padding: 20px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 260px;
    box-sizing: border-box;
    transition: transform 0.1s, box-shadow 0.2s;
    position: relative;
    cursor: pointer;
}

.market-item-card:active {
    border-color: #fff;
    background: #000;
    transform: scale(0.98);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: grayscale(1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.item-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    width: 100%;
    text-align: center;
}

.item-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 160px;
    margin-top: auto;
}

/* =========================================
   4. STASH (INVENTARIO UTENTE)
   ========================================= */
.market-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-card {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #222;
    border-left: 4px solid #fff;
    border-radius: 0px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 4px 4px 0px #000;
}

.item-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    object-fit: contain; 
    padding: 3px; 
    filter: grayscale(1) brightness(1.2);
    border: 1px solid #444;
    background: #000;
}

.item-info {
    flex: 1;
    padding-right: 10px;
    text-align: left;
}

.item-info .item-name {
    font-size: 13px;
    margin-bottom: 3px;
    text-align: left;
}

.item-type {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
    font-family: monospace;
}

.item-desc {
    font-size: 9px;
    color: #666;
    margin-top: 4px;
    line-height: 1.3;
    font-family: monospace;
    text-transform: lowercase;
}

.item-qty {
    font-size: 11px;
    color: #555;
    font-family: monospace;
    margin-top: 5px;
    font-weight: bold;
}

/* =========================================
   5. HISTORY (AUDIT LOG / STORICO)
   ========================================= */
.history-log-card {
    background: #050505;
    border: 1px solid #222;
    border-left: 3px solid #444;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.8);
}

.history-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #222;
    padding-bottom: 4px;
}

.log-action {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
}

.log-date {
    color: #666;
    font-size: 9px;
    font-family: monospace;
}

.history-log-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 11px;
}

.log-item-name {
    color: #fff;
    text-transform: uppercase;
}

.log-cost {
    color: #888;
}

/* =========================================
   6. BOTTONI & CONTROLLI
   ========================================= */
.btn-market {
    width: 100%;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 900;
    padding: 12px 0;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0px;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.btn-market:active {
    background: #fff;
    color: #000;
}

.btn-stars {
    border-width: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.btn-info-action {
    border-color: #444;
    color: #888;
}

.btn-info-action:active {
    background: #888;
    color: #000;
    border-color: #888;
}

.btn-use {
    background: #fff;
    border: 1px solid #fff;
    color: #000;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 900;
    padding: 8px 12px;
    border-radius: 0px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
}

.btn-use:active {
    background: #888;
    border-color: #888;
}

.btn-disabled {
    opacity: 0.15;
    pointer-events: none;
    filter: grayscale(1);
}