/* ===========================================
   ITEM GRID CONTAINER STYLES
   =========================================== */

.item-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin: 20px 0;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.item-grid-card {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2d2d2d;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 80px;
}

.item-grid-card:hover {
    border-color: #00d4ff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    z-index: 10;
    position: relative;
    background: #3a3a3a;
}

.item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.item-image {
    max-width: 100%;
    max-height: 64px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    margin-bottom: 6px;
}

.item-name {
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-top: 4px;
}

/* ===========================================
   SINGLE ITEM STYLES
   =========================================== */

.single-item-inline {
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin: 2px;
}

.single-item-inline:hover {
    transform: scale(1.1);
}

.single-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.single-item-image {
    border: 2px solid #444;
    border-radius: 4px;
    background: #2d2d2d;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.single-item-inline:hover .single-item-image {
    border-color: #00d4ff;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

.single-item-name {
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    word-wrap: break-word;
    max-width: 80px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* ===========================================
   TOOLTIP STYLES
   =========================================== */

.item-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 350px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 2px solid #4a4a4a;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.tooltip-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a4a4a;
}

.tooltip-image img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    margin-right: 12px;
    border: 1px solid #666;
}

.tooltip-title h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.tooltip-cost-inline {
    color: #FFD700;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
}

.tooltip-cost-inline .gold {
    color: #FFD700;
    font-weight: bold;
}

.tooltip-description {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

.tooltip-details > div {
    margin-bottom: 8px;
}

.tooltip-details > div:last-child {
    margin-bottom: 0;
}

.tooltip-tags {
    color: #a0a0a0;
}

.tooltip-stats {
    color: #90EE90;
}

.tooltip-stats ul {
    margin: 5px 0 0 15px;
    padding: 0;
    color: #90EE90;
}

.tooltip-stats li {
    margin-bottom: 2px;
    font-size: 12px;
    list-style-type: disc;
}

.tooltip-build {
    color: #87CEEB;
    font-size: 12px;
}

.tooltip-details strong {
    color: #fff;
}

.tooltip-error {
    color: #ff6b6b;
    font-style: italic;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

/* Tablet */
@media (max-width: 768px) {
    .item-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
        padding: 8px;
    }
    
    .item-grid-card {
        padding: 6px;
        min-height: 70px;
    }
    
    .item-image {
        max-height: 48px;
        margin-bottom: 4px;
    }
    
    .item-name {
        font-size: 10px;
    }
    
    .single-item-name {
        font-size: 9px;
        max-width: 70px;
    }
    
    .item-tooltip {
        max-width: 300px;
        font-size: 12px;
        padding: 12px;
    }
    
    .tooltip-image img {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
    
    .tooltip-title h3 {
        font-size: 15px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .item-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 4px;
        padding: 6px;
    }
    
    .item-grid-card {
        padding: 4px;
        min-height: 60px;
    }
    
    .item-image {
        max-height: 40px;
        margin-bottom: 3px;
    }
    
    .item-name {
        font-size: 9px;
        -webkit-line-clamp: 1;
    }
    
    .single-item-name {
        font-size: 8px;
        max-width: 60px;
        -webkit-line-clamp: 1;
    }
    
    .item-tooltip {
        max-width: 280px;
        font-size: 11px;
        padding: 10px;
    }
    
    .tooltip-image img {
        width: 36px;
        height: 36px;
        margin-right: 8px;
    }
    
    .tooltip-title h3 {
        font-size: 14px;
    }
    
    .tooltip-cost-inline {
        font-size: 13px;
    }
}