/* 인벤토리 화면 스타일 */
.inventory-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.inventory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.inventory-title {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.inventory-actions {
    display: flex;
    gap: 8px;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.action-icon {
    font-size: 18px;
}

/* 통계 섹션 */
.stats-section {
    padding: 20px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon {
    font-size: 24px;
    min-width: 32px;
    text-align: center;
}

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

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

/* 탭 네비게이션 */
.tab-navigation {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin: 0 20px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-weight: 600;
}

.tab-icon {
    font-size: 20px;
}

.tab-label {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
}

/* 필터 및 정렬 */
.filter-sort-section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 검색 섹션 */
.search-section {
    margin-bottom: 16px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    padding-right: 40px;
    color: var(--white);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clear-icon {
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.filter-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
}

.filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    color: var(--white);
    font-size: 14px;
    cursor: pointer;
}

.filter-select option {
    background: var(--dark-color);
    color: var(--white);
}

/* 아이템 섹션 */
.items-section {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px; /* 선택 바 공간 확보 */
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

/* 아이템 카드 */
.item-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.item-card.selected {
    border-color: var(--primary-gradient-end);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.item-card-inner {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
    position: relative;
}

.item-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-gradient-end);
}

.item-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.item-icon-container {
    position: relative;
    min-width: 60px;
}

.item-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: relative;
    overflow: hidden;
}

.item-icon.grade-1 {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 107, 107, 0.1));
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.item-icon.grade-2 {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2), rgba(255, 217, 61, 0.1));
    border: 2px solid rgba(255, 217, 61, 0.3);
}

.item-icon.grade-3 {
    background: linear-gradient(135deg, rgba(107, 207, 127, 0.2), rgba(107, 207, 127, 0.1));
    border: 2px solid rgba(107, 207, 127, 0.3);
}

.item-icon.grade-4 {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(78, 205, 196, 0.1));
    border: 2px solid rgba(78, 205, 196, 0.3);
}

.item-icon.grade-5 {
    background: linear-gradient(135deg, rgba(149, 165, 166, 0.2), rgba(149, 165, 166, 0.1));
    border: 2px solid rgba(149, 165, 166, 0.3);
}

.item-grade-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    font-size: 8px;
    font-weight: 700;
    color: var(--white);
    padding: 2px 6px;
    border-radius: 6px 0 var(--border-radius) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-gradient-end);
    margin-bottom: 8px;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.item-date {
    color: #999;
}

.item-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.item-status.status-shipped {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.item-status.status-breakdown {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-action-btn {
    width: 36px;
    height: 36px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.item-action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.item-action-btn:active {
    transform: scale(0.95);
}

/* 희귀 아이템 특별 효과 */
.rare-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.1) 0%, 
        rgba(255, 215, 0, 0.05) 50%, 
        rgba(255, 215, 0, 0.1) 100%);
    pointer-events: none;
    animation: rare-shimmer 3s ease-in-out infinite;
}

@keyframes rare-shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* 빈 상태 */
.empty-state,
.no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
    min-height: 300px;
}

.empty-icon,
.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-title,
.no-results-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--white);
}

.empty-subtitle,
.no-results-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
    opacity: 0.8;
    line-height: 1.4;
}

.no-results-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.no-results-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.no-results-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.empty-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.empty-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 선택 액션 바 */
.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.selection-info {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
}

.selected-count {
    color: var(--primary-gradient-end);
    font-size: 18px;
}

.selection-actions {
    display: flex;
    gap: 8px;
}

.selection-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-btn.btn-primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: var(--white);
}

.selection-btn.btn-secondary {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: var(--white);
}

.selection-btn.btn-cancel {
    background: #6c757d;
    color: var(--white);
}

.selection-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.selection-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-size: 13px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .inventory-header {
        padding: 16px;
    }
    
    .inventory-title {
        font-size: 18px;
    }
    
    .stats-section {
        padding: 16px;
    }
    
    .stats-cards {
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 8px;
    }
    
    .stat-icon {
        font-size: 20px;
        min-width: 24px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .tab-navigation {
        margin: 0 16px;
    }
    
    .tab-btn {
        padding: 12px 4px;
        gap: 2px;
    }
    
    .tab-icon {
        font-size: 18px;
    }
    
    .tab-label {
        font-size: 10px;
    }
    
    .filter-sort-section {
        padding: 16px;
    }
    
    .search-input {
        font-size: 16px; /* 모바일 줌 방지 */
        padding: 10px 14px;
        padding-right: 36px;
    }
    
    .search-clear-btn {
        right: 6px;
        width: 22px;
        height: 22px;
    }
    
    .clear-icon {
        font-size: 14px;
    }
    
    .filter-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .items-section {
        padding: 16px;
        padding-bottom: 100px;
    }
    
    .items-container {
        gap: 8px;
    }
    
    .item-card-inner {
        padding: 12px;
        gap: 12px;
    }
    
    .item-main {
        gap: 12px;
    }
    
    .item-icon-container {
        min-width: 50px;
    }
    
    .item-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .item-name {
        font-size: 14px;
    }
    
    .item-value {
        font-size: 13px;
    }
    
    .item-meta {
        font-size: 11px;
        gap: 8px;
    }
    
    .item-actions {
        gap: 6px;
    }
    
    .item-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .selection-bar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .selection-info {
        text-align: center;
        font-size: 14px;
    }
    
    .selection-actions {
        justify-content: center;
    }
    
    .selection-btn {
        flex: 1;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .empty-icon,
    .no-results-icon {
        font-size: 60px;
        margin-bottom: 16px;
    }
    
    .empty-title,
    .no-results-title {
        font-size: 18px;
    }
    
    .empty-subtitle,
    .no-results-subtitle {
        font-size: 13px;
    }
    
    .no-results-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .no-results-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

@media (max-width: 375px) {
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
    }
    
    .item-card-inner {
        padding: 10px;
        gap: 8px;
    }
    
    .item-main {
        gap: 8px;
    }
    
    .item-icon-container {
        min-width: 44px;
    }
    
    .item-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .selection-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .selection-btn {
        max-width: none;
    }
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
    .item-card,
    .header-action-btn,
    .item-action-btn,
    .selection-btn {
        transition: none !important;
        animation: none !important;
    }
    
    .rare-glow {
        animation: none !important;
        opacity: 0.1;
    }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    .item-card {
        background: rgba(52, 73, 94, 0.95);
        color: var(--white);
    }
    
    .item-card.selected {
        background: rgba(102, 126, 234, 0.2);
    }
    
    .item-name {
        color: var(--white);
    }
    
    .item-meta {
        color: #adb5bd;
    }
    
    .item-date {
        color: #6c757d;
    }
    
    .selection-bar {
        background: rgba(44, 62, 80, 0.98);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .selection-info {
        color: var(--white);
    }
    
    .filter-select {
        background: rgba(52, 73, 94, 0.8);
    }
}