.models-grid {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 24px;
}

.model-card {
 background: var(--bg-surface);
 border: 1px solid var(--border-color);
 border-radius: 12px;
 overflow: hidden;
 transition: all 0.3s ease;
 cursor: pointer;
}

.model-card:hover {
 transform: translateY(-4px);
 border-color: rgba(0, 212, 255, 0.3);
 box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.model-banner {
 width: 100%;
 height: 220px;
 object-fit: cover;
 object-position: top;
 border-radius: 8px 8px 0 0;
 background: rgba(255, 255, 255, 0.05);
}

.model-icon-fallback {
 width: 100%;
 height: 220px;
 display: flex;
 align-items: center;
 justify-content: center;
 background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 97, 255, 0.1));
 font-size: 64px;
 color: var(--primary-color);
}

.model-card {
    padding: 0;
}

.model-image {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    overflow: hidden;
}

.model-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 20px 8px 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.model-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

.model-type-badge.badge-core {
    background: rgba(0, 212, 255, 0.9);
    color: #000;
    border: 1px solid rgba(0, 212, 255, 1);
}

.model-type-badge.badge-custom {
    background: rgba(123, 97, 255, 0.9);
    color: #fff;
    border: 1px solid rgba(123, 97, 255, 1);
}

.model-type-badge.badge-merged {
    background: rgba(255, 107, 107, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 107, 107, 1);
}

.model-type-badge.badge-upscaler {
    background: rgba(52, 211, 153, 0.9);
    color: #000;
    border: 1px solid rgba(52, 211, 153, 1);
}

.model-type-badge.badge-motion {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    border: 1px solid rgba(255, 193, 7, 1);
}

.favorite-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.favorite-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
}

.favorite-btn i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    transition: color 0.3s ease;
}

.favorite-btn:hover i,
.favorite-btn[data-favorited="true"] i {
    color: #ff6b6b;
}

.model-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 20px 12px 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.model-base-info {
    margin: 0 20px 12px 20px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-base-info i {
    color: var(--primary-color);
}

.model-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.model-stats .stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-stats .stat i {
    color: var(--primary-color);
    font-size: 14px;
}

.model-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 20px 20px;
}

.model-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.model-btn:hover {
    background: var(--bg-surface);
    border-color: rgba(0, 212, 255, 0.3);
}

.model-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: #000;
    font-weight: 700;
}

.model-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 212, 255, 0.3);
}

.model-btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.model-btn-secondary:hover {
    background: var(--bg-surface);
    border-color: rgba(0, 212, 255, 0.3);
}

/* Models Grid Responsive */
@media (max-width: 1024px) {
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .model-title {
        font-size: 16px;
        margin: 12px 16px 8px 16px;
    }
    
    .model-description {
        margin: 0 16px 12px 16px;
        font-size: 13px;
    }
    
    .model-base-info {
        margin: 0 16px 12px 16px;
        font-size: 12px;
    }
    
    .model-stats {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .model-actions {
        padding: 0 16px 16px 16px;
    }
    
    .model-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .models-grid {
        grid-template-columns: 1fr;
    }
}