/* Armory Page Styles */

.armory-container {
    display: grid;
    grid-template-columns: 200px 1fr 320px;
    gap: 1rem;
    min-height: calc(100vh - 80px);
    padding: 1rem;
    padding-top: 80px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Left sidebar - Faction selection */
.faction-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.faction-sidebar h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.faction-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-align: left;
}

.faction-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--faction-color, var(--accent-cyan));
}

.faction-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--faction-color, var(--accent-cyan));
    box-shadow: 0 0 10px rgba(var(--faction-color, var(--accent-cyan)), 0.2);
}

.faction-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.faction-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    color: #000;
}

.faction-name {
    flex: 1;
    font-size: 0.9rem;
}

.item-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main content - Vendor items */
.vendor-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
}

.vendor-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.vendor-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.vendor-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.placeholder-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
}

.item-category {
    margin-bottom: 2rem;
}

.category-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent-cyan);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.vendor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.vendor-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.vendor-item.selected {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

/* Rarity borders */
.vendor-item.rarity-common { border-left: 3px solid #9e9e9e; }
.vendor-item.rarity-uncommon { border-left: 3px solid #4caf50; }
.vendor-item.rarity-rare { border-left: 3px solid #2196f3; }
.vendor-item.rarity-epic { border-left: 3px solid #9c27b0; }
.vendor-item.rarity-legendary { border-left: 3px solid #ffd700; }
.vendor-item.rarity-exotic { border-left: 3px solid #f44336; }

.item-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-cost {
    display: block;
    color: var(--accent-green);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Right sidebar - Item details */
.item-detail-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.detail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    text-align: center;
}

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

.detail-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.detail-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 0.5rem;
}

.detail-title h3 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.detail-type {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: capitalize;
}

.detail-price {
    background: rgba(0, 255, 136, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.price-credits {
    color: var(--accent-green);
    font-size: 1.2rem;
    font-weight: 600;
}

.barter-costs, .item-stats, .detail-perk, .detail-requirement {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.barter-costs h4, .item-stats h4, .detail-perk h4, .detail-requirement h4 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.barter-costs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.barter-costs li {
    padding: 0.25rem 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.barter-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: var(--text-muted);
}

.stat-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.detail-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.perk-name {
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.perk-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.detail-requirement p {
    color: var(--accent-orange);
}

/* Rarity text colors */
.rarity-text-common { color: #9e9e9e; }
.rarity-text-uncommon { color: #4caf50; }
.rarity-text-rare { color: #2196f3; }
.rarity-text-epic { color: #9c27b0; }
.rarity-text-legendary { color: #ffd700; }
.rarity-text-exotic { color: #f44336; }

/* Tier labels */
.item-tier, .detail-tier {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.tier-common { background: #4a4a4a; color: #ccc; }
.tier-uncommon { background: #1b5e20; color: #81c784; }
.tier-rare { background: #0d47a1; color: #64b5f6; }
.tier-epic { background: #4a148c; color: #ba68c8; }
.tier-legendary { background: #5c4d00; color: #ffd700; }

.item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-tier {
    margin-top: 4px;
}

/* Vendor controls - search, sort, filter */
.vendor-header-top {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vendor-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 180px;
}

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

.sort-select, .filter-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

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

.item-count-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .armory-container {
        grid-template-columns: 180px 1fr 280px;
    }
}

@media (max-width: 900px) {
    .armory-container {
        grid-template-columns: 1fr;
    }

    .faction-sidebar {
        position: static;
    }

    .faction-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .faction-btn {
        flex: 1;
        min-width: 120px;
    }

    .item-detail-sidebar {
        position: static;
        max-height: none;
    }

    .vendor-header-top {
        flex-direction: column;
    }

    .vendor-controls {
        width: 100%;
    }

    .search-input {
        flex: 1;
        min-width: 150px;
    }

    .sort-select, .filter-select {
        flex: 1;
    }
}
