/* ==========================================
   ITCH GRID CARDS - LATEST GAMES STYLE
   ========================================== */

/* Grid Container */
.itch-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Grid Layout - Like Latest Games */
.itch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 2rem;
    align-items: start;
}

/* Individual Grid Cards - Latest Games Style */
.itch-card {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

/* Card Hover Effects - Latest Games Style */
.itch-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.itch-card:hover::before {
    transform: translateX(100%);
}

.itch-card:hover {
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4), 0 20px 40px -12px rgba(139, 92, 246, 0.3);
    transform: translateY(-8px);
}

/* Card Content Wrapper - Vertical Layout */
.itch-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Card Header with Image and Badges */
.itch-card-header {
    position: relative;
    height: 160px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.itch-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.itch-card:hover .itch-card-image {
    transform: scale(1.05);
}

/* Card Badges */
.itch-card-badges {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.itch-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.itch-badge.featured {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.itch-badge.free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.itch-badge.sale {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.itch-badge.game {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.itch-badge.asset {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

/* Card Body */
.itch-card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.itch-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.3rem;
    line-height: 1.2;
    font-family: 'Orbitron', monospace;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.itch-card-description {
    color: #d1d5db;
    font-size: 0.75rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Stats */
.itch-card-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.itch-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.itch-stat-label {
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.itch-stat-value {
    font-size: 0.75rem;
    color: #d1d5db;
    font-weight: 600;
}

/* Card Footer */
.itch-card-footer {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

/* Card Price */
.itch-card-price {
    font-weight: 700;
    font-size: 1rem;
    color: #10b981;
    white-space: nowrap;
}

.itch-price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.itch-price-current {
    color: #ef4444;
    font-weight: 800;
}

/* Card Actions */
.itch-card-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: space-between;
    align-items: center;
}

.itch-btn {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 1;
}

.itch-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    min-width: 50px;
}

.itch-btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
}

.itch-btn-secondary {
    background: rgba(75, 85, 99, 0.8);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.3);
    min-width: 45px;
}

.itch-btn-secondary:hover {
    background: rgba(107, 114, 128, 0.9);
    color: white;
    transform: translateY(-2px);
}

/* Loading States */
.itch-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.itch-card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .itch-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 1.5rem;
    }
    
    .itch-grid-container {
        padding: 1rem;
    }
    
    .itch-card-header {
        height: 180px;
    }
    
    .itch-card-body {
        padding: 1rem;
    }
    
    .itch-card-footer {
        padding: 0 1rem 1rem;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .itch-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .itch-card-header {
        height: 160px;
    }
    
    .itch-card-body {
        padding: 0.75rem;
    }
    
    .itch-card-footer {
        padding: 0 0.75rem 0.75rem;
    }
    
    .itch-card-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .itch-stat {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* Special Effects - Latest Games Style Removed */
/* The shine effect is handled by ::before pseudo-element */

/* Loading Spinner Container */
.loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(167, 139, 250, 0.3);
    border-top: 4px solid #a78bfa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #d1d5db;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-state p {
    font-size: 1rem;
    line-height: 1.5;
}
