/* ============================================
   TRADING SYSTEM STYLES
   Arcane Ink Productions
============================================ */

/* Trade Board Button in HUD */
.trade-board-btn {
    padding: 8px 15px;
    background: linear-gradient(180deg, #2d1b4e, #1a0a2e);
    border: 1px solid #6b4c9a;
    border-radius: 6px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.trade-board-btn:hover {
    background: linear-gradient(180deg, #3d2b5e, #2a1a3e);
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Trade Panels */
#trade-panel,
#trade-board-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    max-width: 95vw;
    max-height: 85vh;
    background: linear-gradient(180deg, #1a0a2e 0%, #0d0d1a 100%);
    border: 2px solid #6b4c9a;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(107, 76, 154, 0.5);
    z-index: 1100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#trade-panel.active,
#trade-board-panel.active {
    display: flex;
}

/* Trade Header */
.trade-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, #2d1b4e, #1a0a2e);
    border-bottom: 1px solid #6b4c9a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trade-header h3 {
    color: #d4af37;
    margin: 0;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Trade Content */
#trade-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Trade Columns Layout */
.trade-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.trade-column {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4a3a6a;
    border-radius: 8px;
    padding: 15px;
}

.trade-column-title {
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #4a3a6a;
    padding-bottom: 10px;
}

/* Gold Input */
.trade-gold-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.trade-gold-input label {
    color: #ffd700;
}

.trade-gold-input input {
    width: 100px;
    padding: 5px 10px;
    background: #0d0d1a;
    border: 1px solid #6b4c9a;
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
}

.trade-gold-max {
    color: #888;
    font-size: 0.85rem;
}

/* Trade Items List */
.trade-items {
    min-height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed #4a3a6a;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
}

.trade-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(107, 76, 154, 0.2);
    border-radius: 4px;
    margin-bottom: 5px;
}

.trade-item-icon {
    font-size: 1.5rem;
}

.trade-item-name {
    color: #e0d0ff;
    flex: 1;
}

.trade-remove-btn {
    background: #8b0000;
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
}

.trade-remove-btn:hover {
    background: #a00;
}

.trade-empty {
    color: #666;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Trade Inventory Grid */
.trade-inventory-pick {
    margin-top: 10px;
}

.trade-section-subtitle {
    color: #9090c0;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.trade-inventory-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.trade-inv-slot {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #4a3a6a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.trade-inv-slot:hover:not(.empty):not(.selected) {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.trade-inv-slot.selected {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.trade-inv-slot.empty {
    cursor: default;
    opacity: 0.3;
}

/* Item Selector Dropdown */
.trade-item-selector {
    margin-top: 10px;
}

.trade-item-selector select {
    width: 100%;
    padding: 8px;
    background: #0d0d1a;
    border: 1px solid #6b4c9a;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
}

/* Trade Actions */
.trade-actions {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #4a3a6a;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.trade-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.trade-btn.post-btn {
    background: linear-gradient(180deg, #2a7a2a, #1a5a1a);
    color: #fff;
    border: 1px solid #3a9a3a;
}

.trade-btn.post-btn:hover {
    background: linear-gradient(180deg, #3a9a3a, #2a7a2a);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.trade-btn.accept-btn {
    background: linear-gradient(180deg, #d4af37, #a08020);
    color: #1a0a2e;
}

.trade-btn.accept-btn:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.trade-btn.cancel-btn {
    background: rgba(139, 0, 0, 0.8);
    color: #fff;
}

.trade-btn.cancel-btn:hover {
    background: rgba(170, 0, 0, 0.9);
}

/* Trade Board (List of Active Trades) */
#trade-list {
    padding: 15px;
    overflow-y: auto;
    max-height: 500px;
}

.trade-listing {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4a3a6a;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.trade-listing.my-trade {
    border-color: #d4af37;
}

.trade-listing-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(107, 76, 154, 0.2);
    border-bottom: 1px solid #4a3a6a;
}

.trade-from {
    color: #d4af37;
    font-weight: bold;
}

.trade-expires {
    color: #888;
    font-size: 0.85rem;
}

.trade-listing-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    padding: 15px;
    align-items: center;
}

.trade-side {
    color: #c0c0c0;
}

.trade-side strong {
    display: block;
    color: #9090c0;
    margin-bottom: 5px;
}

.trade-arrow {
    font-size: 1.5rem;
    color: #6b4c9a;
}

.trade-listing-actions {
    padding: 10px 15px;
    border-top: 1px solid #4a3a6a;
    text-align: center;
}

/* Responsive */
@media (max-width: 700px) {
    #trade-panel,
    #trade-board-panel {
        width: 95vw;
    }
    
    .trade-columns {
        grid-template-columns: 1fr;
    }
    
    .trade-listing-body {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .trade-arrow {
        transform: rotate(90deg);
    }
}

