.items-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.stats-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #5a67d8;
    border-radius: 8px;
    color: white;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.controls-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-box select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    background: white;
}

/* 기본: 필터가 넓게 보이도록 설정 */
.filter-box select {
    min-width: 360px;
}

/* 스킨 선택 시 필터가 쪼개진 레이아웃 */
.controls-section.split-filters .filter-box select {
    min-width: 180px;
}

#jobFilterBox select {
    min-width: 180px;
}

.save-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-save {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.btn-save:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.change-count {
    background: #ff5722;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-status {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.save-status.success {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.save-status.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.save-status.saving {
    color: #2196f3;
    background: rgba(33, 150, 243, 0.1);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 15px;
}

.item-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    position: relative;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.item-card.owned {
    border-color: #4caf50;
    background: #f0f9f0;
}

.item-card.owned::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.item-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
    transition: opacity 0.3s ease;
}

.item-image.lazy-loading {
    opacity: 0.3;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.item-image:not(.lazy-loading) {
    opacity: 1;
}

.item-card.no-image {
    position: relative;
}

.item-card.no-image::before {
    content: '🖼️';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    opacity: 0.3;
}

.item-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    word-break: keep-all;
    line-height: 1.2;
}

.item-category {
    font-size: 10px;
    color: #888;
    margin-top: 4px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Job Filter */
#jobFilterBox {
    display: none;
}

#jobFilterBox select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    background: white;
}

/* Stats Summary */
.stats-summary {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #5a67d8;
    margin-bottom: 5px;
}

.stat-item .stat-label {
    font-size: 13px;
    color: #666;
}

/* Responsive */
@media (max-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 900px) {
    .items-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 600px) {
    .items-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .item-card {
        padding: 8px;
    }
    
    .item-image {
        height: 60px;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Dark Mode */
body.dark-mode .stats-section,
body.dark-mode .item-card {
    background: rgba(30, 30, 30, 0.95);
    color: #e0e0e0;
}

body.dark-mode .stats-summary {
    background: rgba(30, 30, 30, 0.95);
}

body.dark-mode .item-card.owned {
    background: #1a2e1a;
}

body.dark-mode .search-box input,
body.dark-mode .filter-box select,
body.dark-mode #jobFilterBox select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .item-name {
    color: #e0e0e0;
}

body.dark-mode .item-card {
    border-color: #444;
}

body.dark-mode .item-card.owned {
    border-color: #4caf50;
}

body.dark-mode .stat-box {
    background: #4a5568;
}

body.dark-mode .stat-item .stat-value {
    color: #8b9cff;
}

body.dark-mode .stat-item .stat-label {
    color: #a0a0a0;
}
