/* Diablo-style dark theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid #333;
}

header h1 {
    color: #ffd700;
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
}

header p {
    color: #ccc;
    font-size: 1.1rem;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box, .filter-select, .sort-btn {
    padding: 12px 16px;
    border: 1px solid #444;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box {
    min-width: 250px;
}

.search-box:focus, .filter-select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.sort-btn {
    background: linear-gradient(45deg, #8b4513, #a0522d);
    border: 1px solid #654321;
    cursor: pointer;
    font-weight: bold;
}

.sort-btn:hover {
    background: linear-gradient(45deg, #a0522d, #cd853f);
    transform: translateY(-2px);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Item Card Styles */
.item-card {
    background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 50%, #1f1f1f 100%);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffd700);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: #ffd700;
    z-index: 10;
}

.item-card:hover::before {
    opacity: 1;
}

.item-card.legendary {
    border-color: #ff6b35;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.3);
    background: linear-gradient(145deg, #2a1a1a 0%, #3a2a2a 50%, #2f1f1f 100%);
}

.item-card.legendary::before {
    background: linear-gradient(90deg, #ff6b35, #ff8c42, #ff6b35);
}

.item-card.epic {
    border-color: #a020f0;
    box-shadow: 0 0 15px rgba(160, 32, 240, 0.3);
    background: linear-gradient(145deg, #1a1a2a 0%, #2a2a3a 50%, #1f1f2f 100%);
}

.item-card.epic::before {
    background: linear-gradient(90deg, #a020f0, #c040ff, #a020f0);
}

.item-card.rare {
    border-color: #4169e1;
    box-shadow: 0 0 15px rgba(65, 105, 225, 0.3);
    background: linear-gradient(145deg, #1a1a2a 0%, #2a2a3a 50%, #1f1f2f 100%);
}

.item-card.rare::before {
    background: linear-gradient(90deg, #4169e1, #6495ed, #4169e1);
}

.item-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.item-type {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-level {
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin-left: auto;
}

.item-stats {
    margin-top: 15px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85rem;
    padding: 2px 0;
}

.stat-line.positive {
    color: #90ee90;
}

.stat-line.negative {
    color: #ff6b6b;
}

.stat-line.neutral {
    color: #ccc;
}

.stat-line.legendary {
    color: #ffd700;
    font-weight: bold;
}

.stat-line.epic {
    color: #a020f0;
    font-weight: bold;
}

.stat-line.rare {
    color: #4169e1;
    font-weight: bold;
}

.item-flags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.flag {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.item-description {
    margin-top: 15px;
    color: #aaa;
    font-style: italic;
    font-size: 0.8rem;
    line-height: 1.4;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #ccc;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 50px;
    color: #888;
    font-size: 1.2rem;
}

/* Color parsing effects */
.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.reverse {
    filter: invert(1);
    background-color: #000;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Color-coded text styles for ANSI color support */
.color-text {
    display: inline;
}

/* Ensure proper spacing for color-coded text */
.color-text span {
    display: inline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .search-box {
        min-width: 200px;
    }
    
    .item-grid {
        grid-template-columns: 1fr;
    }
    
    .item-card {
        padding: 15px;
    }
    
    .item-name {
        font-size: 1.1rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
} 