* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    min-height: 100vh;
    color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    padding: 1rem 0;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.heart-icon {
    width: 2rem;
    height: 2rem;
    color: #ef4444;
}

.title-section h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.filters-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-container {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
}

.filter-select,
.sort-select {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    min-width: 120px;
}

.filter-select:focus,
.sort-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Main Content */
.main-content {
    padding: 1.5rem 0;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.total-price {
    color: #10b981;
}

.deficit-price {
    color: red;
}

.price-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.price-change .icon {
    width: 0.75rem;
    height: 0.75rem;
}

.price-up {
    color: #10b981;
}

.price-down {
    color: #ef4444;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.item-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid #475569;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.item-image-container {
    position: relative;
    overflow: hidden;
}

.item-image {
    width: 100%;
    height: 192px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.rarity-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.rarity-common { background-color: #6b7280; }
.rarity-uncommon { background-color: #10b981; }
.rarity-rare { background-color: #3b82f6; }
.rarity-mythical { background-color: #8b5cf6; }
.rarity-legendary { background-color: #ec4899; }
.rarity-ancient { background-color: #ef4444; }
.rarity-immortal { background-color: #eab308; }

.action-buttons {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.favorite-btn,
.remove-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.favorite-btn.active {
    color: #ef4444;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.remove-btn {
    background: rgba(239, 68, 68, 0.8);
    color: white;
}

.remove-btn:hover {
    background: #ef4444;
}

.favorite-btn svg,
.remove-btn svg {
    width: 1rem;
    height: 1rem;
}

.item-content {
    padding: 1rem;
}

.item-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-game {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.item-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #10b981;
}

.item-footer {
    padding: 1rem;
    padding-top: 0;
}

.market-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #64748b;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.market-btn:hover {
    background: #475569;
    border-color: #64748b;
}

.market-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .title-section h1 {
        font-size: 1.25rem;
    }
    
    .filters-section {
        gap: 0.5rem;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-select,
    .sort-select {
        min-width: auto;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .item-image {
        height: 160px;
    }
    
    .item-price {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.75rem 0;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .stats-section {
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .item-content {
        padding: 0.75rem;
    }
    
    .item-footer {
        padding: 0.75rem;
        padding-top: 0;
    }
}
