/* ===== ITEMS DATABASE PAGE STYLES ===== */

/* Grade Color Variables - Matching character modal */
:root {
    --grade-common: #b0b0b0;
    --grade-common-bg: rgba(128, 128, 128, 0.15);
    --grade-common-border: rgba(128, 128, 128, 0.35);
    
    --grade-rare: #00cc00;
    --grade-rare-bg: rgba(0, 135, 11, 0.15);
    --grade-rare-border: rgba(0, 135, 11, 0.4);
    
    --grade-unique: #ffd700;
    --grade-unique-bg: rgba(255, 215, 0, 0.12);
    --grade-unique-border: rgba(255, 215, 0, 0.4);
    
    --grade-legend: #6699ff;
    --grade-legend-bg: rgba(51, 102, 255, 0.12);
    --grade-legend-border: rgba(51, 102, 255, 0.4);
    
    --grade-heroic: #ff9933;
    --grade-heroic-bg: rgba(255, 140, 0, 0.12);
    --grade-heroic-border: rgba(255, 140, 0, 0.4);
}

/* Page Layout */
.items-page {
    height: 100vh;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
}

.items-container {
    position: relative;
    z-index: 10;
    max-width: 1600px;
    margin: 0 auto;
    padding: 80px 24px 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding-bottom: 72px;
    /* Prevent layout shifts from propagating to parent */
    contain: layout style;
}

/* Fixed Header Section */
.items-fixed-header {
    flex-shrink: 0;
    background: transparent;
    padding-bottom: 16px;
}

/* Header - Matching Leaderboard Style */
.items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.items-title {
    font-size: 1.6rem;
    color: #FF9500;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(255, 149, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(255, 149, 0, 0.3));
}

.items-subtitle {
    font-size: 0.9rem;
    color: rgba(176, 196, 222, 0.7);
    margin: 4px 0 0;
    line-height: 1.2;
}

.items-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Filters Section - Matching Leaderboard Filter Bar */
.items-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* Search Input - Compact Style */
.items-filters .search-compact {
    position: relative;
    flex-shrink: 0;
}

.items-filters .search-compact::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.items-filters .search-compact input {
    background: linear-gradient(135deg, rgba(20, 25, 38, 0.95) 0%, rgba(25, 32, 48, 0.9) 100%);
    border: 1px solid rgba(255, 149, 0, 0.2);
    color: #fff;
    padding: 12px 16px 12px 38px;
    border-radius: 10px;
    font-size: 0.85rem;
    width: 180px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.items-filters .search-compact input:hover {
    border-color: rgba(255, 149, 0, 0.5);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
}

.items-filters .search-compact input:focus {
    outline: none;
    border-color: #FF9500;
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.15), 0 4px 12px rgba(255, 149, 0, 0.2);
}

.items-filters .search-compact input::placeholder {
    color: rgba(176, 196, 222, 0.4);
}

/* Custom Dropdown Styles */
.items-filters .custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 140px;
}

.items-filters .custom-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(20, 25, 38, 0.95) 0%, rgba(25, 32, 48, 0.9) 100%);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.items-filters .custom-dropdown-toggle:hover {
    border-color: rgba(255, 149, 0, 0.5);
    background: linear-gradient(135deg, rgba(25, 30, 45, 0.98) 0%, rgba(30, 38, 55, 0.95) 100%);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
}

.items-filters .custom-dropdown-toggle.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.items-filters .custom-dropdown.open .custom-dropdown-toggle {
    border-color: #FF9500;
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.15), 0 4px 12px rgba(255, 149, 0, 0.2);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.items-filters .custom-dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 149, 0, 0.7);
    transition: transform 0.2s ease;
}

.items-filters .custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.items-filters .custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 25, 38, 0.98);
    border: 1px solid rgba(255, 149, 0, 0.4);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.items-filters .custom-dropdown.open .custom-dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
}

.items-filters .custom-dropdown-item {
    padding: 11px 16px;
    color: rgba(200, 220, 245, 0.85);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.items-filters .custom-dropdown-item:hover {
    background: rgba(255, 149, 0, 0.15);
    color: #FFD700;
}

.items-filters .custom-dropdown-item.selected {
    background: rgba(255, 149, 0, 0.2);
    color: #FF9500;
    font-weight: 500;
}

.items-filters .custom-dropdown-item:last-child {
    border-radius: 0 0 9px 9px;
}

/* Scrollbar for dropdown menu */
.items-filters .custom-dropdown-menu::-webkit-scrollbar {
    width: 5px;
}

.items-filters .custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.items-filters .custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 149, 0, 0.3);
    border-radius: 3px;
}

.items-filters .custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 149, 0, 0.5);
}

/* Clear Filters Button */
.items-filters .clear-filters-btn {
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(200, 215, 240, 0.8);
    background: linear-gradient(135deg, rgba(100, 100, 120, 0.15) 0%, rgba(80, 80, 100, 0.1) 100%);
    border: 1px solid rgba(100, 100, 120, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    margin-left: auto;
}

.items-filters .clear-filters-btn:hover {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.15) 0%, rgba(255, 80, 80, 0.1) 100%);
    border-color: rgba(255, 100, 100, 0.4);
    color: #ff8888;
}

/* Extendable Filter Toggle - styled exactly like dropdowns */
.items-filters .extendable-toggle {
    min-width: auto;
}

.items-filters .extendable-toggle .custom-dropdown-toggle {
    gap: 8px;
}

/* Real checkbox input styled */
.items-filters .extendable-toggle .extendable-checkbox-input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #FF9500;
    cursor: pointer;
    flex-shrink: 0;
}

/* Checked state */
.items-filters .extendable-toggle.checked .custom-dropdown-toggle {
    border-color: #FF9500;
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.15), 0 4px 12px rgba(255, 149, 0, 0.2);
}

.items-filters .extendable-toggle.checked .dropdown-label {
    color: #FF9500;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
    font-size: 0.85rem;
    color: rgba(176, 196, 222, 0.6);
}

#resultsCount {
    font-weight: 500;
}

.pagination-info {
    color: rgba(176, 196, 222, 0.5);
}

/* Scrollable Items Container */
.items-scroll-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 0 4px 20px;
}

/* Custom scrollbar for items grid */
.items-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}

.items-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 149, 0, 0.05);
    border-radius: 3px;
}

.items-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 149, 0, 0.25);
    border-radius: 3px;
}

.items-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 149, 0, 0.4);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    min-height: 200px;
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

/* Item Card - Enhanced Design */
.item-card {
    background: linear-gradient(135deg, rgba(20, 25, 38, 0.95) 0%, rgba(25, 32, 48, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--card-grade-color, transparent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--card-grade-color, transparent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.item-card:hover::after {
    opacity: 0.02;
}

.item-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Grade-specific card styles */
.item-card.grade-common { --card-grade-color: var(--grade-common); }
.item-card.grade-rare { --card-grade-color: var(--grade-rare); }
.item-card.grade-unique { --card-grade-color: var(--grade-unique); }
.item-card.grade-legend { --card-grade-color: var(--grade-legend); }
.item-card.grade-heroic { --card-grade-color: var(--grade-heroic); }

.item-card-header {
    position: relative;
    margin-bottom: 10px;
    width: 56px;
    height: 56px;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    transition: all 0.25s ease;
}

.item-card:hover .item-image {
    border-color: var(--card-grade-color, rgba(255, 255, 255, 0.15));
}

.item-grade-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.item-grade-badge.grade-common { background: linear-gradient(135deg, #888888 0%, #666666 100%); }
.item-grade-badge.grade-rare { background: linear-gradient(135deg, #00cc00 0%, #009900 100%); }
.item-grade-badge.grade-unique { background: linear-gradient(135deg, #ffd700 0%, #cc9900 100%); }
.item-grade-badge.grade-legend { background: linear-gradient(135deg, #6699ff 0%, #3366cc 100%); }
.item-grade-badge.grade-heroic { background: linear-gradient(135deg, #ff9933 0%, #cc6600 100%); }

.item-card-body {
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 1;
}

.item-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 3px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #e8eef8;
    transition: color 0.25s ease;
}

.item-card.grade-common .item-name { color: var(--grade-common); }
.item-card.grade-rare .item-name { color: var(--grade-rare); }
.item-card.grade-unique .item-name { color: var(--grade-unique); }
.item-card.grade-legend .item-name { color: var(--grade-legend); }
.item-card.grade-heroic .item-name { color: var(--grade-heroic); }

.item-category {
    font-size: 0.65rem;
    color: rgba(176, 196, 222, 0.5);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.item-options-preview {
    font-size: 0.6rem;
    color: rgba(176, 196, 222, 0.4);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.item-card-footer {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.item-tradable {
    font-size: 0.6rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}

.item-tradable.can-trade {
    color: #4ade80;
}

.item-tradable.no-trade {
    color: #f87171;
}

/* Item Tags - Used in cards and modals */
.item-tag {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.item-tag.tag-tradable {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.item-tag.tag-bound {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.item-tag.tag-extendable {
    background: rgba(147, 112, 219, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(147, 112, 219, 0.3);
}

/* Modal item name row with tags */
.modal-item-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-item-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.modal-item-tags .item-tag {
    font-size: 0.55rem;
    padding: 2px 5px;
}

/* Loading / Empty / Error States */
.loading-state,
.error-state,
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: rgba(176, 196, 222, 0.6);
    background: rgba(20, 25, 38, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.loading-state .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 149, 0, 0.15);
    border-top-color: #FF9500;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-icon,
.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.loading-state p,
.error-state p,
.empty-state p {
    font-size: 0.9rem;
    margin: 8px 0 0;
    color: rgba(176, 196, 222, 0.7);
}

.empty-hint {
    font-size: 0.8rem;
    color: rgba(176, 196, 222, 0.4);
    margin-top: 4px;
}

.retry-btn {
    margin-top: 16px;
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2) 0%, rgba(255, 119, 0, 0.12) 100%);
    border: 1px solid rgba(255, 149, 0, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.retry-btn:hover {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.35) 0%, rgba(255, 119, 0, 0.25) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.2);
}

/* Pagination - Fixed at Bottom */
.items-pagination {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 16px 0 8px;
    margin-top: auto;
    background: transparent;
}

.page-btn,
.pagination-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(200, 215, 240, 0.8);
    background: linear-gradient(135deg, rgba(20, 25, 38, 0.95) 0%, rgba(25, 32, 48, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.page-btn:hover:not(:disabled),
.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 119, 0, 0.08) 100%);
    border-color: rgba(255, 149, 0, 0.4);
    color: #FF9500;
    transform: translateY(-1px);
}

.page-btn:disabled,
.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-btn.active {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.25) 0%, rgba(255, 119, 0, 0.15) 100%);
    border-color: rgba(255, 149, 0, 0.5);
    color: #FF9500;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
}

.page-numbers {
    display: flex;
    gap: 4px;
}

/* ================= ITEM MODAL - TOOLTIP STYLE ================= */
.item-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none; /* Use display:none to completely remove from layout */
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    /* Prevent modal from contributing to CLS */
    contain: layout style paint;
}

.item-modal-overlay.active {
    display: flex; /* Only participate in layout when active */
    opacity: 1;
    visibility: visible;
}

.item-modal {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    background: linear-gradient(135deg, rgba(18, 22, 30, 0.98) 0%, rgba(22, 28, 38, 0.98) 100%);
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 
                0 0 0 1px rgba(255, 255, 255, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Noto Sans', 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #dcdcdc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.item-modal-overlay.active .item-modal {
    transform: scale(1) translateY(0);
}

/* Modal grade borders */
.item-modal.modal-grade-common { border-color: var(--grade-common-border); }
.item-modal.modal-grade-rare { border-color: var(--grade-rare-border); }
.item-modal.modal-grade-unique { 
    border-color: var(--grade-unique-border); 
    box-shadow: 0 25px 80px rgba(0,0,0,0.8), 
                0 0 0 1px var(--grade-unique-border),
                inset 0 0 40px rgba(255, 215, 0, 0.03); 
}
.item-modal.modal-grade-legend { 
    border-color: var(--grade-legend-border); 
    box-shadow: 0 25px 80px rgba(0,0,0,0.8), 
                0 0 0 1px var(--grade-legend-border),
                inset 0 0 40px rgba(102, 153, 255, 0.03); 
}
.item-modal.modal-grade-heroic { 
    border-color: var(--grade-heroic-border); 
    box-shadow: 0 25px 80px rgba(0,0,0,0.8), 
                0 0 0 1px var(--grade-heroic-border),
                inset 0 0 40px rgba(255, 153, 51, 0.03); 
}

.item-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 1.3rem;
    line-height: 1;
    color: rgba(200, 215, 240, 0.6);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-modal-close:hover {
    background: rgba(255, 100, 100, 0.4);
    color: #fff;
}

.item-modal-content {
    overflow-y: auto;
    max-height: 85vh;
}

/* Scrollbar for modal */
.item-modal-content::-webkit-scrollbar {
    width: 6px;
}

.item-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.item-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 149, 0, 0.25);
    border-radius: 3px;
}

.item-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 149, 0, 0.4);
}

/* Modal Header - Tooltip Style */
.modal-header-area {
    display: flex;
    padding: 18px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.04), transparent);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 14px;
}

.modal-icon-container {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

.modal-icon-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-title-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.modal-item-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    word-wrap: break-word;
}

.modal-item-category {
    font-size: 11px;
    color: rgba(176, 196, 222, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Grade text colors */
.text-grade-common { color: var(--grade-common); }
.text-grade-rare { color: var(--grade-rare); }
.text-grade-unique { color: var(--grade-unique); }
.text-grade-legend { color: var(--grade-legend); }
.text-grade-heroic { color: var(--grade-heroic); }

/* Modal Content Sections */
.modal-content-body {
    padding: 14px 18px 18px;
}

.modal-info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    color: #bbb;
    font-size: 12px;
}

.modal-info-line .info-label {
    color: #888;
}

.modal-section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    margin: 12px 0;
}

.modal-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    background: none;
    text-decoration: none;
    box-shadow: none;
}

/* Stats Rows */
.modal-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}

.modal-stat-row .stat-label {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
    box-shadow: none;
}

.modal-stat-row .stat-value {
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
    box-shadow: none;
}

.modal-stat-row .stat-extra {
    color: #4eff4e;
    margin-left: 4px;
}

.modal-stat-row .stat-range {
    color: #aaa;
    font-size: 11px;
    margin-left: 4px;
}

/* Additional stats (green) */
.modal-stat-row.additional-stat .stat-label {
    color: #4eff4e;
}

.modal-stat-row.additional-stat .stat-value {
    color: #4eff4e;
}

/* Item Description (for consumables) */
.modal-item-description {
    font-size: 12px;
    line-height: 1.5;
    color: #ccc;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.modal-item-description .desc-highlight {
    color: #FF9500;
    font-weight: 600;
}

/* Info Grid */
.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 16px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.modal-info-row .info-label {
    color: #888;
}

.modal-info-row .info-value {
    color: #ddd;
}

.modal-info-row .info-value.tradable {
    color: #5ad878;
}

.modal-info-row .info-value.not-tradable {
    color: #d85a5a;
}

/* Costumes/Skins List */
.modal-costumes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.costume-tag {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(102, 153, 255, 0.15);
    border: 1px solid rgba(102, 153, 255, 0.3);
    border-radius: 4px;
    color: #8bb4e8;
}

/* Sources List */
.modal-sources-list,
.modal-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.source-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 6px 10px;
    background: rgba(255, 149, 0, 0.15);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 6px;
    color: #ffb84d;
    transition: all 0.2s ease;
}

.source-tag:hover {
    background: rgba(255, 149, 0, 0.25);
    border-color: rgba(255, 149, 0, 0.5);
}

.source-icon {
    font-size: 13px;
    line-height: 1;
}

.source-name {
    font-weight: 500;
}

/* Random Stats Pool */
.modal-substats-pool {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
}

.substats-pool-header {
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.substats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px 24px;
}

.substat-item {
    font-size: 11px;
    display: flex;
    align-items: baseline;
    padding: 2px 0;
    gap: 4px;
}

.substat-item .substat-name {
    color: #b8b8b8;
}

.substat-item .substat-range {
    color: #4eff4e;
    font-size: 11px;
    white-space: nowrap;
}

/* Modal Footer */
.modal-footer {
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.modal-footer .trade-flag {
    color: #d85a5a;
}

.modal-footer .trade-flag.can-trade {
    color: #5ad878;
}

.modal-footer .item-id {
    color: #666;
}

.modal-footer .storage-flag {
    color: #888;
}

/* Share Button */
.item-share-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 149, 0, 0.15);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 6px;
    color: #FF9500;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-share-btn:hover {
    background: rgba(255, 149, 0, 0.25);
    border-color: rgba(255, 149, 0, 0.5);
}

.item-share-btn.copied {
    background: rgba(90, 216, 120, 0.2);
    border-color: rgba(90, 216, 120, 0.4);
    color: #5ad878;
}

.item-share-btn .share-icon {
    font-size: 12px;
}

.item-share-btn .share-label {
    font-weight: 500;
}

/* Loading State in Modal */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.modal-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 149, 0, 0.2);
    border-top-color: #FF9500;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.modal-loading-text {
    color: #FF9500;
    font-size: 13px;
}

/* Error State in Modal */
.modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.modal-error-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.modal-error-text {
    color: rgba(200, 215, 240, 0.6);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1100px) {
    .items-filters {
        flex-wrap: wrap;
    }
    
    .items-filters .custom-dropdown {
        min-width: 130px;
    }
}

@media (max-width: 900px) {
    .items-container {
        padding: 76px 16px 0;
        padding-bottom: 60px;
    }
    
    .items-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .items-filters {
        gap: 10px;
    }
    
    .items-filters .search-compact input {
        width: 160px;
    }
    
    .items-filters .custom-dropdown {
        min-width: 120px;
    }
}

@media (max-width: 600px) {
    .items-container {
        padding: 68px 10px 0;
        padding-bottom: 48px;
    }
    
    .items-fixed-header {
        padding-bottom: 8px;
    }
    
    .items-header {
        margin-bottom: 8px;
    }
    
    .items-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .items-filters .search-compact {
        grid-column: 1 / -1;
    }
    
    .items-filters .search-compact input {
        width: 100%;
        padding: 8px 12px 8px 32px;
        font-size: 0.8rem;
    }
    
    .items-filters .search-compact::before {
        left: 10px;
        font-size: 0.7rem;
    }
    
    .items-filters .custom-dropdown {
        min-width: unset;
    }
    
    .items-filters .custom-dropdown-toggle {
        justify-content: space-between;
        padding: 8px 10px;
        font-size: 0.78rem;
    }
    
    .items-filters .custom-dropdown-item {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
    
    .items-filters .clear-filters-btn {
        grid-column: 1 / -1;
        padding: 8px 12px;
        font-size: 0.8rem;
        margin-left: 0;
    }
    
    .items-filters .extendable-toggle {
        grid-column: 1 / -1;
    }
    
    .items-title {
        font-size: 1.15rem;
        gap: 6px;
    }
    
    .title-icon {
        font-size: 1rem;
    }
    
    .items-subtitle {
        font-size: 0.75rem;
        margin-top: 2px;
    }
    
    .results-info {
        margin-bottom: 8px;
        font-size: 0.78rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }
    
    .item-card {
        padding: 12px 10px;
    }
    
    .item-card-header {
        width: 48px;
        height: 48px;
    }
    
    .item-name {
        font-size: 0.75rem;
    }
    
    .items-scroll-wrapper {
        margin: 0 -12px;
        padding: 0 12px 16px;
    }
    
    .items-pagination {
        gap: 6px;
        padding: 12px 0 4px;
    }
    
    .pagination-btn {
        padding: 0 10px;
        font-size: 0.8rem;
        height: 36px;
    }
    
    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .item-modal {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .modal-info-grid {
        grid-template-columns: 1fr;
    }
    
    .substats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modal improvements for small screens */
    .modal-header-area {
        padding: 14px;
        gap: 10px;
    }
    
    .modal-icon-container {
        width: 50px;
        height: 50px;
    }
    
    .modal-item-name {
        font-size: 13px;
    }
    
    .modal-content-body {
        padding: 12px 14px 14px;
    }
    
    .modal-stat-row {
        font-size: 11px;
    }
    
    .modal-section-label {
        font-size: 10px;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 0.8rem;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .items-container {
        padding: 68px 8px 0;
        padding-bottom: 48px;
    }
    
    .items-title {
        font-size: 1.1rem;
    }
    
    .items-subtitle {
        font-size: 0.75rem;
    }
    
    .items-filters .search-compact input,
    .items-filters .custom-dropdown-toggle {
        padding: 10px 12px 10px 34px;
        font-size: 0.8rem;
    }
    
    .items-filters .custom-dropdown-toggle {
        padding: 10px 12px;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .item-card {
        padding: 10px 8px;
    }
    
    .item-card-header {
        width: 44px;
        height: 44px;
    }
    
    .item-name {
        font-size: 0.7rem;
    }
    
    .item-category {
        font-size: 0.55rem;
    }
    
    .item-grade-badge {
        font-size: 0.45rem;
        padding: 1px 4px;
    }
    
    .page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .pagination-btn {
        padding: 0 8px;
        font-size: 0.75rem;
        height: 32px;
    }
}
